Skip to main content

google_cloud_dialogflow_cx_v3/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [Agents][crate::client::Agents].
18#[cfg(feature = "agents")]
19#[cfg_attr(docsrs, doc(cfg(feature = "agents")))]
20pub mod agents {
21    use crate::Result;
22
23    /// A builder for [Agents][crate::client::Agents].
24    ///
25    /// ```
26    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
27    /// # use google_cloud_dialogflow_cx_v3::*;
28    /// # use builder::agents::ClientBuilder;
29    /// # use client::Agents;
30    /// let builder : ClientBuilder = Agents::builder();
31    /// let client = builder
32    ///     .with_endpoint("https://dialogflow.googleapis.com")
33    ///     .build().await?;
34    /// # Ok(()) }
35    /// ```
36    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38    pub(crate) mod client {
39        use super::super::super::client::Agents;
40        pub struct Factory;
41        impl crate::ClientFactory for Factory {
42            type Client = Agents;
43            type Credentials = gaxi::options::Credentials;
44            async fn build(
45                self,
46                config: gaxi::options::ClientConfig,
47            ) -> crate::ClientBuilderResult<Self::Client> {
48                Self::Client::new(config).await
49            }
50        }
51    }
52
53    /// Common implementation for [crate::client::Agents] request builders.
54    #[derive(Clone, Debug)]
55    pub(crate) struct RequestBuilder<R: std::default::Default> {
56        stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>,
57        request: R,
58        options: crate::RequestOptions,
59    }
60
61    impl<R> RequestBuilder<R>
62    where
63        R: std::default::Default,
64    {
65        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: crate::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Agents::list_agents][crate::client::Agents::list_agents] calls.
75    ///
76    /// # Example
77    /// ```
78    /// # use google_cloud_dialogflow_cx_v3::builder::agents::ListAgents;
79    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
80    /// use google_cloud_gax::paginator::ItemPaginator;
81    ///
82    /// let builder = prepare_request_builder();
83    /// let mut items = builder.by_item();
84    /// while let Some(result) = items.next().await {
85    ///   let item = result?;
86    /// }
87    /// # Ok(()) }
88    ///
89    /// fn prepare_request_builder() -> ListAgents {
90    ///   # panic!();
91    ///   // ... details omitted ...
92    /// }
93    /// ```
94    #[derive(Clone, Debug)]
95    pub struct ListAgents(RequestBuilder<crate::model::ListAgentsRequest>);
96
97    impl ListAgents {
98        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
99            Self(RequestBuilder::new(stub))
100        }
101
102        /// Sets the full request, replacing any prior values.
103        pub fn with_request<V: Into<crate::model::ListAgentsRequest>>(mut self, v: V) -> Self {
104            self.0.request = v.into();
105            self
106        }
107
108        /// Sets all the options, replacing any prior values.
109        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
110            self.0.options = v.into();
111            self
112        }
113
114        /// Sends the request.
115        pub async fn send(self) -> Result<crate::model::ListAgentsResponse> {
116            (*self.0.stub)
117                .list_agents(self.0.request, self.0.options)
118                .await
119                .map(crate::Response::into_body)
120        }
121
122        /// Streams each page in the collection.
123        pub fn by_page(
124            self,
125        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAgentsResponse, crate::Error>
126        {
127            use std::clone::Clone;
128            let token = self.0.request.page_token.clone();
129            let execute = move |token: String| {
130                let mut builder = self.clone();
131                builder.0.request = builder.0.request.set_page_token(token);
132                builder.send()
133            };
134            google_cloud_gax::paginator::internal::new_paginator(token, execute)
135        }
136
137        /// Streams each item in the collection.
138        pub fn by_item(
139            self,
140        ) -> impl google_cloud_gax::paginator::ItemPaginator<
141            crate::model::ListAgentsResponse,
142            crate::Error,
143        > {
144            use google_cloud_gax::paginator::Paginator;
145            self.by_page().items()
146        }
147
148        /// Sets the value of [parent][crate::model::ListAgentsRequest::parent].
149        ///
150        /// This is a **required** field for requests.
151        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152            self.0.request.parent = v.into();
153            self
154        }
155
156        /// Sets the value of [page_size][crate::model::ListAgentsRequest::page_size].
157        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158            self.0.request.page_size = v.into();
159            self
160        }
161
162        /// Sets the value of [page_token][crate::model::ListAgentsRequest::page_token].
163        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164            self.0.request.page_token = v.into();
165            self
166        }
167    }
168
169    #[doc(hidden)]
170    impl crate::RequestBuilder for ListAgents {
171        fn request_options(&mut self) -> &mut crate::RequestOptions {
172            &mut self.0.options
173        }
174    }
175
176    /// The request builder for [Agents::get_agent][crate::client::Agents::get_agent] calls.
177    ///
178    /// # Example
179    /// ```
180    /// # use google_cloud_dialogflow_cx_v3::builder::agents::GetAgent;
181    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
182    ///
183    /// let builder = prepare_request_builder();
184    /// let response = builder.send().await?;
185    /// # Ok(()) }
186    ///
187    /// fn prepare_request_builder() -> GetAgent {
188    ///   # panic!();
189    ///   // ... details omitted ...
190    /// }
191    /// ```
192    #[derive(Clone, Debug)]
193    pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
194
195    impl GetAgent {
196        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
197            Self(RequestBuilder::new(stub))
198        }
199
200        /// Sets the full request, replacing any prior values.
201        pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
202            self.0.request = v.into();
203            self
204        }
205
206        /// Sets all the options, replacing any prior values.
207        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
208            self.0.options = v.into();
209            self
210        }
211
212        /// Sends the request.
213        pub async fn send(self) -> Result<crate::model::Agent> {
214            (*self.0.stub)
215                .get_agent(self.0.request, self.0.options)
216                .await
217                .map(crate::Response::into_body)
218        }
219
220        /// Sets the value of [name][crate::model::GetAgentRequest::name].
221        ///
222        /// This is a **required** field for requests.
223        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
224            self.0.request.name = v.into();
225            self
226        }
227    }
228
229    #[doc(hidden)]
230    impl crate::RequestBuilder for GetAgent {
231        fn request_options(&mut self) -> &mut crate::RequestOptions {
232            &mut self.0.options
233        }
234    }
235
236    /// The request builder for [Agents::create_agent][crate::client::Agents::create_agent] calls.
237    ///
238    /// # Example
239    /// ```
240    /// # use google_cloud_dialogflow_cx_v3::builder::agents::CreateAgent;
241    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
242    ///
243    /// let builder = prepare_request_builder();
244    /// let response = builder.send().await?;
245    /// # Ok(()) }
246    ///
247    /// fn prepare_request_builder() -> CreateAgent {
248    ///   # panic!();
249    ///   // ... details omitted ...
250    /// }
251    /// ```
252    #[derive(Clone, Debug)]
253    pub struct CreateAgent(RequestBuilder<crate::model::CreateAgentRequest>);
254
255    impl CreateAgent {
256        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
257            Self(RequestBuilder::new(stub))
258        }
259
260        /// Sets the full request, replacing any prior values.
261        pub fn with_request<V: Into<crate::model::CreateAgentRequest>>(mut self, v: V) -> Self {
262            self.0.request = v.into();
263            self
264        }
265
266        /// Sets all the options, replacing any prior values.
267        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
268            self.0.options = v.into();
269            self
270        }
271
272        /// Sends the request.
273        pub async fn send(self) -> Result<crate::model::Agent> {
274            (*self.0.stub)
275                .create_agent(self.0.request, self.0.options)
276                .await
277                .map(crate::Response::into_body)
278        }
279
280        /// Sets the value of [parent][crate::model::CreateAgentRequest::parent].
281        ///
282        /// This is a **required** field for requests.
283        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
284            self.0.request.parent = v.into();
285            self
286        }
287
288        /// Sets the value of [agent][crate::model::CreateAgentRequest::agent].
289        ///
290        /// This is a **required** field for requests.
291        pub fn set_agent<T>(mut self, v: T) -> Self
292        where
293            T: std::convert::Into<crate::model::Agent>,
294        {
295            self.0.request.agent = std::option::Option::Some(v.into());
296            self
297        }
298
299        /// Sets or clears the value of [agent][crate::model::CreateAgentRequest::agent].
300        ///
301        /// This is a **required** field for requests.
302        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
303        where
304            T: std::convert::Into<crate::model::Agent>,
305        {
306            self.0.request.agent = v.map(|x| x.into());
307            self
308        }
309    }
310
311    #[doc(hidden)]
312    impl crate::RequestBuilder for CreateAgent {
313        fn request_options(&mut self) -> &mut crate::RequestOptions {
314            &mut self.0.options
315        }
316    }
317
318    /// The request builder for [Agents::update_agent][crate::client::Agents::update_agent] calls.
319    ///
320    /// # Example
321    /// ```
322    /// # use google_cloud_dialogflow_cx_v3::builder::agents::UpdateAgent;
323    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
324    ///
325    /// let builder = prepare_request_builder();
326    /// let response = builder.send().await?;
327    /// # Ok(()) }
328    ///
329    /// fn prepare_request_builder() -> UpdateAgent {
330    ///   # panic!();
331    ///   // ... details omitted ...
332    /// }
333    /// ```
334    #[derive(Clone, Debug)]
335    pub struct UpdateAgent(RequestBuilder<crate::model::UpdateAgentRequest>);
336
337    impl UpdateAgent {
338        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
339            Self(RequestBuilder::new(stub))
340        }
341
342        /// Sets the full request, replacing any prior values.
343        pub fn with_request<V: Into<crate::model::UpdateAgentRequest>>(mut self, v: V) -> Self {
344            self.0.request = v.into();
345            self
346        }
347
348        /// Sets all the options, replacing any prior values.
349        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
350            self.0.options = v.into();
351            self
352        }
353
354        /// Sends the request.
355        pub async fn send(self) -> Result<crate::model::Agent> {
356            (*self.0.stub)
357                .update_agent(self.0.request, self.0.options)
358                .await
359                .map(crate::Response::into_body)
360        }
361
362        /// Sets the value of [agent][crate::model::UpdateAgentRequest::agent].
363        ///
364        /// This is a **required** field for requests.
365        pub fn set_agent<T>(mut self, v: T) -> Self
366        where
367            T: std::convert::Into<crate::model::Agent>,
368        {
369            self.0.request.agent = std::option::Option::Some(v.into());
370            self
371        }
372
373        /// Sets or clears the value of [agent][crate::model::UpdateAgentRequest::agent].
374        ///
375        /// This is a **required** field for requests.
376        pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
377        where
378            T: std::convert::Into<crate::model::Agent>,
379        {
380            self.0.request.agent = v.map(|x| x.into());
381            self
382        }
383
384        /// Sets the value of [update_mask][crate::model::UpdateAgentRequest::update_mask].
385        pub fn set_update_mask<T>(mut self, v: T) -> Self
386        where
387            T: std::convert::Into<wkt::FieldMask>,
388        {
389            self.0.request.update_mask = std::option::Option::Some(v.into());
390            self
391        }
392
393        /// Sets or clears the value of [update_mask][crate::model::UpdateAgentRequest::update_mask].
394        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
395        where
396            T: std::convert::Into<wkt::FieldMask>,
397        {
398            self.0.request.update_mask = v.map(|x| x.into());
399            self
400        }
401    }
402
403    #[doc(hidden)]
404    impl crate::RequestBuilder for UpdateAgent {
405        fn request_options(&mut self) -> &mut crate::RequestOptions {
406            &mut self.0.options
407        }
408    }
409
410    /// The request builder for [Agents::delete_agent][crate::client::Agents::delete_agent] calls.
411    ///
412    /// # Example
413    /// ```
414    /// # use google_cloud_dialogflow_cx_v3::builder::agents::DeleteAgent;
415    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
416    ///
417    /// let builder = prepare_request_builder();
418    /// let response = builder.send().await?;
419    /// # Ok(()) }
420    ///
421    /// fn prepare_request_builder() -> DeleteAgent {
422    ///   # panic!();
423    ///   // ... details omitted ...
424    /// }
425    /// ```
426    #[derive(Clone, Debug)]
427    pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
428
429    impl DeleteAgent {
430        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
431            Self(RequestBuilder::new(stub))
432        }
433
434        /// Sets the full request, replacing any prior values.
435        pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
436            self.0.request = v.into();
437            self
438        }
439
440        /// Sets all the options, replacing any prior values.
441        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
442            self.0.options = v.into();
443            self
444        }
445
446        /// Sends the request.
447        pub async fn send(self) -> Result<()> {
448            (*self.0.stub)
449                .delete_agent(self.0.request, self.0.options)
450                .await
451                .map(crate::Response::into_body)
452        }
453
454        /// Sets the value of [name][crate::model::DeleteAgentRequest::name].
455        ///
456        /// This is a **required** field for requests.
457        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
458            self.0.request.name = v.into();
459            self
460        }
461    }
462
463    #[doc(hidden)]
464    impl crate::RequestBuilder for DeleteAgent {
465        fn request_options(&mut self) -> &mut crate::RequestOptions {
466            &mut self.0.options
467        }
468    }
469
470    /// The request builder for [Agents::export_agent][crate::client::Agents::export_agent] calls.
471    ///
472    /// # Example
473    /// ```
474    /// # use google_cloud_dialogflow_cx_v3::builder::agents::ExportAgent;
475    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
476    /// use google_cloud_lro::Poller;
477    ///
478    /// let builder = prepare_request_builder();
479    /// let response = builder.poller().until_done().await?;
480    /// # Ok(()) }
481    ///
482    /// fn prepare_request_builder() -> ExportAgent {
483    ///   # panic!();
484    ///   // ... details omitted ...
485    /// }
486    /// ```
487    #[derive(Clone, Debug)]
488    pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
489
490    impl ExportAgent {
491        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
492            Self(RequestBuilder::new(stub))
493        }
494
495        /// Sets the full request, replacing any prior values.
496        pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
497            self.0.request = v.into();
498            self
499        }
500
501        /// Sets all the options, replacing any prior values.
502        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
503            self.0.options = v.into();
504            self
505        }
506
507        /// Sends the request.
508        ///
509        /// # Long running operations
510        ///
511        /// This starts, but does not poll, a longrunning operation. More information
512        /// on [export_agent][crate::client::Agents::export_agent].
513        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
514            (*self.0.stub)
515                .export_agent(self.0.request, self.0.options)
516                .await
517                .map(crate::Response::into_body)
518        }
519
520        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_agent`.
521        pub fn poller(
522            self,
523        ) -> impl google_cloud_lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
524            type Operation = google_cloud_lro::internal::Operation<
525                crate::model::ExportAgentResponse,
526                wkt::Struct,
527            >;
528            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
529            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
530
531            let stub = self.0.stub.clone();
532            let mut options = self.0.options.clone();
533            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
534            let query = move |name| {
535                let stub = stub.clone();
536                let options = options.clone();
537                async {
538                    let op = GetOperation::new(stub)
539                        .set_name(name)
540                        .with_options(options)
541                        .send()
542                        .await?;
543                    Ok(Operation::new(op))
544                }
545            };
546
547            let start = move || async {
548                let op = self.send().await?;
549                Ok(Operation::new(op))
550            };
551
552            google_cloud_lro::internal::new_poller(
553                polling_error_policy,
554                polling_backoff_policy,
555                start,
556                query,
557            )
558        }
559
560        /// Sets the value of [name][crate::model::ExportAgentRequest::name].
561        ///
562        /// This is a **required** field for requests.
563        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
564            self.0.request.name = v.into();
565            self
566        }
567
568        /// Sets the value of [agent_uri][crate::model::ExportAgentRequest::agent_uri].
569        pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
570            self.0.request.agent_uri = v.into();
571            self
572        }
573
574        /// Sets the value of [data_format][crate::model::ExportAgentRequest::data_format].
575        pub fn set_data_format<T: Into<crate::model::export_agent_request::DataFormat>>(
576            mut self,
577            v: T,
578        ) -> Self {
579            self.0.request.data_format = v.into();
580            self
581        }
582
583        /// Sets the value of [environment][crate::model::ExportAgentRequest::environment].
584        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
585            self.0.request.environment = v.into();
586            self
587        }
588
589        /// Sets the value of [git_destination][crate::model::ExportAgentRequest::git_destination].
590        pub fn set_git_destination<T>(mut self, v: T) -> Self
591        where
592            T: std::convert::Into<crate::model::export_agent_request::GitDestination>,
593        {
594            self.0.request.git_destination = std::option::Option::Some(v.into());
595            self
596        }
597
598        /// Sets or clears the value of [git_destination][crate::model::ExportAgentRequest::git_destination].
599        pub fn set_or_clear_git_destination<T>(mut self, v: std::option::Option<T>) -> Self
600        where
601            T: std::convert::Into<crate::model::export_agent_request::GitDestination>,
602        {
603            self.0.request.git_destination = v.map(|x| x.into());
604            self
605        }
606
607        /// Sets the value of [include_bigquery_export_settings][crate::model::ExportAgentRequest::include_bigquery_export_settings].
608        pub fn set_include_bigquery_export_settings<T: Into<bool>>(mut self, v: T) -> Self {
609            self.0.request.include_bigquery_export_settings = v.into();
610            self
611        }
612    }
613
614    #[doc(hidden)]
615    impl crate::RequestBuilder for ExportAgent {
616        fn request_options(&mut self) -> &mut crate::RequestOptions {
617            &mut self.0.options
618        }
619    }
620
621    /// The request builder for [Agents::restore_agent][crate::client::Agents::restore_agent] calls.
622    ///
623    /// # Example
624    /// ```
625    /// # use google_cloud_dialogflow_cx_v3::builder::agents::RestoreAgent;
626    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
627    /// use google_cloud_lro::Poller;
628    ///
629    /// let builder = prepare_request_builder();
630    /// let response = builder.poller().until_done().await?;
631    /// # Ok(()) }
632    ///
633    /// fn prepare_request_builder() -> RestoreAgent {
634    ///   # panic!();
635    ///   // ... details omitted ...
636    /// }
637    /// ```
638    #[derive(Clone, Debug)]
639    pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
640
641    impl RestoreAgent {
642        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
643            Self(RequestBuilder::new(stub))
644        }
645
646        /// Sets the full request, replacing any prior values.
647        pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
648            self.0.request = v.into();
649            self
650        }
651
652        /// Sets all the options, replacing any prior values.
653        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
654            self.0.options = v.into();
655            self
656        }
657
658        /// Sends the request.
659        ///
660        /// # Long running operations
661        ///
662        /// This starts, but does not poll, a longrunning operation. More information
663        /// on [restore_agent][crate::client::Agents::restore_agent].
664        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
665            (*self.0.stub)
666                .restore_agent(self.0.request, self.0.options)
667                .await
668                .map(crate::Response::into_body)
669        }
670
671        /// Creates a [Poller][google_cloud_lro::Poller] to work with `restore_agent`.
672        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
673            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
674            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
675            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
676
677            let stub = self.0.stub.clone();
678            let mut options = self.0.options.clone();
679            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
680            let query = move |name| {
681                let stub = stub.clone();
682                let options = options.clone();
683                async {
684                    let op = GetOperation::new(stub)
685                        .set_name(name)
686                        .with_options(options)
687                        .send()
688                        .await?;
689                    Ok(Operation::new(op))
690                }
691            };
692
693            let start = move || async {
694                let op = self.send().await?;
695                Ok(Operation::new(op))
696            };
697
698            google_cloud_lro::internal::new_unit_response_poller(
699                polling_error_policy,
700                polling_backoff_policy,
701                start,
702                query,
703            )
704        }
705
706        /// Sets the value of [name][crate::model::RestoreAgentRequest::name].
707        ///
708        /// This is a **required** field for requests.
709        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
710            self.0.request.name = v.into();
711            self
712        }
713
714        /// Sets the value of [restore_option][crate::model::RestoreAgentRequest::restore_option].
715        pub fn set_restore_option<T: Into<crate::model::restore_agent_request::RestoreOption>>(
716            mut self,
717            v: T,
718        ) -> Self {
719            self.0.request.restore_option = v.into();
720            self
721        }
722
723        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent].
724        ///
725        /// Note that all the setters affecting `agent` are
726        /// mutually exclusive.
727        pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
728            mut self,
729            v: T,
730        ) -> Self {
731            self.0.request.agent = v.into();
732            self
733        }
734
735        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
736        /// to hold a `AgentUri`.
737        ///
738        /// Note that all the setters affecting `agent` are
739        /// mutually exclusive.
740        pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741            self.0.request = self.0.request.set_agent_uri(v);
742            self
743        }
744
745        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
746        /// to hold a `AgentContent`.
747        ///
748        /// Note that all the setters affecting `agent` are
749        /// mutually exclusive.
750        pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
751            self.0.request = self.0.request.set_agent_content(v);
752            self
753        }
754
755        /// Sets the value of [agent][crate::model::RestoreAgentRequest::agent]
756        /// to hold a `GitSource`.
757        ///
758        /// Note that all the setters affecting `agent` are
759        /// mutually exclusive.
760        pub fn set_git_source<
761            T: std::convert::Into<std::boxed::Box<crate::model::restore_agent_request::GitSource>>,
762        >(
763            mut self,
764            v: T,
765        ) -> Self {
766            self.0.request = self.0.request.set_git_source(v);
767            self
768        }
769    }
770
771    #[doc(hidden)]
772    impl crate::RequestBuilder for RestoreAgent {
773        fn request_options(&mut self) -> &mut crate::RequestOptions {
774            &mut self.0.options
775        }
776    }
777
778    /// The request builder for [Agents::validate_agent][crate::client::Agents::validate_agent] calls.
779    ///
780    /// # Example
781    /// ```
782    /// # use google_cloud_dialogflow_cx_v3::builder::agents::ValidateAgent;
783    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
784    ///
785    /// let builder = prepare_request_builder();
786    /// let response = builder.send().await?;
787    /// # Ok(()) }
788    ///
789    /// fn prepare_request_builder() -> ValidateAgent {
790    ///   # panic!();
791    ///   // ... details omitted ...
792    /// }
793    /// ```
794    #[derive(Clone, Debug)]
795    pub struct ValidateAgent(RequestBuilder<crate::model::ValidateAgentRequest>);
796
797    impl ValidateAgent {
798        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
799            Self(RequestBuilder::new(stub))
800        }
801
802        /// Sets the full request, replacing any prior values.
803        pub fn with_request<V: Into<crate::model::ValidateAgentRequest>>(mut self, v: V) -> Self {
804            self.0.request = v.into();
805            self
806        }
807
808        /// Sets all the options, replacing any prior values.
809        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
810            self.0.options = v.into();
811            self
812        }
813
814        /// Sends the request.
815        pub async fn send(self) -> Result<crate::model::AgentValidationResult> {
816            (*self.0.stub)
817                .validate_agent(self.0.request, self.0.options)
818                .await
819                .map(crate::Response::into_body)
820        }
821
822        /// Sets the value of [name][crate::model::ValidateAgentRequest::name].
823        ///
824        /// This is a **required** field for requests.
825        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
826            self.0.request.name = v.into();
827            self
828        }
829
830        /// Sets the value of [language_code][crate::model::ValidateAgentRequest::language_code].
831        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
832            self.0.request.language_code = v.into();
833            self
834        }
835    }
836
837    #[doc(hidden)]
838    impl crate::RequestBuilder for ValidateAgent {
839        fn request_options(&mut self) -> &mut crate::RequestOptions {
840            &mut self.0.options
841        }
842    }
843
844    /// The request builder for [Agents::get_agent_validation_result][crate::client::Agents::get_agent_validation_result] calls.
845    ///
846    /// # Example
847    /// ```
848    /// # use google_cloud_dialogflow_cx_v3::builder::agents::GetAgentValidationResult;
849    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
850    ///
851    /// let builder = prepare_request_builder();
852    /// let response = builder.send().await?;
853    /// # Ok(()) }
854    ///
855    /// fn prepare_request_builder() -> GetAgentValidationResult {
856    ///   # panic!();
857    ///   // ... details omitted ...
858    /// }
859    /// ```
860    #[derive(Clone, Debug)]
861    pub struct GetAgentValidationResult(
862        RequestBuilder<crate::model::GetAgentValidationResultRequest>,
863    );
864
865    impl GetAgentValidationResult {
866        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
867            Self(RequestBuilder::new(stub))
868        }
869
870        /// Sets the full request, replacing any prior values.
871        pub fn with_request<V: Into<crate::model::GetAgentValidationResultRequest>>(
872            mut self,
873            v: V,
874        ) -> Self {
875            self.0.request = v.into();
876            self
877        }
878
879        /// Sets all the options, replacing any prior values.
880        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
881            self.0.options = v.into();
882            self
883        }
884
885        /// Sends the request.
886        pub async fn send(self) -> Result<crate::model::AgentValidationResult> {
887            (*self.0.stub)
888                .get_agent_validation_result(self.0.request, self.0.options)
889                .await
890                .map(crate::Response::into_body)
891        }
892
893        /// Sets the value of [name][crate::model::GetAgentValidationResultRequest::name].
894        ///
895        /// This is a **required** field for requests.
896        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
897            self.0.request.name = v.into();
898            self
899        }
900
901        /// Sets the value of [language_code][crate::model::GetAgentValidationResultRequest::language_code].
902        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
903            self.0.request.language_code = v.into();
904            self
905        }
906    }
907
908    #[doc(hidden)]
909    impl crate::RequestBuilder for GetAgentValidationResult {
910        fn request_options(&mut self) -> &mut crate::RequestOptions {
911            &mut self.0.options
912        }
913    }
914
915    /// The request builder for [Agents::get_generative_settings][crate::client::Agents::get_generative_settings] calls.
916    ///
917    /// # Example
918    /// ```
919    /// # use google_cloud_dialogflow_cx_v3::builder::agents::GetGenerativeSettings;
920    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
921    ///
922    /// let builder = prepare_request_builder();
923    /// let response = builder.send().await?;
924    /// # Ok(()) }
925    ///
926    /// fn prepare_request_builder() -> GetGenerativeSettings {
927    ///   # panic!();
928    ///   // ... details omitted ...
929    /// }
930    /// ```
931    #[derive(Clone, Debug)]
932    pub struct GetGenerativeSettings(RequestBuilder<crate::model::GetGenerativeSettingsRequest>);
933
934    impl GetGenerativeSettings {
935        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
936            Self(RequestBuilder::new(stub))
937        }
938
939        /// Sets the full request, replacing any prior values.
940        pub fn with_request<V: Into<crate::model::GetGenerativeSettingsRequest>>(
941            mut self,
942            v: V,
943        ) -> Self {
944            self.0.request = v.into();
945            self
946        }
947
948        /// Sets all the options, replacing any prior values.
949        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
950            self.0.options = v.into();
951            self
952        }
953
954        /// Sends the request.
955        pub async fn send(self) -> Result<crate::model::GenerativeSettings> {
956            (*self.0.stub)
957                .get_generative_settings(self.0.request, self.0.options)
958                .await
959                .map(crate::Response::into_body)
960        }
961
962        /// Sets the value of [name][crate::model::GetGenerativeSettingsRequest::name].
963        ///
964        /// This is a **required** field for requests.
965        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
966            self.0.request.name = v.into();
967            self
968        }
969
970        /// Sets the value of [language_code][crate::model::GetGenerativeSettingsRequest::language_code].
971        ///
972        /// This is a **required** field for requests.
973        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
974            self.0.request.language_code = v.into();
975            self
976        }
977    }
978
979    #[doc(hidden)]
980    impl crate::RequestBuilder for GetGenerativeSettings {
981        fn request_options(&mut self) -> &mut crate::RequestOptions {
982            &mut self.0.options
983        }
984    }
985
986    /// The request builder for [Agents::update_generative_settings][crate::client::Agents::update_generative_settings] calls.
987    ///
988    /// # Example
989    /// ```
990    /// # use google_cloud_dialogflow_cx_v3::builder::agents::UpdateGenerativeSettings;
991    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
992    ///
993    /// let builder = prepare_request_builder();
994    /// let response = builder.send().await?;
995    /// # Ok(()) }
996    ///
997    /// fn prepare_request_builder() -> UpdateGenerativeSettings {
998    ///   # panic!();
999    ///   // ... details omitted ...
1000    /// }
1001    /// ```
1002    #[derive(Clone, Debug)]
1003    pub struct UpdateGenerativeSettings(
1004        RequestBuilder<crate::model::UpdateGenerativeSettingsRequest>,
1005    );
1006
1007    impl UpdateGenerativeSettings {
1008        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1009            Self(RequestBuilder::new(stub))
1010        }
1011
1012        /// Sets the full request, replacing any prior values.
1013        pub fn with_request<V: Into<crate::model::UpdateGenerativeSettingsRequest>>(
1014            mut self,
1015            v: V,
1016        ) -> Self {
1017            self.0.request = v.into();
1018            self
1019        }
1020
1021        /// Sets all the options, replacing any prior values.
1022        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1023            self.0.options = v.into();
1024            self
1025        }
1026
1027        /// Sends the request.
1028        pub async fn send(self) -> Result<crate::model::GenerativeSettings> {
1029            (*self.0.stub)
1030                .update_generative_settings(self.0.request, self.0.options)
1031                .await
1032                .map(crate::Response::into_body)
1033        }
1034
1035        /// Sets the value of [generative_settings][crate::model::UpdateGenerativeSettingsRequest::generative_settings].
1036        ///
1037        /// This is a **required** field for requests.
1038        pub fn set_generative_settings<T>(mut self, v: T) -> Self
1039        where
1040            T: std::convert::Into<crate::model::GenerativeSettings>,
1041        {
1042            self.0.request.generative_settings = std::option::Option::Some(v.into());
1043            self
1044        }
1045
1046        /// Sets or clears the value of [generative_settings][crate::model::UpdateGenerativeSettingsRequest::generative_settings].
1047        ///
1048        /// This is a **required** field for requests.
1049        pub fn set_or_clear_generative_settings<T>(mut self, v: std::option::Option<T>) -> Self
1050        where
1051            T: std::convert::Into<crate::model::GenerativeSettings>,
1052        {
1053            self.0.request.generative_settings = v.map(|x| x.into());
1054            self
1055        }
1056
1057        /// Sets the value of [update_mask][crate::model::UpdateGenerativeSettingsRequest::update_mask].
1058        pub fn set_update_mask<T>(mut self, v: T) -> Self
1059        where
1060            T: std::convert::Into<wkt::FieldMask>,
1061        {
1062            self.0.request.update_mask = std::option::Option::Some(v.into());
1063            self
1064        }
1065
1066        /// Sets or clears the value of [update_mask][crate::model::UpdateGenerativeSettingsRequest::update_mask].
1067        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1068        where
1069            T: std::convert::Into<wkt::FieldMask>,
1070        {
1071            self.0.request.update_mask = v.map(|x| x.into());
1072            self
1073        }
1074    }
1075
1076    #[doc(hidden)]
1077    impl crate::RequestBuilder for UpdateGenerativeSettings {
1078        fn request_options(&mut self) -> &mut crate::RequestOptions {
1079            &mut self.0.options
1080        }
1081    }
1082
1083    /// The request builder for [Agents::list_locations][crate::client::Agents::list_locations] calls.
1084    ///
1085    /// # Example
1086    /// ```
1087    /// # use google_cloud_dialogflow_cx_v3::builder::agents::ListLocations;
1088    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1089    /// use google_cloud_gax::paginator::ItemPaginator;
1090    ///
1091    /// let builder = prepare_request_builder();
1092    /// let mut items = builder.by_item();
1093    /// while let Some(result) = items.next().await {
1094    ///   let item = result?;
1095    /// }
1096    /// # Ok(()) }
1097    ///
1098    /// fn prepare_request_builder() -> ListLocations {
1099    ///   # panic!();
1100    ///   // ... details omitted ...
1101    /// }
1102    /// ```
1103    #[derive(Clone, Debug)]
1104    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1105
1106    impl ListLocations {
1107        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1108            Self(RequestBuilder::new(stub))
1109        }
1110
1111        /// Sets the full request, replacing any prior values.
1112        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1113            mut self,
1114            v: V,
1115        ) -> Self {
1116            self.0.request = v.into();
1117            self
1118        }
1119
1120        /// Sets all the options, replacing any prior values.
1121        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1122            self.0.options = v.into();
1123            self
1124        }
1125
1126        /// Sends the request.
1127        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1128            (*self.0.stub)
1129                .list_locations(self.0.request, self.0.options)
1130                .await
1131                .map(crate::Response::into_body)
1132        }
1133
1134        /// Streams each page in the collection.
1135        pub fn by_page(
1136            self,
1137        ) -> impl google_cloud_gax::paginator::Paginator<
1138            google_cloud_location::model::ListLocationsResponse,
1139            crate::Error,
1140        > {
1141            use std::clone::Clone;
1142            let token = self.0.request.page_token.clone();
1143            let execute = move |token: String| {
1144                let mut builder = self.clone();
1145                builder.0.request = builder.0.request.set_page_token(token);
1146                builder.send()
1147            };
1148            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1149        }
1150
1151        /// Streams each item in the collection.
1152        pub fn by_item(
1153            self,
1154        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1155            google_cloud_location::model::ListLocationsResponse,
1156            crate::Error,
1157        > {
1158            use google_cloud_gax::paginator::Paginator;
1159            self.by_page().items()
1160        }
1161
1162        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1163        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164            self.0.request.name = v.into();
1165            self
1166        }
1167
1168        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1169        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1170            self.0.request.filter = v.into();
1171            self
1172        }
1173
1174        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1175        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1176            self.0.request.page_size = v.into();
1177            self
1178        }
1179
1180        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1181        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1182            self.0.request.page_token = v.into();
1183            self
1184        }
1185    }
1186
1187    #[doc(hidden)]
1188    impl crate::RequestBuilder for ListLocations {
1189        fn request_options(&mut self) -> &mut crate::RequestOptions {
1190            &mut self.0.options
1191        }
1192    }
1193
1194    /// The request builder for [Agents::get_location][crate::client::Agents::get_location] calls.
1195    ///
1196    /// # Example
1197    /// ```
1198    /// # use google_cloud_dialogflow_cx_v3::builder::agents::GetLocation;
1199    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1200    ///
1201    /// let builder = prepare_request_builder();
1202    /// let response = builder.send().await?;
1203    /// # Ok(()) }
1204    ///
1205    /// fn prepare_request_builder() -> GetLocation {
1206    ///   # panic!();
1207    ///   // ... details omitted ...
1208    /// }
1209    /// ```
1210    #[derive(Clone, Debug)]
1211    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1212
1213    impl GetLocation {
1214        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1215            Self(RequestBuilder::new(stub))
1216        }
1217
1218        /// Sets the full request, replacing any prior values.
1219        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1220            mut self,
1221            v: V,
1222        ) -> Self {
1223            self.0.request = v.into();
1224            self
1225        }
1226
1227        /// Sets all the options, replacing any prior values.
1228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1229            self.0.options = v.into();
1230            self
1231        }
1232
1233        /// Sends the request.
1234        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1235            (*self.0.stub)
1236                .get_location(self.0.request, self.0.options)
1237                .await
1238                .map(crate::Response::into_body)
1239        }
1240
1241        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1242        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1243            self.0.request.name = v.into();
1244            self
1245        }
1246    }
1247
1248    #[doc(hidden)]
1249    impl crate::RequestBuilder for GetLocation {
1250        fn request_options(&mut self) -> &mut crate::RequestOptions {
1251            &mut self.0.options
1252        }
1253    }
1254
1255    /// The request builder for [Agents::list_operations][crate::client::Agents::list_operations] calls.
1256    ///
1257    /// # Example
1258    /// ```
1259    /// # use google_cloud_dialogflow_cx_v3::builder::agents::ListOperations;
1260    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1261    /// use google_cloud_gax::paginator::ItemPaginator;
1262    ///
1263    /// let builder = prepare_request_builder();
1264    /// let mut items = builder.by_item();
1265    /// while let Some(result) = items.next().await {
1266    ///   let item = result?;
1267    /// }
1268    /// # Ok(()) }
1269    ///
1270    /// fn prepare_request_builder() -> ListOperations {
1271    ///   # panic!();
1272    ///   // ... details omitted ...
1273    /// }
1274    /// ```
1275    #[derive(Clone, Debug)]
1276    pub struct ListOperations(
1277        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1278    );
1279
1280    impl ListOperations {
1281        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1282            Self(RequestBuilder::new(stub))
1283        }
1284
1285        /// Sets the full request, replacing any prior values.
1286        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1287            mut self,
1288            v: V,
1289        ) -> Self {
1290            self.0.request = v.into();
1291            self
1292        }
1293
1294        /// Sets all the options, replacing any prior values.
1295        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1296            self.0.options = v.into();
1297            self
1298        }
1299
1300        /// Sends the request.
1301        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1302            (*self.0.stub)
1303                .list_operations(self.0.request, self.0.options)
1304                .await
1305                .map(crate::Response::into_body)
1306        }
1307
1308        /// Streams each page in the collection.
1309        pub fn by_page(
1310            self,
1311        ) -> impl google_cloud_gax::paginator::Paginator<
1312            google_cloud_longrunning::model::ListOperationsResponse,
1313            crate::Error,
1314        > {
1315            use std::clone::Clone;
1316            let token = self.0.request.page_token.clone();
1317            let execute = move |token: String| {
1318                let mut builder = self.clone();
1319                builder.0.request = builder.0.request.set_page_token(token);
1320                builder.send()
1321            };
1322            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1323        }
1324
1325        /// Streams each item in the collection.
1326        pub fn by_item(
1327            self,
1328        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1329            google_cloud_longrunning::model::ListOperationsResponse,
1330            crate::Error,
1331        > {
1332            use google_cloud_gax::paginator::Paginator;
1333            self.by_page().items()
1334        }
1335
1336        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1337        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338            self.0.request.name = v.into();
1339            self
1340        }
1341
1342        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1343        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1344            self.0.request.filter = v.into();
1345            self
1346        }
1347
1348        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
1349        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1350            self.0.request.page_size = v.into();
1351            self
1352        }
1353
1354        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
1355        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1356            self.0.request.page_token = v.into();
1357            self
1358        }
1359
1360        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
1361        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1362            self.0.request.return_partial_success = v.into();
1363            self
1364        }
1365    }
1366
1367    #[doc(hidden)]
1368    impl crate::RequestBuilder for ListOperations {
1369        fn request_options(&mut self) -> &mut crate::RequestOptions {
1370            &mut self.0.options
1371        }
1372    }
1373
1374    /// The request builder for [Agents::get_operation][crate::client::Agents::get_operation] calls.
1375    ///
1376    /// # Example
1377    /// ```
1378    /// # use google_cloud_dialogflow_cx_v3::builder::agents::GetOperation;
1379    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1380    ///
1381    /// let builder = prepare_request_builder();
1382    /// let response = builder.send().await?;
1383    /// # Ok(()) }
1384    ///
1385    /// fn prepare_request_builder() -> GetOperation {
1386    ///   # panic!();
1387    ///   // ... details omitted ...
1388    /// }
1389    /// ```
1390    #[derive(Clone, Debug)]
1391    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1392
1393    impl GetOperation {
1394        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1395            Self(RequestBuilder::new(stub))
1396        }
1397
1398        /// Sets the full request, replacing any prior values.
1399        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1400            mut self,
1401            v: V,
1402        ) -> Self {
1403            self.0.request = v.into();
1404            self
1405        }
1406
1407        /// Sets all the options, replacing any prior values.
1408        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1409            self.0.options = v.into();
1410            self
1411        }
1412
1413        /// Sends the request.
1414        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1415            (*self.0.stub)
1416                .get_operation(self.0.request, self.0.options)
1417                .await
1418                .map(crate::Response::into_body)
1419        }
1420
1421        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
1422        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1423            self.0.request.name = v.into();
1424            self
1425        }
1426    }
1427
1428    #[doc(hidden)]
1429    impl crate::RequestBuilder for GetOperation {
1430        fn request_options(&mut self) -> &mut crate::RequestOptions {
1431            &mut self.0.options
1432        }
1433    }
1434
1435    /// The request builder for [Agents::cancel_operation][crate::client::Agents::cancel_operation] calls.
1436    ///
1437    /// # Example
1438    /// ```
1439    /// # use google_cloud_dialogflow_cx_v3::builder::agents::CancelOperation;
1440    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1441    ///
1442    /// let builder = prepare_request_builder();
1443    /// let response = builder.send().await?;
1444    /// # Ok(()) }
1445    ///
1446    /// fn prepare_request_builder() -> CancelOperation {
1447    ///   # panic!();
1448    ///   // ... details omitted ...
1449    /// }
1450    /// ```
1451    #[derive(Clone, Debug)]
1452    pub struct CancelOperation(
1453        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1454    );
1455
1456    impl CancelOperation {
1457        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1458            Self(RequestBuilder::new(stub))
1459        }
1460
1461        /// Sets the full request, replacing any prior values.
1462        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1463            mut self,
1464            v: V,
1465        ) -> Self {
1466            self.0.request = v.into();
1467            self
1468        }
1469
1470        /// Sets all the options, replacing any prior values.
1471        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1472            self.0.options = v.into();
1473            self
1474        }
1475
1476        /// Sends the request.
1477        pub async fn send(self) -> Result<()> {
1478            (*self.0.stub)
1479                .cancel_operation(self.0.request, self.0.options)
1480                .await
1481                .map(crate::Response::into_body)
1482        }
1483
1484        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
1485        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1486            self.0.request.name = v.into();
1487            self
1488        }
1489    }
1490
1491    #[doc(hidden)]
1492    impl crate::RequestBuilder for CancelOperation {
1493        fn request_options(&mut self) -> &mut crate::RequestOptions {
1494            &mut self.0.options
1495        }
1496    }
1497}
1498
1499/// Request and client builders for [Changelogs][crate::client::Changelogs].
1500#[cfg(feature = "changelogs")]
1501#[cfg_attr(docsrs, doc(cfg(feature = "changelogs")))]
1502pub mod changelogs {
1503    use crate::Result;
1504
1505    /// A builder for [Changelogs][crate::client::Changelogs].
1506    ///
1507    /// ```
1508    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
1509    /// # use google_cloud_dialogflow_cx_v3::*;
1510    /// # use builder::changelogs::ClientBuilder;
1511    /// # use client::Changelogs;
1512    /// let builder : ClientBuilder = Changelogs::builder();
1513    /// let client = builder
1514    ///     .with_endpoint("https://dialogflow.googleapis.com")
1515    ///     .build().await?;
1516    /// # Ok(()) }
1517    /// ```
1518    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1519
1520    pub(crate) mod client {
1521        use super::super::super::client::Changelogs;
1522        pub struct Factory;
1523        impl crate::ClientFactory for Factory {
1524            type Client = Changelogs;
1525            type Credentials = gaxi::options::Credentials;
1526            async fn build(
1527                self,
1528                config: gaxi::options::ClientConfig,
1529            ) -> crate::ClientBuilderResult<Self::Client> {
1530                Self::Client::new(config).await
1531            }
1532        }
1533    }
1534
1535    /// Common implementation for [crate::client::Changelogs] request builders.
1536    #[derive(Clone, Debug)]
1537    pub(crate) struct RequestBuilder<R: std::default::Default> {
1538        stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1539        request: R,
1540        options: crate::RequestOptions,
1541    }
1542
1543    impl<R> RequestBuilder<R>
1544    where
1545        R: std::default::Default,
1546    {
1547        pub(crate) fn new(
1548            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1549        ) -> Self {
1550            Self {
1551                stub,
1552                request: R::default(),
1553                options: crate::RequestOptions::default(),
1554            }
1555        }
1556    }
1557
1558    /// The request builder for [Changelogs::list_changelogs][crate::client::Changelogs::list_changelogs] calls.
1559    ///
1560    /// # Example
1561    /// ```
1562    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::ListChangelogs;
1563    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1564    /// use google_cloud_gax::paginator::ItemPaginator;
1565    ///
1566    /// let builder = prepare_request_builder();
1567    /// let mut items = builder.by_item();
1568    /// while let Some(result) = items.next().await {
1569    ///   let item = result?;
1570    /// }
1571    /// # Ok(()) }
1572    ///
1573    /// fn prepare_request_builder() -> ListChangelogs {
1574    ///   # panic!();
1575    ///   // ... details omitted ...
1576    /// }
1577    /// ```
1578    #[derive(Clone, Debug)]
1579    pub struct ListChangelogs(RequestBuilder<crate::model::ListChangelogsRequest>);
1580
1581    impl ListChangelogs {
1582        pub(crate) fn new(
1583            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1584        ) -> Self {
1585            Self(RequestBuilder::new(stub))
1586        }
1587
1588        /// Sets the full request, replacing any prior values.
1589        pub fn with_request<V: Into<crate::model::ListChangelogsRequest>>(mut self, v: V) -> Self {
1590            self.0.request = v.into();
1591            self
1592        }
1593
1594        /// Sets all the options, replacing any prior values.
1595        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1596            self.0.options = v.into();
1597            self
1598        }
1599
1600        /// Sends the request.
1601        pub async fn send(self) -> Result<crate::model::ListChangelogsResponse> {
1602            (*self.0.stub)
1603                .list_changelogs(self.0.request, self.0.options)
1604                .await
1605                .map(crate::Response::into_body)
1606        }
1607
1608        /// Streams each page in the collection.
1609        pub fn by_page(
1610            self,
1611        ) -> impl google_cloud_gax::paginator::Paginator<
1612            crate::model::ListChangelogsResponse,
1613            crate::Error,
1614        > {
1615            use std::clone::Clone;
1616            let token = self.0.request.page_token.clone();
1617            let execute = move |token: String| {
1618                let mut builder = self.clone();
1619                builder.0.request = builder.0.request.set_page_token(token);
1620                builder.send()
1621            };
1622            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1623        }
1624
1625        /// Streams each item in the collection.
1626        pub fn by_item(
1627            self,
1628        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1629            crate::model::ListChangelogsResponse,
1630            crate::Error,
1631        > {
1632            use google_cloud_gax::paginator::Paginator;
1633            self.by_page().items()
1634        }
1635
1636        /// Sets the value of [parent][crate::model::ListChangelogsRequest::parent].
1637        ///
1638        /// This is a **required** field for requests.
1639        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1640            self.0.request.parent = v.into();
1641            self
1642        }
1643
1644        /// Sets the value of [filter][crate::model::ListChangelogsRequest::filter].
1645        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1646            self.0.request.filter = v.into();
1647            self
1648        }
1649
1650        /// Sets the value of [page_size][crate::model::ListChangelogsRequest::page_size].
1651        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1652            self.0.request.page_size = v.into();
1653            self
1654        }
1655
1656        /// Sets the value of [page_token][crate::model::ListChangelogsRequest::page_token].
1657        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658            self.0.request.page_token = v.into();
1659            self
1660        }
1661    }
1662
1663    #[doc(hidden)]
1664    impl crate::RequestBuilder for ListChangelogs {
1665        fn request_options(&mut self) -> &mut crate::RequestOptions {
1666            &mut self.0.options
1667        }
1668    }
1669
1670    /// The request builder for [Changelogs::get_changelog][crate::client::Changelogs::get_changelog] calls.
1671    ///
1672    /// # Example
1673    /// ```
1674    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::GetChangelog;
1675    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1676    ///
1677    /// let builder = prepare_request_builder();
1678    /// let response = builder.send().await?;
1679    /// # Ok(()) }
1680    ///
1681    /// fn prepare_request_builder() -> GetChangelog {
1682    ///   # panic!();
1683    ///   // ... details omitted ...
1684    /// }
1685    /// ```
1686    #[derive(Clone, Debug)]
1687    pub struct GetChangelog(RequestBuilder<crate::model::GetChangelogRequest>);
1688
1689    impl GetChangelog {
1690        pub(crate) fn new(
1691            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1692        ) -> Self {
1693            Self(RequestBuilder::new(stub))
1694        }
1695
1696        /// Sets the full request, replacing any prior values.
1697        pub fn with_request<V: Into<crate::model::GetChangelogRequest>>(mut self, v: V) -> Self {
1698            self.0.request = v.into();
1699            self
1700        }
1701
1702        /// Sets all the options, replacing any prior values.
1703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1704            self.0.options = v.into();
1705            self
1706        }
1707
1708        /// Sends the request.
1709        pub async fn send(self) -> Result<crate::model::Changelog> {
1710            (*self.0.stub)
1711                .get_changelog(self.0.request, self.0.options)
1712                .await
1713                .map(crate::Response::into_body)
1714        }
1715
1716        /// Sets the value of [name][crate::model::GetChangelogRequest::name].
1717        ///
1718        /// This is a **required** field for requests.
1719        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1720            self.0.request.name = v.into();
1721            self
1722        }
1723    }
1724
1725    #[doc(hidden)]
1726    impl crate::RequestBuilder for GetChangelog {
1727        fn request_options(&mut self) -> &mut crate::RequestOptions {
1728            &mut self.0.options
1729        }
1730    }
1731
1732    /// The request builder for [Changelogs::list_locations][crate::client::Changelogs::list_locations] calls.
1733    ///
1734    /// # Example
1735    /// ```
1736    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::ListLocations;
1737    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1738    /// use google_cloud_gax::paginator::ItemPaginator;
1739    ///
1740    /// let builder = prepare_request_builder();
1741    /// let mut items = builder.by_item();
1742    /// while let Some(result) = items.next().await {
1743    ///   let item = result?;
1744    /// }
1745    /// # Ok(()) }
1746    ///
1747    /// fn prepare_request_builder() -> ListLocations {
1748    ///   # panic!();
1749    ///   // ... details omitted ...
1750    /// }
1751    /// ```
1752    #[derive(Clone, Debug)]
1753    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1754
1755    impl ListLocations {
1756        pub(crate) fn new(
1757            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1758        ) -> Self {
1759            Self(RequestBuilder::new(stub))
1760        }
1761
1762        /// Sets the full request, replacing any prior values.
1763        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1764            mut self,
1765            v: V,
1766        ) -> Self {
1767            self.0.request = v.into();
1768            self
1769        }
1770
1771        /// Sets all the options, replacing any prior values.
1772        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1773            self.0.options = v.into();
1774            self
1775        }
1776
1777        /// Sends the request.
1778        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1779            (*self.0.stub)
1780                .list_locations(self.0.request, self.0.options)
1781                .await
1782                .map(crate::Response::into_body)
1783        }
1784
1785        /// Streams each page in the collection.
1786        pub fn by_page(
1787            self,
1788        ) -> impl google_cloud_gax::paginator::Paginator<
1789            google_cloud_location::model::ListLocationsResponse,
1790            crate::Error,
1791        > {
1792            use std::clone::Clone;
1793            let token = self.0.request.page_token.clone();
1794            let execute = move |token: String| {
1795                let mut builder = self.clone();
1796                builder.0.request = builder.0.request.set_page_token(token);
1797                builder.send()
1798            };
1799            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1800        }
1801
1802        /// Streams each item in the collection.
1803        pub fn by_item(
1804            self,
1805        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1806            google_cloud_location::model::ListLocationsResponse,
1807            crate::Error,
1808        > {
1809            use google_cloud_gax::paginator::Paginator;
1810            self.by_page().items()
1811        }
1812
1813        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
1814        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1815            self.0.request.name = v.into();
1816            self
1817        }
1818
1819        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
1820        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1821            self.0.request.filter = v.into();
1822            self
1823        }
1824
1825        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
1826        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1827            self.0.request.page_size = v.into();
1828            self
1829        }
1830
1831        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
1832        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1833            self.0.request.page_token = v.into();
1834            self
1835        }
1836    }
1837
1838    #[doc(hidden)]
1839    impl crate::RequestBuilder for ListLocations {
1840        fn request_options(&mut self) -> &mut crate::RequestOptions {
1841            &mut self.0.options
1842        }
1843    }
1844
1845    /// The request builder for [Changelogs::get_location][crate::client::Changelogs::get_location] calls.
1846    ///
1847    /// # Example
1848    /// ```
1849    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::GetLocation;
1850    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1851    ///
1852    /// let builder = prepare_request_builder();
1853    /// let response = builder.send().await?;
1854    /// # Ok(()) }
1855    ///
1856    /// fn prepare_request_builder() -> GetLocation {
1857    ///   # panic!();
1858    ///   // ... details omitted ...
1859    /// }
1860    /// ```
1861    #[derive(Clone, Debug)]
1862    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1863
1864    impl GetLocation {
1865        pub(crate) fn new(
1866            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1867        ) -> Self {
1868            Self(RequestBuilder::new(stub))
1869        }
1870
1871        /// Sets the full request, replacing any prior values.
1872        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1873            mut self,
1874            v: V,
1875        ) -> Self {
1876            self.0.request = v.into();
1877            self
1878        }
1879
1880        /// Sets all the options, replacing any prior values.
1881        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1882            self.0.options = v.into();
1883            self
1884        }
1885
1886        /// Sends the request.
1887        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1888            (*self.0.stub)
1889                .get_location(self.0.request, self.0.options)
1890                .await
1891                .map(crate::Response::into_body)
1892        }
1893
1894        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
1895        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1896            self.0.request.name = v.into();
1897            self
1898        }
1899    }
1900
1901    #[doc(hidden)]
1902    impl crate::RequestBuilder for GetLocation {
1903        fn request_options(&mut self) -> &mut crate::RequestOptions {
1904            &mut self.0.options
1905        }
1906    }
1907
1908    /// The request builder for [Changelogs::list_operations][crate::client::Changelogs::list_operations] calls.
1909    ///
1910    /// # Example
1911    /// ```
1912    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::ListOperations;
1913    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
1914    /// use google_cloud_gax::paginator::ItemPaginator;
1915    ///
1916    /// let builder = prepare_request_builder();
1917    /// let mut items = builder.by_item();
1918    /// while let Some(result) = items.next().await {
1919    ///   let item = result?;
1920    /// }
1921    /// # Ok(()) }
1922    ///
1923    /// fn prepare_request_builder() -> ListOperations {
1924    ///   # panic!();
1925    ///   // ... details omitted ...
1926    /// }
1927    /// ```
1928    #[derive(Clone, Debug)]
1929    pub struct ListOperations(
1930        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1931    );
1932
1933    impl ListOperations {
1934        pub(crate) fn new(
1935            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1936        ) -> Self {
1937            Self(RequestBuilder::new(stub))
1938        }
1939
1940        /// Sets the full request, replacing any prior values.
1941        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1942            mut self,
1943            v: V,
1944        ) -> Self {
1945            self.0.request = v.into();
1946            self
1947        }
1948
1949        /// Sets all the options, replacing any prior values.
1950        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1951            self.0.options = v.into();
1952            self
1953        }
1954
1955        /// Sends the request.
1956        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1957            (*self.0.stub)
1958                .list_operations(self.0.request, self.0.options)
1959                .await
1960                .map(crate::Response::into_body)
1961        }
1962
1963        /// Streams each page in the collection.
1964        pub fn by_page(
1965            self,
1966        ) -> impl google_cloud_gax::paginator::Paginator<
1967            google_cloud_longrunning::model::ListOperationsResponse,
1968            crate::Error,
1969        > {
1970            use std::clone::Clone;
1971            let token = self.0.request.page_token.clone();
1972            let execute = move |token: String| {
1973                let mut builder = self.clone();
1974                builder.0.request = builder.0.request.set_page_token(token);
1975                builder.send()
1976            };
1977            google_cloud_gax::paginator::internal::new_paginator(token, execute)
1978        }
1979
1980        /// Streams each item in the collection.
1981        pub fn by_item(
1982            self,
1983        ) -> impl google_cloud_gax::paginator::ItemPaginator<
1984            google_cloud_longrunning::model::ListOperationsResponse,
1985            crate::Error,
1986        > {
1987            use google_cloud_gax::paginator::Paginator;
1988            self.by_page().items()
1989        }
1990
1991        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
1992        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1993            self.0.request.name = v.into();
1994            self
1995        }
1996
1997        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
1998        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1999            self.0.request.filter = v.into();
2000            self
2001        }
2002
2003        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2004        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2005            self.0.request.page_size = v.into();
2006            self
2007        }
2008
2009        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2010        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011            self.0.request.page_token = v.into();
2012            self
2013        }
2014
2015        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2016        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2017            self.0.request.return_partial_success = v.into();
2018            self
2019        }
2020    }
2021
2022    #[doc(hidden)]
2023    impl crate::RequestBuilder for ListOperations {
2024        fn request_options(&mut self) -> &mut crate::RequestOptions {
2025            &mut self.0.options
2026        }
2027    }
2028
2029    /// The request builder for [Changelogs::get_operation][crate::client::Changelogs::get_operation] calls.
2030    ///
2031    /// # Example
2032    /// ```
2033    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::GetOperation;
2034    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2035    ///
2036    /// let builder = prepare_request_builder();
2037    /// let response = builder.send().await?;
2038    /// # Ok(()) }
2039    ///
2040    /// fn prepare_request_builder() -> GetOperation {
2041    ///   # panic!();
2042    ///   // ... details omitted ...
2043    /// }
2044    /// ```
2045    #[derive(Clone, Debug)]
2046    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2047
2048    impl GetOperation {
2049        pub(crate) fn new(
2050            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
2051        ) -> Self {
2052            Self(RequestBuilder::new(stub))
2053        }
2054
2055        /// Sets the full request, replacing any prior values.
2056        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2057            mut self,
2058            v: V,
2059        ) -> Self {
2060            self.0.request = v.into();
2061            self
2062        }
2063
2064        /// Sets all the options, replacing any prior values.
2065        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2066            self.0.options = v.into();
2067            self
2068        }
2069
2070        /// Sends the request.
2071        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2072            (*self.0.stub)
2073                .get_operation(self.0.request, self.0.options)
2074                .await
2075                .map(crate::Response::into_body)
2076        }
2077
2078        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2079        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2080            self.0.request.name = v.into();
2081            self
2082        }
2083    }
2084
2085    #[doc(hidden)]
2086    impl crate::RequestBuilder for GetOperation {
2087        fn request_options(&mut self) -> &mut crate::RequestOptions {
2088            &mut self.0.options
2089        }
2090    }
2091
2092    /// The request builder for [Changelogs::cancel_operation][crate::client::Changelogs::cancel_operation] calls.
2093    ///
2094    /// # Example
2095    /// ```
2096    /// # use google_cloud_dialogflow_cx_v3::builder::changelogs::CancelOperation;
2097    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2098    ///
2099    /// let builder = prepare_request_builder();
2100    /// let response = builder.send().await?;
2101    /// # Ok(()) }
2102    ///
2103    /// fn prepare_request_builder() -> CancelOperation {
2104    ///   # panic!();
2105    ///   // ... details omitted ...
2106    /// }
2107    /// ```
2108    #[derive(Clone, Debug)]
2109    pub struct CancelOperation(
2110        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2111    );
2112
2113    impl CancelOperation {
2114        pub(crate) fn new(
2115            stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
2116        ) -> Self {
2117            Self(RequestBuilder::new(stub))
2118        }
2119
2120        /// Sets the full request, replacing any prior values.
2121        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2122            mut self,
2123            v: V,
2124        ) -> Self {
2125            self.0.request = v.into();
2126            self
2127        }
2128
2129        /// Sets all the options, replacing any prior values.
2130        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2131            self.0.options = v.into();
2132            self
2133        }
2134
2135        /// Sends the request.
2136        pub async fn send(self) -> Result<()> {
2137            (*self.0.stub)
2138                .cancel_operation(self.0.request, self.0.options)
2139                .await
2140                .map(crate::Response::into_body)
2141        }
2142
2143        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2144        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2145            self.0.request.name = v.into();
2146            self
2147        }
2148    }
2149
2150    #[doc(hidden)]
2151    impl crate::RequestBuilder for CancelOperation {
2152        fn request_options(&mut self) -> &mut crate::RequestOptions {
2153            &mut self.0.options
2154        }
2155    }
2156}
2157
2158/// Request and client builders for [Deployments][crate::client::Deployments].
2159#[cfg(feature = "deployments")]
2160#[cfg_attr(docsrs, doc(cfg(feature = "deployments")))]
2161pub mod deployments {
2162    use crate::Result;
2163
2164    /// A builder for [Deployments][crate::client::Deployments].
2165    ///
2166    /// ```
2167    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2168    /// # use google_cloud_dialogflow_cx_v3::*;
2169    /// # use builder::deployments::ClientBuilder;
2170    /// # use client::Deployments;
2171    /// let builder : ClientBuilder = Deployments::builder();
2172    /// let client = builder
2173    ///     .with_endpoint("https://dialogflow.googleapis.com")
2174    ///     .build().await?;
2175    /// # Ok(()) }
2176    /// ```
2177    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2178
2179    pub(crate) mod client {
2180        use super::super::super::client::Deployments;
2181        pub struct Factory;
2182        impl crate::ClientFactory for Factory {
2183            type Client = Deployments;
2184            type Credentials = gaxi::options::Credentials;
2185            async fn build(
2186                self,
2187                config: gaxi::options::ClientConfig,
2188            ) -> crate::ClientBuilderResult<Self::Client> {
2189                Self::Client::new(config).await
2190            }
2191        }
2192    }
2193
2194    /// Common implementation for [crate::client::Deployments] request builders.
2195    #[derive(Clone, Debug)]
2196    pub(crate) struct RequestBuilder<R: std::default::Default> {
2197        stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2198        request: R,
2199        options: crate::RequestOptions,
2200    }
2201
2202    impl<R> RequestBuilder<R>
2203    where
2204        R: std::default::Default,
2205    {
2206        pub(crate) fn new(
2207            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2208        ) -> Self {
2209            Self {
2210                stub,
2211                request: R::default(),
2212                options: crate::RequestOptions::default(),
2213            }
2214        }
2215    }
2216
2217    /// The request builder for [Deployments::list_deployments][crate::client::Deployments::list_deployments] calls.
2218    ///
2219    /// # Example
2220    /// ```
2221    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::ListDeployments;
2222    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2223    /// use google_cloud_gax::paginator::ItemPaginator;
2224    ///
2225    /// let builder = prepare_request_builder();
2226    /// let mut items = builder.by_item();
2227    /// while let Some(result) = items.next().await {
2228    ///   let item = result?;
2229    /// }
2230    /// # Ok(()) }
2231    ///
2232    /// fn prepare_request_builder() -> ListDeployments {
2233    ///   # panic!();
2234    ///   // ... details omitted ...
2235    /// }
2236    /// ```
2237    #[derive(Clone, Debug)]
2238    pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
2239
2240    impl ListDeployments {
2241        pub(crate) fn new(
2242            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2243        ) -> Self {
2244            Self(RequestBuilder::new(stub))
2245        }
2246
2247        /// Sets the full request, replacing any prior values.
2248        pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
2249            self.0.request = v.into();
2250            self
2251        }
2252
2253        /// Sets all the options, replacing any prior values.
2254        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2255            self.0.options = v.into();
2256            self
2257        }
2258
2259        /// Sends the request.
2260        pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
2261            (*self.0.stub)
2262                .list_deployments(self.0.request, self.0.options)
2263                .await
2264                .map(crate::Response::into_body)
2265        }
2266
2267        /// Streams each page in the collection.
2268        pub fn by_page(
2269            self,
2270        ) -> impl google_cloud_gax::paginator::Paginator<
2271            crate::model::ListDeploymentsResponse,
2272            crate::Error,
2273        > {
2274            use std::clone::Clone;
2275            let token = self.0.request.page_token.clone();
2276            let execute = move |token: String| {
2277                let mut builder = self.clone();
2278                builder.0.request = builder.0.request.set_page_token(token);
2279                builder.send()
2280            };
2281            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2282        }
2283
2284        /// Streams each item in the collection.
2285        pub fn by_item(
2286            self,
2287        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2288            crate::model::ListDeploymentsResponse,
2289            crate::Error,
2290        > {
2291            use google_cloud_gax::paginator::Paginator;
2292            self.by_page().items()
2293        }
2294
2295        /// Sets the value of [parent][crate::model::ListDeploymentsRequest::parent].
2296        ///
2297        /// This is a **required** field for requests.
2298        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2299            self.0.request.parent = v.into();
2300            self
2301        }
2302
2303        /// Sets the value of [page_size][crate::model::ListDeploymentsRequest::page_size].
2304        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2305            self.0.request.page_size = v.into();
2306            self
2307        }
2308
2309        /// Sets the value of [page_token][crate::model::ListDeploymentsRequest::page_token].
2310        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2311            self.0.request.page_token = v.into();
2312            self
2313        }
2314    }
2315
2316    #[doc(hidden)]
2317    impl crate::RequestBuilder for ListDeployments {
2318        fn request_options(&mut self) -> &mut crate::RequestOptions {
2319            &mut self.0.options
2320        }
2321    }
2322
2323    /// The request builder for [Deployments::get_deployment][crate::client::Deployments::get_deployment] calls.
2324    ///
2325    /// # Example
2326    /// ```
2327    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::GetDeployment;
2328    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2329    ///
2330    /// let builder = prepare_request_builder();
2331    /// let response = builder.send().await?;
2332    /// # Ok(()) }
2333    ///
2334    /// fn prepare_request_builder() -> GetDeployment {
2335    ///   # panic!();
2336    ///   // ... details omitted ...
2337    /// }
2338    /// ```
2339    #[derive(Clone, Debug)]
2340    pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
2341
2342    impl GetDeployment {
2343        pub(crate) fn new(
2344            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2345        ) -> Self {
2346            Self(RequestBuilder::new(stub))
2347        }
2348
2349        /// Sets the full request, replacing any prior values.
2350        pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
2351            self.0.request = v.into();
2352            self
2353        }
2354
2355        /// Sets all the options, replacing any prior values.
2356        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2357            self.0.options = v.into();
2358            self
2359        }
2360
2361        /// Sends the request.
2362        pub async fn send(self) -> Result<crate::model::Deployment> {
2363            (*self.0.stub)
2364                .get_deployment(self.0.request, self.0.options)
2365                .await
2366                .map(crate::Response::into_body)
2367        }
2368
2369        /// Sets the value of [name][crate::model::GetDeploymentRequest::name].
2370        ///
2371        /// This is a **required** field for requests.
2372        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373            self.0.request.name = v.into();
2374            self
2375        }
2376    }
2377
2378    #[doc(hidden)]
2379    impl crate::RequestBuilder for GetDeployment {
2380        fn request_options(&mut self) -> &mut crate::RequestOptions {
2381            &mut self.0.options
2382        }
2383    }
2384
2385    /// The request builder for [Deployments::list_locations][crate::client::Deployments::list_locations] calls.
2386    ///
2387    /// # Example
2388    /// ```
2389    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::ListLocations;
2390    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2391    /// use google_cloud_gax::paginator::ItemPaginator;
2392    ///
2393    /// let builder = prepare_request_builder();
2394    /// let mut items = builder.by_item();
2395    /// while let Some(result) = items.next().await {
2396    ///   let item = result?;
2397    /// }
2398    /// # Ok(()) }
2399    ///
2400    /// fn prepare_request_builder() -> ListLocations {
2401    ///   # panic!();
2402    ///   // ... details omitted ...
2403    /// }
2404    /// ```
2405    #[derive(Clone, Debug)]
2406    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2407
2408    impl ListLocations {
2409        pub(crate) fn new(
2410            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2411        ) -> Self {
2412            Self(RequestBuilder::new(stub))
2413        }
2414
2415        /// Sets the full request, replacing any prior values.
2416        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2417            mut self,
2418            v: V,
2419        ) -> Self {
2420            self.0.request = v.into();
2421            self
2422        }
2423
2424        /// Sets all the options, replacing any prior values.
2425        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426            self.0.options = v.into();
2427            self
2428        }
2429
2430        /// Sends the request.
2431        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2432            (*self.0.stub)
2433                .list_locations(self.0.request, self.0.options)
2434                .await
2435                .map(crate::Response::into_body)
2436        }
2437
2438        /// Streams each page in the collection.
2439        pub fn by_page(
2440            self,
2441        ) -> impl google_cloud_gax::paginator::Paginator<
2442            google_cloud_location::model::ListLocationsResponse,
2443            crate::Error,
2444        > {
2445            use std::clone::Clone;
2446            let token = self.0.request.page_token.clone();
2447            let execute = move |token: String| {
2448                let mut builder = self.clone();
2449                builder.0.request = builder.0.request.set_page_token(token);
2450                builder.send()
2451            };
2452            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2453        }
2454
2455        /// Streams each item in the collection.
2456        pub fn by_item(
2457            self,
2458        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2459            google_cloud_location::model::ListLocationsResponse,
2460            crate::Error,
2461        > {
2462            use google_cloud_gax::paginator::Paginator;
2463            self.by_page().items()
2464        }
2465
2466        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
2467        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2468            self.0.request.name = v.into();
2469            self
2470        }
2471
2472        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
2473        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2474            self.0.request.filter = v.into();
2475            self
2476        }
2477
2478        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
2479        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2480            self.0.request.page_size = v.into();
2481            self
2482        }
2483
2484        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
2485        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2486            self.0.request.page_token = v.into();
2487            self
2488        }
2489    }
2490
2491    #[doc(hidden)]
2492    impl crate::RequestBuilder for ListLocations {
2493        fn request_options(&mut self) -> &mut crate::RequestOptions {
2494            &mut self.0.options
2495        }
2496    }
2497
2498    /// The request builder for [Deployments::get_location][crate::client::Deployments::get_location] calls.
2499    ///
2500    /// # Example
2501    /// ```
2502    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::GetLocation;
2503    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2504    ///
2505    /// let builder = prepare_request_builder();
2506    /// let response = builder.send().await?;
2507    /// # Ok(()) }
2508    ///
2509    /// fn prepare_request_builder() -> GetLocation {
2510    ///   # panic!();
2511    ///   // ... details omitted ...
2512    /// }
2513    /// ```
2514    #[derive(Clone, Debug)]
2515    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2516
2517    impl GetLocation {
2518        pub(crate) fn new(
2519            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2520        ) -> Self {
2521            Self(RequestBuilder::new(stub))
2522        }
2523
2524        /// Sets the full request, replacing any prior values.
2525        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2526            mut self,
2527            v: V,
2528        ) -> Self {
2529            self.0.request = v.into();
2530            self
2531        }
2532
2533        /// Sets all the options, replacing any prior values.
2534        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2535            self.0.options = v.into();
2536            self
2537        }
2538
2539        /// Sends the request.
2540        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2541            (*self.0.stub)
2542                .get_location(self.0.request, self.0.options)
2543                .await
2544                .map(crate::Response::into_body)
2545        }
2546
2547        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
2548        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2549            self.0.request.name = v.into();
2550            self
2551        }
2552    }
2553
2554    #[doc(hidden)]
2555    impl crate::RequestBuilder for GetLocation {
2556        fn request_options(&mut self) -> &mut crate::RequestOptions {
2557            &mut self.0.options
2558        }
2559    }
2560
2561    /// The request builder for [Deployments::list_operations][crate::client::Deployments::list_operations] calls.
2562    ///
2563    /// # Example
2564    /// ```
2565    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::ListOperations;
2566    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2567    /// use google_cloud_gax::paginator::ItemPaginator;
2568    ///
2569    /// let builder = prepare_request_builder();
2570    /// let mut items = builder.by_item();
2571    /// while let Some(result) = items.next().await {
2572    ///   let item = result?;
2573    /// }
2574    /// # Ok(()) }
2575    ///
2576    /// fn prepare_request_builder() -> ListOperations {
2577    ///   # panic!();
2578    ///   // ... details omitted ...
2579    /// }
2580    /// ```
2581    #[derive(Clone, Debug)]
2582    pub struct ListOperations(
2583        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2584    );
2585
2586    impl ListOperations {
2587        pub(crate) fn new(
2588            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2589        ) -> Self {
2590            Self(RequestBuilder::new(stub))
2591        }
2592
2593        /// Sets the full request, replacing any prior values.
2594        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2595            mut self,
2596            v: V,
2597        ) -> Self {
2598            self.0.request = v.into();
2599            self
2600        }
2601
2602        /// Sets all the options, replacing any prior values.
2603        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2604            self.0.options = v.into();
2605            self
2606        }
2607
2608        /// Sends the request.
2609        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2610            (*self.0.stub)
2611                .list_operations(self.0.request, self.0.options)
2612                .await
2613                .map(crate::Response::into_body)
2614        }
2615
2616        /// Streams each page in the collection.
2617        pub fn by_page(
2618            self,
2619        ) -> impl google_cloud_gax::paginator::Paginator<
2620            google_cloud_longrunning::model::ListOperationsResponse,
2621            crate::Error,
2622        > {
2623            use std::clone::Clone;
2624            let token = self.0.request.page_token.clone();
2625            let execute = move |token: String| {
2626                let mut builder = self.clone();
2627                builder.0.request = builder.0.request.set_page_token(token);
2628                builder.send()
2629            };
2630            google_cloud_gax::paginator::internal::new_paginator(token, execute)
2631        }
2632
2633        /// Streams each item in the collection.
2634        pub fn by_item(
2635            self,
2636        ) -> impl google_cloud_gax::paginator::ItemPaginator<
2637            google_cloud_longrunning::model::ListOperationsResponse,
2638            crate::Error,
2639        > {
2640            use google_cloud_gax::paginator::Paginator;
2641            self.by_page().items()
2642        }
2643
2644        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
2645        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2646            self.0.request.name = v.into();
2647            self
2648        }
2649
2650        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
2651        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2652            self.0.request.filter = v.into();
2653            self
2654        }
2655
2656        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
2657        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2658            self.0.request.page_size = v.into();
2659            self
2660        }
2661
2662        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
2663        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2664            self.0.request.page_token = v.into();
2665            self
2666        }
2667
2668        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
2669        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2670            self.0.request.return_partial_success = v.into();
2671            self
2672        }
2673    }
2674
2675    #[doc(hidden)]
2676    impl crate::RequestBuilder for ListOperations {
2677        fn request_options(&mut self) -> &mut crate::RequestOptions {
2678            &mut self.0.options
2679        }
2680    }
2681
2682    /// The request builder for [Deployments::get_operation][crate::client::Deployments::get_operation] calls.
2683    ///
2684    /// # Example
2685    /// ```
2686    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::GetOperation;
2687    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2688    ///
2689    /// let builder = prepare_request_builder();
2690    /// let response = builder.send().await?;
2691    /// # Ok(()) }
2692    ///
2693    /// fn prepare_request_builder() -> GetOperation {
2694    ///   # panic!();
2695    ///   // ... details omitted ...
2696    /// }
2697    /// ```
2698    #[derive(Clone, Debug)]
2699    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2700
2701    impl GetOperation {
2702        pub(crate) fn new(
2703            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2704        ) -> Self {
2705            Self(RequestBuilder::new(stub))
2706        }
2707
2708        /// Sets the full request, replacing any prior values.
2709        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2710            mut self,
2711            v: V,
2712        ) -> Self {
2713            self.0.request = v.into();
2714            self
2715        }
2716
2717        /// Sets all the options, replacing any prior values.
2718        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2719            self.0.options = v.into();
2720            self
2721        }
2722
2723        /// Sends the request.
2724        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2725            (*self.0.stub)
2726                .get_operation(self.0.request, self.0.options)
2727                .await
2728                .map(crate::Response::into_body)
2729        }
2730
2731        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
2732        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2733            self.0.request.name = v.into();
2734            self
2735        }
2736    }
2737
2738    #[doc(hidden)]
2739    impl crate::RequestBuilder for GetOperation {
2740        fn request_options(&mut self) -> &mut crate::RequestOptions {
2741            &mut self.0.options
2742        }
2743    }
2744
2745    /// The request builder for [Deployments::cancel_operation][crate::client::Deployments::cancel_operation] calls.
2746    ///
2747    /// # Example
2748    /// ```
2749    /// # use google_cloud_dialogflow_cx_v3::builder::deployments::CancelOperation;
2750    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2751    ///
2752    /// let builder = prepare_request_builder();
2753    /// let response = builder.send().await?;
2754    /// # Ok(()) }
2755    ///
2756    /// fn prepare_request_builder() -> CancelOperation {
2757    ///   # panic!();
2758    ///   // ... details omitted ...
2759    /// }
2760    /// ```
2761    #[derive(Clone, Debug)]
2762    pub struct CancelOperation(
2763        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2764    );
2765
2766    impl CancelOperation {
2767        pub(crate) fn new(
2768            stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2769        ) -> Self {
2770            Self(RequestBuilder::new(stub))
2771        }
2772
2773        /// Sets the full request, replacing any prior values.
2774        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2775            mut self,
2776            v: V,
2777        ) -> Self {
2778            self.0.request = v.into();
2779            self
2780        }
2781
2782        /// Sets all the options, replacing any prior values.
2783        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2784            self.0.options = v.into();
2785            self
2786        }
2787
2788        /// Sends the request.
2789        pub async fn send(self) -> Result<()> {
2790            (*self.0.stub)
2791                .cancel_operation(self.0.request, self.0.options)
2792                .await
2793                .map(crate::Response::into_body)
2794        }
2795
2796        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
2797        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2798            self.0.request.name = v.into();
2799            self
2800        }
2801    }
2802
2803    #[doc(hidden)]
2804    impl crate::RequestBuilder for CancelOperation {
2805        fn request_options(&mut self) -> &mut crate::RequestOptions {
2806            &mut self.0.options
2807        }
2808    }
2809}
2810
2811/// Request and client builders for [EntityTypes][crate::client::EntityTypes].
2812#[cfg(feature = "entity-types")]
2813#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
2814pub mod entity_types {
2815    use crate::Result;
2816
2817    /// A builder for [EntityTypes][crate::client::EntityTypes].
2818    ///
2819    /// ```
2820    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
2821    /// # use google_cloud_dialogflow_cx_v3::*;
2822    /// # use builder::entity_types::ClientBuilder;
2823    /// # use client::EntityTypes;
2824    /// let builder : ClientBuilder = EntityTypes::builder();
2825    /// let client = builder
2826    ///     .with_endpoint("https://dialogflow.googleapis.com")
2827    ///     .build().await?;
2828    /// # Ok(()) }
2829    /// ```
2830    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2831
2832    pub(crate) mod client {
2833        use super::super::super::client::EntityTypes;
2834        pub struct Factory;
2835        impl crate::ClientFactory for Factory {
2836            type Client = EntityTypes;
2837            type Credentials = gaxi::options::Credentials;
2838            async fn build(
2839                self,
2840                config: gaxi::options::ClientConfig,
2841            ) -> crate::ClientBuilderResult<Self::Client> {
2842                Self::Client::new(config).await
2843            }
2844        }
2845    }
2846
2847    /// Common implementation for [crate::client::EntityTypes] request builders.
2848    #[derive(Clone, Debug)]
2849    pub(crate) struct RequestBuilder<R: std::default::Default> {
2850        stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2851        request: R,
2852        options: crate::RequestOptions,
2853    }
2854
2855    impl<R> RequestBuilder<R>
2856    where
2857        R: std::default::Default,
2858    {
2859        pub(crate) fn new(
2860            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2861        ) -> Self {
2862            Self {
2863                stub,
2864                request: R::default(),
2865                options: crate::RequestOptions::default(),
2866            }
2867        }
2868    }
2869
2870    /// The request builder for [EntityTypes::get_entity_type][crate::client::EntityTypes::get_entity_type] calls.
2871    ///
2872    /// # Example
2873    /// ```
2874    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::GetEntityType;
2875    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2876    ///
2877    /// let builder = prepare_request_builder();
2878    /// let response = builder.send().await?;
2879    /// # Ok(()) }
2880    ///
2881    /// fn prepare_request_builder() -> GetEntityType {
2882    ///   # panic!();
2883    ///   // ... details omitted ...
2884    /// }
2885    /// ```
2886    #[derive(Clone, Debug)]
2887    pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
2888
2889    impl GetEntityType {
2890        pub(crate) fn new(
2891            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2892        ) -> Self {
2893            Self(RequestBuilder::new(stub))
2894        }
2895
2896        /// Sets the full request, replacing any prior values.
2897        pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
2898            self.0.request = v.into();
2899            self
2900        }
2901
2902        /// Sets all the options, replacing any prior values.
2903        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2904            self.0.options = v.into();
2905            self
2906        }
2907
2908        /// Sends the request.
2909        pub async fn send(self) -> Result<crate::model::EntityType> {
2910            (*self.0.stub)
2911                .get_entity_type(self.0.request, self.0.options)
2912                .await
2913                .map(crate::Response::into_body)
2914        }
2915
2916        /// Sets the value of [name][crate::model::GetEntityTypeRequest::name].
2917        ///
2918        /// This is a **required** field for requests.
2919        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920            self.0.request.name = v.into();
2921            self
2922        }
2923
2924        /// Sets the value of [language_code][crate::model::GetEntityTypeRequest::language_code].
2925        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
2926            self.0.request.language_code = v.into();
2927            self
2928        }
2929    }
2930
2931    #[doc(hidden)]
2932    impl crate::RequestBuilder for GetEntityType {
2933        fn request_options(&mut self) -> &mut crate::RequestOptions {
2934            &mut self.0.options
2935        }
2936    }
2937
2938    /// The request builder for [EntityTypes::create_entity_type][crate::client::EntityTypes::create_entity_type] calls.
2939    ///
2940    /// # Example
2941    /// ```
2942    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::CreateEntityType;
2943    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
2944    ///
2945    /// let builder = prepare_request_builder();
2946    /// let response = builder.send().await?;
2947    /// # Ok(()) }
2948    ///
2949    /// fn prepare_request_builder() -> CreateEntityType {
2950    ///   # panic!();
2951    ///   // ... details omitted ...
2952    /// }
2953    /// ```
2954    #[derive(Clone, Debug)]
2955    pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
2956
2957    impl CreateEntityType {
2958        pub(crate) fn new(
2959            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2960        ) -> Self {
2961            Self(RequestBuilder::new(stub))
2962        }
2963
2964        /// Sets the full request, replacing any prior values.
2965        pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
2966            mut self,
2967            v: V,
2968        ) -> Self {
2969            self.0.request = v.into();
2970            self
2971        }
2972
2973        /// Sets all the options, replacing any prior values.
2974        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2975            self.0.options = v.into();
2976            self
2977        }
2978
2979        /// Sends the request.
2980        pub async fn send(self) -> Result<crate::model::EntityType> {
2981            (*self.0.stub)
2982                .create_entity_type(self.0.request, self.0.options)
2983                .await
2984                .map(crate::Response::into_body)
2985        }
2986
2987        /// Sets the value of [parent][crate::model::CreateEntityTypeRequest::parent].
2988        ///
2989        /// This is a **required** field for requests.
2990        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991            self.0.request.parent = v.into();
2992            self
2993        }
2994
2995        /// Sets the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
2996        ///
2997        /// This is a **required** field for requests.
2998        pub fn set_entity_type<T>(mut self, v: T) -> Self
2999        where
3000            T: std::convert::Into<crate::model::EntityType>,
3001        {
3002            self.0.request.entity_type = std::option::Option::Some(v.into());
3003            self
3004        }
3005
3006        /// Sets or clears the value of [entity_type][crate::model::CreateEntityTypeRequest::entity_type].
3007        ///
3008        /// This is a **required** field for requests.
3009        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
3010        where
3011            T: std::convert::Into<crate::model::EntityType>,
3012        {
3013            self.0.request.entity_type = v.map(|x| x.into());
3014            self
3015        }
3016
3017        /// Sets the value of [language_code][crate::model::CreateEntityTypeRequest::language_code].
3018        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3019            self.0.request.language_code = v.into();
3020            self
3021        }
3022    }
3023
3024    #[doc(hidden)]
3025    impl crate::RequestBuilder for CreateEntityType {
3026        fn request_options(&mut self) -> &mut crate::RequestOptions {
3027            &mut self.0.options
3028        }
3029    }
3030
3031    /// The request builder for [EntityTypes::update_entity_type][crate::client::EntityTypes::update_entity_type] calls.
3032    ///
3033    /// # Example
3034    /// ```
3035    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::UpdateEntityType;
3036    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3037    ///
3038    /// let builder = prepare_request_builder();
3039    /// let response = builder.send().await?;
3040    /// # Ok(()) }
3041    ///
3042    /// fn prepare_request_builder() -> UpdateEntityType {
3043    ///   # panic!();
3044    ///   // ... details omitted ...
3045    /// }
3046    /// ```
3047    #[derive(Clone, Debug)]
3048    pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
3049
3050    impl UpdateEntityType {
3051        pub(crate) fn new(
3052            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3053        ) -> Self {
3054            Self(RequestBuilder::new(stub))
3055        }
3056
3057        /// Sets the full request, replacing any prior values.
3058        pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
3059            mut self,
3060            v: V,
3061        ) -> Self {
3062            self.0.request = v.into();
3063            self
3064        }
3065
3066        /// Sets all the options, replacing any prior values.
3067        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3068            self.0.options = v.into();
3069            self
3070        }
3071
3072        /// Sends the request.
3073        pub async fn send(self) -> Result<crate::model::EntityType> {
3074            (*self.0.stub)
3075                .update_entity_type(self.0.request, self.0.options)
3076                .await
3077                .map(crate::Response::into_body)
3078        }
3079
3080        /// Sets the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
3081        ///
3082        /// This is a **required** field for requests.
3083        pub fn set_entity_type<T>(mut self, v: T) -> Self
3084        where
3085            T: std::convert::Into<crate::model::EntityType>,
3086        {
3087            self.0.request.entity_type = std::option::Option::Some(v.into());
3088            self
3089        }
3090
3091        /// Sets or clears the value of [entity_type][crate::model::UpdateEntityTypeRequest::entity_type].
3092        ///
3093        /// This is a **required** field for requests.
3094        pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
3095        where
3096            T: std::convert::Into<crate::model::EntityType>,
3097        {
3098            self.0.request.entity_type = v.map(|x| x.into());
3099            self
3100        }
3101
3102        /// Sets the value of [language_code][crate::model::UpdateEntityTypeRequest::language_code].
3103        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3104            self.0.request.language_code = v.into();
3105            self
3106        }
3107
3108        /// Sets the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
3109        pub fn set_update_mask<T>(mut self, v: T) -> Self
3110        where
3111            T: std::convert::Into<wkt::FieldMask>,
3112        {
3113            self.0.request.update_mask = std::option::Option::Some(v.into());
3114            self
3115        }
3116
3117        /// Sets or clears the value of [update_mask][crate::model::UpdateEntityTypeRequest::update_mask].
3118        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3119        where
3120            T: std::convert::Into<wkt::FieldMask>,
3121        {
3122            self.0.request.update_mask = v.map(|x| x.into());
3123            self
3124        }
3125    }
3126
3127    #[doc(hidden)]
3128    impl crate::RequestBuilder for UpdateEntityType {
3129        fn request_options(&mut self) -> &mut crate::RequestOptions {
3130            &mut self.0.options
3131        }
3132    }
3133
3134    /// The request builder for [EntityTypes::delete_entity_type][crate::client::EntityTypes::delete_entity_type] calls.
3135    ///
3136    /// # Example
3137    /// ```
3138    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::DeleteEntityType;
3139    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3140    ///
3141    /// let builder = prepare_request_builder();
3142    /// let response = builder.send().await?;
3143    /// # Ok(()) }
3144    ///
3145    /// fn prepare_request_builder() -> DeleteEntityType {
3146    ///   # panic!();
3147    ///   // ... details omitted ...
3148    /// }
3149    /// ```
3150    #[derive(Clone, Debug)]
3151    pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
3152
3153    impl DeleteEntityType {
3154        pub(crate) fn new(
3155            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3156        ) -> Self {
3157            Self(RequestBuilder::new(stub))
3158        }
3159
3160        /// Sets the full request, replacing any prior values.
3161        pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
3162            mut self,
3163            v: V,
3164        ) -> Self {
3165            self.0.request = v.into();
3166            self
3167        }
3168
3169        /// Sets all the options, replacing any prior values.
3170        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3171            self.0.options = v.into();
3172            self
3173        }
3174
3175        /// Sends the request.
3176        pub async fn send(self) -> Result<()> {
3177            (*self.0.stub)
3178                .delete_entity_type(self.0.request, self.0.options)
3179                .await
3180                .map(crate::Response::into_body)
3181        }
3182
3183        /// Sets the value of [name][crate::model::DeleteEntityTypeRequest::name].
3184        ///
3185        /// This is a **required** field for requests.
3186        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187            self.0.request.name = v.into();
3188            self
3189        }
3190
3191        /// Sets the value of [force][crate::model::DeleteEntityTypeRequest::force].
3192        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3193            self.0.request.force = v.into();
3194            self
3195        }
3196    }
3197
3198    #[doc(hidden)]
3199    impl crate::RequestBuilder for DeleteEntityType {
3200        fn request_options(&mut self) -> &mut crate::RequestOptions {
3201            &mut self.0.options
3202        }
3203    }
3204
3205    /// The request builder for [EntityTypes::list_entity_types][crate::client::EntityTypes::list_entity_types] calls.
3206    ///
3207    /// # Example
3208    /// ```
3209    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::ListEntityTypes;
3210    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3211    /// use google_cloud_gax::paginator::ItemPaginator;
3212    ///
3213    /// let builder = prepare_request_builder();
3214    /// let mut items = builder.by_item();
3215    /// while let Some(result) = items.next().await {
3216    ///   let item = result?;
3217    /// }
3218    /// # Ok(()) }
3219    ///
3220    /// fn prepare_request_builder() -> ListEntityTypes {
3221    ///   # panic!();
3222    ///   // ... details omitted ...
3223    /// }
3224    /// ```
3225    #[derive(Clone, Debug)]
3226    pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
3227
3228    impl ListEntityTypes {
3229        pub(crate) fn new(
3230            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3231        ) -> Self {
3232            Self(RequestBuilder::new(stub))
3233        }
3234
3235        /// Sets the full request, replacing any prior values.
3236        pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
3237            self.0.request = v.into();
3238            self
3239        }
3240
3241        /// Sets all the options, replacing any prior values.
3242        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3243            self.0.options = v.into();
3244            self
3245        }
3246
3247        /// Sends the request.
3248        pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
3249            (*self.0.stub)
3250                .list_entity_types(self.0.request, self.0.options)
3251                .await
3252                .map(crate::Response::into_body)
3253        }
3254
3255        /// Streams each page in the collection.
3256        pub fn by_page(
3257            self,
3258        ) -> impl google_cloud_gax::paginator::Paginator<
3259            crate::model::ListEntityTypesResponse,
3260            crate::Error,
3261        > {
3262            use std::clone::Clone;
3263            let token = self.0.request.page_token.clone();
3264            let execute = move |token: String| {
3265                let mut builder = self.clone();
3266                builder.0.request = builder.0.request.set_page_token(token);
3267                builder.send()
3268            };
3269            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3270        }
3271
3272        /// Streams each item in the collection.
3273        pub fn by_item(
3274            self,
3275        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3276            crate::model::ListEntityTypesResponse,
3277            crate::Error,
3278        > {
3279            use google_cloud_gax::paginator::Paginator;
3280            self.by_page().items()
3281        }
3282
3283        /// Sets the value of [parent][crate::model::ListEntityTypesRequest::parent].
3284        ///
3285        /// This is a **required** field for requests.
3286        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3287            self.0.request.parent = v.into();
3288            self
3289        }
3290
3291        /// Sets the value of [language_code][crate::model::ListEntityTypesRequest::language_code].
3292        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3293            self.0.request.language_code = v.into();
3294            self
3295        }
3296
3297        /// Sets the value of [page_size][crate::model::ListEntityTypesRequest::page_size].
3298        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3299            self.0.request.page_size = v.into();
3300            self
3301        }
3302
3303        /// Sets the value of [page_token][crate::model::ListEntityTypesRequest::page_token].
3304        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3305            self.0.request.page_token = v.into();
3306            self
3307        }
3308    }
3309
3310    #[doc(hidden)]
3311    impl crate::RequestBuilder for ListEntityTypes {
3312        fn request_options(&mut self) -> &mut crate::RequestOptions {
3313            &mut self.0.options
3314        }
3315    }
3316
3317    /// The request builder for [EntityTypes::export_entity_types][crate::client::EntityTypes::export_entity_types] calls.
3318    ///
3319    /// # Example
3320    /// ```
3321    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::ExportEntityTypes;
3322    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3323    /// use google_cloud_lro::Poller;
3324    ///
3325    /// let builder = prepare_request_builder();
3326    /// let response = builder.poller().until_done().await?;
3327    /// # Ok(()) }
3328    ///
3329    /// fn prepare_request_builder() -> ExportEntityTypes {
3330    ///   # panic!();
3331    ///   // ... details omitted ...
3332    /// }
3333    /// ```
3334    #[derive(Clone, Debug)]
3335    pub struct ExportEntityTypes(RequestBuilder<crate::model::ExportEntityTypesRequest>);
3336
3337    impl ExportEntityTypes {
3338        pub(crate) fn new(
3339            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3340        ) -> Self {
3341            Self(RequestBuilder::new(stub))
3342        }
3343
3344        /// Sets the full request, replacing any prior values.
3345        pub fn with_request<V: Into<crate::model::ExportEntityTypesRequest>>(
3346            mut self,
3347            v: V,
3348        ) -> Self {
3349            self.0.request = v.into();
3350            self
3351        }
3352
3353        /// Sets all the options, replacing any prior values.
3354        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3355            self.0.options = v.into();
3356            self
3357        }
3358
3359        /// Sends the request.
3360        ///
3361        /// # Long running operations
3362        ///
3363        /// This starts, but does not poll, a longrunning operation. More information
3364        /// on [export_entity_types][crate::client::EntityTypes::export_entity_types].
3365        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3366            (*self.0.stub)
3367                .export_entity_types(self.0.request, self.0.options)
3368                .await
3369                .map(crate::Response::into_body)
3370        }
3371
3372        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_entity_types`.
3373        pub fn poller(
3374            self,
3375        ) -> impl google_cloud_lro::Poller<
3376            crate::model::ExportEntityTypesResponse,
3377            crate::model::ExportEntityTypesMetadata,
3378        > {
3379            type Operation = google_cloud_lro::internal::Operation<
3380                crate::model::ExportEntityTypesResponse,
3381                crate::model::ExportEntityTypesMetadata,
3382            >;
3383            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3384            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3385
3386            let stub = self.0.stub.clone();
3387            let mut options = self.0.options.clone();
3388            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3389            let query = move |name| {
3390                let stub = stub.clone();
3391                let options = options.clone();
3392                async {
3393                    let op = GetOperation::new(stub)
3394                        .set_name(name)
3395                        .with_options(options)
3396                        .send()
3397                        .await?;
3398                    Ok(Operation::new(op))
3399                }
3400            };
3401
3402            let start = move || async {
3403                let op = self.send().await?;
3404                Ok(Operation::new(op))
3405            };
3406
3407            google_cloud_lro::internal::new_poller(
3408                polling_error_policy,
3409                polling_backoff_policy,
3410                start,
3411                query,
3412            )
3413        }
3414
3415        /// Sets the value of [parent][crate::model::ExportEntityTypesRequest::parent].
3416        ///
3417        /// This is a **required** field for requests.
3418        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3419            self.0.request.parent = v.into();
3420            self
3421        }
3422
3423        /// Sets the value of [entity_types][crate::model::ExportEntityTypesRequest::entity_types].
3424        ///
3425        /// This is a **required** field for requests.
3426        pub fn set_entity_types<T, V>(mut self, v: T) -> Self
3427        where
3428            T: std::iter::IntoIterator<Item = V>,
3429            V: std::convert::Into<std::string::String>,
3430        {
3431            use std::iter::Iterator;
3432            self.0.request.entity_types = v.into_iter().map(|i| i.into()).collect();
3433            self
3434        }
3435
3436        /// Sets the value of [data_format][crate::model::ExportEntityTypesRequest::data_format].
3437        pub fn set_data_format<T: Into<crate::model::export_entity_types_request::DataFormat>>(
3438            mut self,
3439            v: T,
3440        ) -> Self {
3441            self.0.request.data_format = v.into();
3442            self
3443        }
3444
3445        /// Sets the value of [language_code][crate::model::ExportEntityTypesRequest::language_code].
3446        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3447            self.0.request.language_code = v.into();
3448            self
3449        }
3450
3451        /// Sets the value of [destination][crate::model::ExportEntityTypesRequest::destination].
3452        ///
3453        /// Note that all the setters affecting `destination` are
3454        /// mutually exclusive.
3455        pub fn set_destination<
3456            T: Into<Option<crate::model::export_entity_types_request::Destination>>,
3457        >(
3458            mut self,
3459            v: T,
3460        ) -> Self {
3461            self.0.request.destination = v.into();
3462            self
3463        }
3464
3465        /// Sets the value of [destination][crate::model::ExportEntityTypesRequest::destination]
3466        /// to hold a `EntityTypesUri`.
3467        ///
3468        /// Note that all the setters affecting `destination` are
3469        /// mutually exclusive.
3470        pub fn set_entity_types_uri<T: std::convert::Into<std::string::String>>(
3471            mut self,
3472            v: T,
3473        ) -> Self {
3474            self.0.request = self.0.request.set_entity_types_uri(v);
3475            self
3476        }
3477
3478        /// Sets the value of [destination][crate::model::ExportEntityTypesRequest::destination]
3479        /// to hold a `EntityTypesContentInline`.
3480        ///
3481        /// Note that all the setters affecting `destination` are
3482        /// mutually exclusive.
3483        pub fn set_entity_types_content_inline<T: std::convert::Into<bool>>(
3484            mut self,
3485            v: T,
3486        ) -> Self {
3487            self.0.request = self.0.request.set_entity_types_content_inline(v);
3488            self
3489        }
3490    }
3491
3492    #[doc(hidden)]
3493    impl crate::RequestBuilder for ExportEntityTypes {
3494        fn request_options(&mut self) -> &mut crate::RequestOptions {
3495            &mut self.0.options
3496        }
3497    }
3498
3499    /// The request builder for [EntityTypes::import_entity_types][crate::client::EntityTypes::import_entity_types] calls.
3500    ///
3501    /// # Example
3502    /// ```
3503    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::ImportEntityTypes;
3504    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3505    /// use google_cloud_lro::Poller;
3506    ///
3507    /// let builder = prepare_request_builder();
3508    /// let response = builder.poller().until_done().await?;
3509    /// # Ok(()) }
3510    ///
3511    /// fn prepare_request_builder() -> ImportEntityTypes {
3512    ///   # panic!();
3513    ///   // ... details omitted ...
3514    /// }
3515    /// ```
3516    #[derive(Clone, Debug)]
3517    pub struct ImportEntityTypes(RequestBuilder<crate::model::ImportEntityTypesRequest>);
3518
3519    impl ImportEntityTypes {
3520        pub(crate) fn new(
3521            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3522        ) -> Self {
3523            Self(RequestBuilder::new(stub))
3524        }
3525
3526        /// Sets the full request, replacing any prior values.
3527        pub fn with_request<V: Into<crate::model::ImportEntityTypesRequest>>(
3528            mut self,
3529            v: V,
3530        ) -> Self {
3531            self.0.request = v.into();
3532            self
3533        }
3534
3535        /// Sets all the options, replacing any prior values.
3536        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3537            self.0.options = v.into();
3538            self
3539        }
3540
3541        /// Sends the request.
3542        ///
3543        /// # Long running operations
3544        ///
3545        /// This starts, but does not poll, a longrunning operation. More information
3546        /// on [import_entity_types][crate::client::EntityTypes::import_entity_types].
3547        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3548            (*self.0.stub)
3549                .import_entity_types(self.0.request, self.0.options)
3550                .await
3551                .map(crate::Response::into_body)
3552        }
3553
3554        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_entity_types`.
3555        pub fn poller(
3556            self,
3557        ) -> impl google_cloud_lro::Poller<
3558            crate::model::ImportEntityTypesResponse,
3559            crate::model::ImportEntityTypesMetadata,
3560        > {
3561            type Operation = google_cloud_lro::internal::Operation<
3562                crate::model::ImportEntityTypesResponse,
3563                crate::model::ImportEntityTypesMetadata,
3564            >;
3565            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3566            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3567
3568            let stub = self.0.stub.clone();
3569            let mut options = self.0.options.clone();
3570            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3571            let query = move |name| {
3572                let stub = stub.clone();
3573                let options = options.clone();
3574                async {
3575                    let op = GetOperation::new(stub)
3576                        .set_name(name)
3577                        .with_options(options)
3578                        .send()
3579                        .await?;
3580                    Ok(Operation::new(op))
3581                }
3582            };
3583
3584            let start = move || async {
3585                let op = self.send().await?;
3586                Ok(Operation::new(op))
3587            };
3588
3589            google_cloud_lro::internal::new_poller(
3590                polling_error_policy,
3591                polling_backoff_policy,
3592                start,
3593                query,
3594            )
3595        }
3596
3597        /// Sets the value of [parent][crate::model::ImportEntityTypesRequest::parent].
3598        ///
3599        /// This is a **required** field for requests.
3600        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3601            self.0.request.parent = v.into();
3602            self
3603        }
3604
3605        /// Sets the value of [merge_option][crate::model::ImportEntityTypesRequest::merge_option].
3606        ///
3607        /// This is a **required** field for requests.
3608        pub fn set_merge_option<T: Into<crate::model::import_entity_types_request::MergeOption>>(
3609            mut self,
3610            v: T,
3611        ) -> Self {
3612            self.0.request.merge_option = v.into();
3613            self
3614        }
3615
3616        /// Sets the value of [target_entity_type][crate::model::ImportEntityTypesRequest::target_entity_type].
3617        pub fn set_target_entity_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
3618            self.0.request.target_entity_type = v.into();
3619            self
3620        }
3621
3622        /// Sets the value of [entity_types][crate::model::ImportEntityTypesRequest::entity_types].
3623        ///
3624        /// Note that all the setters affecting `entity_types` are
3625        /// mutually exclusive.
3626        pub fn set_entity_types<
3627            T: Into<Option<crate::model::import_entity_types_request::EntityTypes>>,
3628        >(
3629            mut self,
3630            v: T,
3631        ) -> Self {
3632            self.0.request.entity_types = v.into();
3633            self
3634        }
3635
3636        /// Sets the value of [entity_types][crate::model::ImportEntityTypesRequest::entity_types]
3637        /// to hold a `EntityTypesUri`.
3638        ///
3639        /// Note that all the setters affecting `entity_types` are
3640        /// mutually exclusive.
3641        pub fn set_entity_types_uri<T: std::convert::Into<std::string::String>>(
3642            mut self,
3643            v: T,
3644        ) -> Self {
3645            self.0.request = self.0.request.set_entity_types_uri(v);
3646            self
3647        }
3648
3649        /// Sets the value of [entity_types][crate::model::ImportEntityTypesRequest::entity_types]
3650        /// to hold a `EntityTypesContent`.
3651        ///
3652        /// Note that all the setters affecting `entity_types` are
3653        /// mutually exclusive.
3654        pub fn set_entity_types_content<
3655            T: std::convert::Into<std::boxed::Box<crate::model::InlineSource>>,
3656        >(
3657            mut self,
3658            v: T,
3659        ) -> Self {
3660            self.0.request = self.0.request.set_entity_types_content(v);
3661            self
3662        }
3663    }
3664
3665    #[doc(hidden)]
3666    impl crate::RequestBuilder for ImportEntityTypes {
3667        fn request_options(&mut self) -> &mut crate::RequestOptions {
3668            &mut self.0.options
3669        }
3670    }
3671
3672    /// The request builder for [EntityTypes::list_locations][crate::client::EntityTypes::list_locations] calls.
3673    ///
3674    /// # Example
3675    /// ```
3676    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::ListLocations;
3677    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3678    /// use google_cloud_gax::paginator::ItemPaginator;
3679    ///
3680    /// let builder = prepare_request_builder();
3681    /// let mut items = builder.by_item();
3682    /// while let Some(result) = items.next().await {
3683    ///   let item = result?;
3684    /// }
3685    /// # Ok(()) }
3686    ///
3687    /// fn prepare_request_builder() -> ListLocations {
3688    ///   # panic!();
3689    ///   // ... details omitted ...
3690    /// }
3691    /// ```
3692    #[derive(Clone, Debug)]
3693    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3694
3695    impl ListLocations {
3696        pub(crate) fn new(
3697            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3698        ) -> Self {
3699            Self(RequestBuilder::new(stub))
3700        }
3701
3702        /// Sets the full request, replacing any prior values.
3703        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3704            mut self,
3705            v: V,
3706        ) -> Self {
3707            self.0.request = v.into();
3708            self
3709        }
3710
3711        /// Sets all the options, replacing any prior values.
3712        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3713            self.0.options = v.into();
3714            self
3715        }
3716
3717        /// Sends the request.
3718        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3719            (*self.0.stub)
3720                .list_locations(self.0.request, self.0.options)
3721                .await
3722                .map(crate::Response::into_body)
3723        }
3724
3725        /// Streams each page in the collection.
3726        pub fn by_page(
3727            self,
3728        ) -> impl google_cloud_gax::paginator::Paginator<
3729            google_cloud_location::model::ListLocationsResponse,
3730            crate::Error,
3731        > {
3732            use std::clone::Clone;
3733            let token = self.0.request.page_token.clone();
3734            let execute = move |token: String| {
3735                let mut builder = self.clone();
3736                builder.0.request = builder.0.request.set_page_token(token);
3737                builder.send()
3738            };
3739            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3740        }
3741
3742        /// Streams each item in the collection.
3743        pub fn by_item(
3744            self,
3745        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3746            google_cloud_location::model::ListLocationsResponse,
3747            crate::Error,
3748        > {
3749            use google_cloud_gax::paginator::Paginator;
3750            self.by_page().items()
3751        }
3752
3753        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
3754        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3755            self.0.request.name = v.into();
3756            self
3757        }
3758
3759        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
3760        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3761            self.0.request.filter = v.into();
3762            self
3763        }
3764
3765        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
3766        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3767            self.0.request.page_size = v.into();
3768            self
3769        }
3770
3771        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
3772        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3773            self.0.request.page_token = v.into();
3774            self
3775        }
3776    }
3777
3778    #[doc(hidden)]
3779    impl crate::RequestBuilder for ListLocations {
3780        fn request_options(&mut self) -> &mut crate::RequestOptions {
3781            &mut self.0.options
3782        }
3783    }
3784
3785    /// The request builder for [EntityTypes::get_location][crate::client::EntityTypes::get_location] calls.
3786    ///
3787    /// # Example
3788    /// ```
3789    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::GetLocation;
3790    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3791    ///
3792    /// let builder = prepare_request_builder();
3793    /// let response = builder.send().await?;
3794    /// # Ok(()) }
3795    ///
3796    /// fn prepare_request_builder() -> GetLocation {
3797    ///   # panic!();
3798    ///   // ... details omitted ...
3799    /// }
3800    /// ```
3801    #[derive(Clone, Debug)]
3802    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3803
3804    impl GetLocation {
3805        pub(crate) fn new(
3806            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3807        ) -> Self {
3808            Self(RequestBuilder::new(stub))
3809        }
3810
3811        /// Sets the full request, replacing any prior values.
3812        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3813            mut self,
3814            v: V,
3815        ) -> Self {
3816            self.0.request = v.into();
3817            self
3818        }
3819
3820        /// Sets all the options, replacing any prior values.
3821        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3822            self.0.options = v.into();
3823            self
3824        }
3825
3826        /// Sends the request.
3827        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3828            (*self.0.stub)
3829                .get_location(self.0.request, self.0.options)
3830                .await
3831                .map(crate::Response::into_body)
3832        }
3833
3834        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
3835        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3836            self.0.request.name = v.into();
3837            self
3838        }
3839    }
3840
3841    #[doc(hidden)]
3842    impl crate::RequestBuilder for GetLocation {
3843        fn request_options(&mut self) -> &mut crate::RequestOptions {
3844            &mut self.0.options
3845        }
3846    }
3847
3848    /// The request builder for [EntityTypes::list_operations][crate::client::EntityTypes::list_operations] calls.
3849    ///
3850    /// # Example
3851    /// ```
3852    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::ListOperations;
3853    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3854    /// use google_cloud_gax::paginator::ItemPaginator;
3855    ///
3856    /// let builder = prepare_request_builder();
3857    /// let mut items = builder.by_item();
3858    /// while let Some(result) = items.next().await {
3859    ///   let item = result?;
3860    /// }
3861    /// # Ok(()) }
3862    ///
3863    /// fn prepare_request_builder() -> ListOperations {
3864    ///   # panic!();
3865    ///   // ... details omitted ...
3866    /// }
3867    /// ```
3868    #[derive(Clone, Debug)]
3869    pub struct ListOperations(
3870        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3871    );
3872
3873    impl ListOperations {
3874        pub(crate) fn new(
3875            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3876        ) -> Self {
3877            Self(RequestBuilder::new(stub))
3878        }
3879
3880        /// Sets the full request, replacing any prior values.
3881        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3882            mut self,
3883            v: V,
3884        ) -> Self {
3885            self.0.request = v.into();
3886            self
3887        }
3888
3889        /// Sets all the options, replacing any prior values.
3890        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3891            self.0.options = v.into();
3892            self
3893        }
3894
3895        /// Sends the request.
3896        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3897            (*self.0.stub)
3898                .list_operations(self.0.request, self.0.options)
3899                .await
3900                .map(crate::Response::into_body)
3901        }
3902
3903        /// Streams each page in the collection.
3904        pub fn by_page(
3905            self,
3906        ) -> impl google_cloud_gax::paginator::Paginator<
3907            google_cloud_longrunning::model::ListOperationsResponse,
3908            crate::Error,
3909        > {
3910            use std::clone::Clone;
3911            let token = self.0.request.page_token.clone();
3912            let execute = move |token: String| {
3913                let mut builder = self.clone();
3914                builder.0.request = builder.0.request.set_page_token(token);
3915                builder.send()
3916            };
3917            google_cloud_gax::paginator::internal::new_paginator(token, execute)
3918        }
3919
3920        /// Streams each item in the collection.
3921        pub fn by_item(
3922            self,
3923        ) -> impl google_cloud_gax::paginator::ItemPaginator<
3924            google_cloud_longrunning::model::ListOperationsResponse,
3925            crate::Error,
3926        > {
3927            use google_cloud_gax::paginator::Paginator;
3928            self.by_page().items()
3929        }
3930
3931        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3932        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3933            self.0.request.name = v.into();
3934            self
3935        }
3936
3937        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3938        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3939            self.0.request.filter = v.into();
3940            self
3941        }
3942
3943        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3944        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3945            self.0.request.page_size = v.into();
3946            self
3947        }
3948
3949        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3950        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3951            self.0.request.page_token = v.into();
3952            self
3953        }
3954
3955        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3956        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3957            self.0.request.return_partial_success = v.into();
3958            self
3959        }
3960    }
3961
3962    #[doc(hidden)]
3963    impl crate::RequestBuilder for ListOperations {
3964        fn request_options(&mut self) -> &mut crate::RequestOptions {
3965            &mut self.0.options
3966        }
3967    }
3968
3969    /// The request builder for [EntityTypes::get_operation][crate::client::EntityTypes::get_operation] calls.
3970    ///
3971    /// # Example
3972    /// ```
3973    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::GetOperation;
3974    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
3975    ///
3976    /// let builder = prepare_request_builder();
3977    /// let response = builder.send().await?;
3978    /// # Ok(()) }
3979    ///
3980    /// fn prepare_request_builder() -> GetOperation {
3981    ///   # panic!();
3982    ///   // ... details omitted ...
3983    /// }
3984    /// ```
3985    #[derive(Clone, Debug)]
3986    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3987
3988    impl GetOperation {
3989        pub(crate) fn new(
3990            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3991        ) -> Self {
3992            Self(RequestBuilder::new(stub))
3993        }
3994
3995        /// Sets the full request, replacing any prior values.
3996        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3997            mut self,
3998            v: V,
3999        ) -> Self {
4000            self.0.request = v.into();
4001            self
4002        }
4003
4004        /// Sets all the options, replacing any prior values.
4005        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4006            self.0.options = v.into();
4007            self
4008        }
4009
4010        /// Sends the request.
4011        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4012            (*self.0.stub)
4013                .get_operation(self.0.request, self.0.options)
4014                .await
4015                .map(crate::Response::into_body)
4016        }
4017
4018        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4019        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4020            self.0.request.name = v.into();
4021            self
4022        }
4023    }
4024
4025    #[doc(hidden)]
4026    impl crate::RequestBuilder for GetOperation {
4027        fn request_options(&mut self) -> &mut crate::RequestOptions {
4028            &mut self.0.options
4029        }
4030    }
4031
4032    /// The request builder for [EntityTypes::cancel_operation][crate::client::EntityTypes::cancel_operation] calls.
4033    ///
4034    /// # Example
4035    /// ```
4036    /// # use google_cloud_dialogflow_cx_v3::builder::entity_types::CancelOperation;
4037    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4038    ///
4039    /// let builder = prepare_request_builder();
4040    /// let response = builder.send().await?;
4041    /// # Ok(()) }
4042    ///
4043    /// fn prepare_request_builder() -> CancelOperation {
4044    ///   # panic!();
4045    ///   // ... details omitted ...
4046    /// }
4047    /// ```
4048    #[derive(Clone, Debug)]
4049    pub struct CancelOperation(
4050        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4051    );
4052
4053    impl CancelOperation {
4054        pub(crate) fn new(
4055            stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
4056        ) -> Self {
4057            Self(RequestBuilder::new(stub))
4058        }
4059
4060        /// Sets the full request, replacing any prior values.
4061        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4062            mut self,
4063            v: V,
4064        ) -> Self {
4065            self.0.request = v.into();
4066            self
4067        }
4068
4069        /// Sets all the options, replacing any prior values.
4070        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4071            self.0.options = v.into();
4072            self
4073        }
4074
4075        /// Sends the request.
4076        pub async fn send(self) -> Result<()> {
4077            (*self.0.stub)
4078                .cancel_operation(self.0.request, self.0.options)
4079                .await
4080                .map(crate::Response::into_body)
4081        }
4082
4083        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
4084        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4085            self.0.request.name = v.into();
4086            self
4087        }
4088    }
4089
4090    #[doc(hidden)]
4091    impl crate::RequestBuilder for CancelOperation {
4092        fn request_options(&mut self) -> &mut crate::RequestOptions {
4093            &mut self.0.options
4094        }
4095    }
4096}
4097
4098/// Request and client builders for [Environments][crate::client::Environments].
4099#[cfg(feature = "environments")]
4100#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
4101pub mod environments {
4102    use crate::Result;
4103
4104    /// A builder for [Environments][crate::client::Environments].
4105    ///
4106    /// ```
4107    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
4108    /// # use google_cloud_dialogflow_cx_v3::*;
4109    /// # use builder::environments::ClientBuilder;
4110    /// # use client::Environments;
4111    /// let builder : ClientBuilder = Environments::builder();
4112    /// let client = builder
4113    ///     .with_endpoint("https://dialogflow.googleapis.com")
4114    ///     .build().await?;
4115    /// # Ok(()) }
4116    /// ```
4117    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4118
4119    pub(crate) mod client {
4120        use super::super::super::client::Environments;
4121        pub struct Factory;
4122        impl crate::ClientFactory for Factory {
4123            type Client = Environments;
4124            type Credentials = gaxi::options::Credentials;
4125            async fn build(
4126                self,
4127                config: gaxi::options::ClientConfig,
4128            ) -> crate::ClientBuilderResult<Self::Client> {
4129                Self::Client::new(config).await
4130            }
4131        }
4132    }
4133
4134    /// Common implementation for [crate::client::Environments] request builders.
4135    #[derive(Clone, Debug)]
4136    pub(crate) struct RequestBuilder<R: std::default::Default> {
4137        stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4138        request: R,
4139        options: crate::RequestOptions,
4140    }
4141
4142    impl<R> RequestBuilder<R>
4143    where
4144        R: std::default::Default,
4145    {
4146        pub(crate) fn new(
4147            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4148        ) -> Self {
4149            Self {
4150                stub,
4151                request: R::default(),
4152                options: crate::RequestOptions::default(),
4153            }
4154        }
4155    }
4156
4157    /// The request builder for [Environments::list_environments][crate::client::Environments::list_environments] calls.
4158    ///
4159    /// # Example
4160    /// ```
4161    /// # use google_cloud_dialogflow_cx_v3::builder::environments::ListEnvironments;
4162    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4163    /// use google_cloud_gax::paginator::ItemPaginator;
4164    ///
4165    /// let builder = prepare_request_builder();
4166    /// let mut items = builder.by_item();
4167    /// while let Some(result) = items.next().await {
4168    ///   let item = result?;
4169    /// }
4170    /// # Ok(()) }
4171    ///
4172    /// fn prepare_request_builder() -> ListEnvironments {
4173    ///   # panic!();
4174    ///   // ... details omitted ...
4175    /// }
4176    /// ```
4177    #[derive(Clone, Debug)]
4178    pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
4179
4180    impl ListEnvironments {
4181        pub(crate) fn new(
4182            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4183        ) -> Self {
4184            Self(RequestBuilder::new(stub))
4185        }
4186
4187        /// Sets the full request, replacing any prior values.
4188        pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
4189            mut self,
4190            v: V,
4191        ) -> Self {
4192            self.0.request = v.into();
4193            self
4194        }
4195
4196        /// Sets all the options, replacing any prior values.
4197        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4198            self.0.options = v.into();
4199            self
4200        }
4201
4202        /// Sends the request.
4203        pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
4204            (*self.0.stub)
4205                .list_environments(self.0.request, self.0.options)
4206                .await
4207                .map(crate::Response::into_body)
4208        }
4209
4210        /// Streams each page in the collection.
4211        pub fn by_page(
4212            self,
4213        ) -> impl google_cloud_gax::paginator::Paginator<
4214            crate::model::ListEnvironmentsResponse,
4215            crate::Error,
4216        > {
4217            use std::clone::Clone;
4218            let token = self.0.request.page_token.clone();
4219            let execute = move |token: String| {
4220                let mut builder = self.clone();
4221                builder.0.request = builder.0.request.set_page_token(token);
4222                builder.send()
4223            };
4224            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4225        }
4226
4227        /// Streams each item in the collection.
4228        pub fn by_item(
4229            self,
4230        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4231            crate::model::ListEnvironmentsResponse,
4232            crate::Error,
4233        > {
4234            use google_cloud_gax::paginator::Paginator;
4235            self.by_page().items()
4236        }
4237
4238        /// Sets the value of [parent][crate::model::ListEnvironmentsRequest::parent].
4239        ///
4240        /// This is a **required** field for requests.
4241        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242            self.0.request.parent = v.into();
4243            self
4244        }
4245
4246        /// Sets the value of [page_size][crate::model::ListEnvironmentsRequest::page_size].
4247        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4248            self.0.request.page_size = v.into();
4249            self
4250        }
4251
4252        /// Sets the value of [page_token][crate::model::ListEnvironmentsRequest::page_token].
4253        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4254            self.0.request.page_token = v.into();
4255            self
4256        }
4257    }
4258
4259    #[doc(hidden)]
4260    impl crate::RequestBuilder for ListEnvironments {
4261        fn request_options(&mut self) -> &mut crate::RequestOptions {
4262            &mut self.0.options
4263        }
4264    }
4265
4266    /// The request builder for [Environments::get_environment][crate::client::Environments::get_environment] calls.
4267    ///
4268    /// # Example
4269    /// ```
4270    /// # use google_cloud_dialogflow_cx_v3::builder::environments::GetEnvironment;
4271    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4272    ///
4273    /// let builder = prepare_request_builder();
4274    /// let response = builder.send().await?;
4275    /// # Ok(()) }
4276    ///
4277    /// fn prepare_request_builder() -> GetEnvironment {
4278    ///   # panic!();
4279    ///   // ... details omitted ...
4280    /// }
4281    /// ```
4282    #[derive(Clone, Debug)]
4283    pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
4284
4285    impl GetEnvironment {
4286        pub(crate) fn new(
4287            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4288        ) -> Self {
4289            Self(RequestBuilder::new(stub))
4290        }
4291
4292        /// Sets the full request, replacing any prior values.
4293        pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
4294            self.0.request = v.into();
4295            self
4296        }
4297
4298        /// Sets all the options, replacing any prior values.
4299        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4300            self.0.options = v.into();
4301            self
4302        }
4303
4304        /// Sends the request.
4305        pub async fn send(self) -> Result<crate::model::Environment> {
4306            (*self.0.stub)
4307                .get_environment(self.0.request, self.0.options)
4308                .await
4309                .map(crate::Response::into_body)
4310        }
4311
4312        /// Sets the value of [name][crate::model::GetEnvironmentRequest::name].
4313        ///
4314        /// This is a **required** field for requests.
4315        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4316            self.0.request.name = v.into();
4317            self
4318        }
4319    }
4320
4321    #[doc(hidden)]
4322    impl crate::RequestBuilder for GetEnvironment {
4323        fn request_options(&mut self) -> &mut crate::RequestOptions {
4324            &mut self.0.options
4325        }
4326    }
4327
4328    /// The request builder for [Environments::create_environment][crate::client::Environments::create_environment] calls.
4329    ///
4330    /// # Example
4331    /// ```
4332    /// # use google_cloud_dialogflow_cx_v3::builder::environments::CreateEnvironment;
4333    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4334    /// use google_cloud_lro::Poller;
4335    ///
4336    /// let builder = prepare_request_builder();
4337    /// let response = builder.poller().until_done().await?;
4338    /// # Ok(()) }
4339    ///
4340    /// fn prepare_request_builder() -> CreateEnvironment {
4341    ///   # panic!();
4342    ///   // ... details omitted ...
4343    /// }
4344    /// ```
4345    #[derive(Clone, Debug)]
4346    pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
4347
4348    impl CreateEnvironment {
4349        pub(crate) fn new(
4350            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4351        ) -> Self {
4352            Self(RequestBuilder::new(stub))
4353        }
4354
4355        /// Sets the full request, replacing any prior values.
4356        pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
4357            mut self,
4358            v: V,
4359        ) -> Self {
4360            self.0.request = v.into();
4361            self
4362        }
4363
4364        /// Sets all the options, replacing any prior values.
4365        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4366            self.0.options = v.into();
4367            self
4368        }
4369
4370        /// Sends the request.
4371        ///
4372        /// # Long running operations
4373        ///
4374        /// This starts, but does not poll, a longrunning operation. More information
4375        /// on [create_environment][crate::client::Environments::create_environment].
4376        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4377            (*self.0.stub)
4378                .create_environment(self.0.request, self.0.options)
4379                .await
4380                .map(crate::Response::into_body)
4381        }
4382
4383        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_environment`.
4384        pub fn poller(
4385            self,
4386        ) -> impl google_cloud_lro::Poller<crate::model::Environment, wkt::Struct> {
4387            type Operation =
4388                google_cloud_lro::internal::Operation<crate::model::Environment, wkt::Struct>;
4389            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4390            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4391
4392            let stub = self.0.stub.clone();
4393            let mut options = self.0.options.clone();
4394            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4395            let query = move |name| {
4396                let stub = stub.clone();
4397                let options = options.clone();
4398                async {
4399                    let op = GetOperation::new(stub)
4400                        .set_name(name)
4401                        .with_options(options)
4402                        .send()
4403                        .await?;
4404                    Ok(Operation::new(op))
4405                }
4406            };
4407
4408            let start = move || async {
4409                let op = self.send().await?;
4410                Ok(Operation::new(op))
4411            };
4412
4413            google_cloud_lro::internal::new_poller(
4414                polling_error_policy,
4415                polling_backoff_policy,
4416                start,
4417                query,
4418            )
4419        }
4420
4421        /// Sets the value of [parent][crate::model::CreateEnvironmentRequest::parent].
4422        ///
4423        /// This is a **required** field for requests.
4424        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4425            self.0.request.parent = v.into();
4426            self
4427        }
4428
4429        /// Sets the value of [environment][crate::model::CreateEnvironmentRequest::environment].
4430        ///
4431        /// This is a **required** field for requests.
4432        pub fn set_environment<T>(mut self, v: T) -> Self
4433        where
4434            T: std::convert::Into<crate::model::Environment>,
4435        {
4436            self.0.request.environment = std::option::Option::Some(v.into());
4437            self
4438        }
4439
4440        /// Sets or clears the value of [environment][crate::model::CreateEnvironmentRequest::environment].
4441        ///
4442        /// This is a **required** field for requests.
4443        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
4444        where
4445            T: std::convert::Into<crate::model::Environment>,
4446        {
4447            self.0.request.environment = v.map(|x| x.into());
4448            self
4449        }
4450    }
4451
4452    #[doc(hidden)]
4453    impl crate::RequestBuilder for CreateEnvironment {
4454        fn request_options(&mut self) -> &mut crate::RequestOptions {
4455            &mut self.0.options
4456        }
4457    }
4458
4459    /// The request builder for [Environments::update_environment][crate::client::Environments::update_environment] calls.
4460    ///
4461    /// # Example
4462    /// ```
4463    /// # use google_cloud_dialogflow_cx_v3::builder::environments::UpdateEnvironment;
4464    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4465    /// use google_cloud_lro::Poller;
4466    ///
4467    /// let builder = prepare_request_builder();
4468    /// let response = builder.poller().until_done().await?;
4469    /// # Ok(()) }
4470    ///
4471    /// fn prepare_request_builder() -> UpdateEnvironment {
4472    ///   # panic!();
4473    ///   // ... details omitted ...
4474    /// }
4475    /// ```
4476    #[derive(Clone, Debug)]
4477    pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
4478
4479    impl UpdateEnvironment {
4480        pub(crate) fn new(
4481            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4482        ) -> Self {
4483            Self(RequestBuilder::new(stub))
4484        }
4485
4486        /// Sets the full request, replacing any prior values.
4487        pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
4488            mut self,
4489            v: V,
4490        ) -> Self {
4491            self.0.request = v.into();
4492            self
4493        }
4494
4495        /// Sets all the options, replacing any prior values.
4496        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4497            self.0.options = v.into();
4498            self
4499        }
4500
4501        /// Sends the request.
4502        ///
4503        /// # Long running operations
4504        ///
4505        /// This starts, but does not poll, a longrunning operation. More information
4506        /// on [update_environment][crate::client::Environments::update_environment].
4507        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4508            (*self.0.stub)
4509                .update_environment(self.0.request, self.0.options)
4510                .await
4511                .map(crate::Response::into_body)
4512        }
4513
4514        /// Creates a [Poller][google_cloud_lro::Poller] to work with `update_environment`.
4515        pub fn poller(
4516            self,
4517        ) -> impl google_cloud_lro::Poller<crate::model::Environment, wkt::Struct> {
4518            type Operation =
4519                google_cloud_lro::internal::Operation<crate::model::Environment, wkt::Struct>;
4520            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4521            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4522
4523            let stub = self.0.stub.clone();
4524            let mut options = self.0.options.clone();
4525            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4526            let query = move |name| {
4527                let stub = stub.clone();
4528                let options = options.clone();
4529                async {
4530                    let op = GetOperation::new(stub)
4531                        .set_name(name)
4532                        .with_options(options)
4533                        .send()
4534                        .await?;
4535                    Ok(Operation::new(op))
4536                }
4537            };
4538
4539            let start = move || async {
4540                let op = self.send().await?;
4541                Ok(Operation::new(op))
4542            };
4543
4544            google_cloud_lro::internal::new_poller(
4545                polling_error_policy,
4546                polling_backoff_policy,
4547                start,
4548                query,
4549            )
4550        }
4551
4552        /// Sets the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
4553        ///
4554        /// This is a **required** field for requests.
4555        pub fn set_environment<T>(mut self, v: T) -> Self
4556        where
4557            T: std::convert::Into<crate::model::Environment>,
4558        {
4559            self.0.request.environment = std::option::Option::Some(v.into());
4560            self
4561        }
4562
4563        /// Sets or clears the value of [environment][crate::model::UpdateEnvironmentRequest::environment].
4564        ///
4565        /// This is a **required** field for requests.
4566        pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
4567        where
4568            T: std::convert::Into<crate::model::Environment>,
4569        {
4570            self.0.request.environment = v.map(|x| x.into());
4571            self
4572        }
4573
4574        /// Sets the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
4575        ///
4576        /// This is a **required** field for requests.
4577        pub fn set_update_mask<T>(mut self, v: T) -> Self
4578        where
4579            T: std::convert::Into<wkt::FieldMask>,
4580        {
4581            self.0.request.update_mask = std::option::Option::Some(v.into());
4582            self
4583        }
4584
4585        /// Sets or clears the value of [update_mask][crate::model::UpdateEnvironmentRequest::update_mask].
4586        ///
4587        /// This is a **required** field for requests.
4588        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4589        where
4590            T: std::convert::Into<wkt::FieldMask>,
4591        {
4592            self.0.request.update_mask = v.map(|x| x.into());
4593            self
4594        }
4595    }
4596
4597    #[doc(hidden)]
4598    impl crate::RequestBuilder for UpdateEnvironment {
4599        fn request_options(&mut self) -> &mut crate::RequestOptions {
4600            &mut self.0.options
4601        }
4602    }
4603
4604    /// The request builder for [Environments::delete_environment][crate::client::Environments::delete_environment] calls.
4605    ///
4606    /// # Example
4607    /// ```
4608    /// # use google_cloud_dialogflow_cx_v3::builder::environments::DeleteEnvironment;
4609    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4610    ///
4611    /// let builder = prepare_request_builder();
4612    /// let response = builder.send().await?;
4613    /// # Ok(()) }
4614    ///
4615    /// fn prepare_request_builder() -> DeleteEnvironment {
4616    ///   # panic!();
4617    ///   // ... details omitted ...
4618    /// }
4619    /// ```
4620    #[derive(Clone, Debug)]
4621    pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
4622
4623    impl DeleteEnvironment {
4624        pub(crate) fn new(
4625            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4626        ) -> Self {
4627            Self(RequestBuilder::new(stub))
4628        }
4629
4630        /// Sets the full request, replacing any prior values.
4631        pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
4632            mut self,
4633            v: V,
4634        ) -> Self {
4635            self.0.request = v.into();
4636            self
4637        }
4638
4639        /// Sets all the options, replacing any prior values.
4640        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4641            self.0.options = v.into();
4642            self
4643        }
4644
4645        /// Sends the request.
4646        pub async fn send(self) -> Result<()> {
4647            (*self.0.stub)
4648                .delete_environment(self.0.request, self.0.options)
4649                .await
4650                .map(crate::Response::into_body)
4651        }
4652
4653        /// Sets the value of [name][crate::model::DeleteEnvironmentRequest::name].
4654        ///
4655        /// This is a **required** field for requests.
4656        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4657            self.0.request.name = v.into();
4658            self
4659        }
4660    }
4661
4662    #[doc(hidden)]
4663    impl crate::RequestBuilder for DeleteEnvironment {
4664        fn request_options(&mut self) -> &mut crate::RequestOptions {
4665            &mut self.0.options
4666        }
4667    }
4668
4669    /// The request builder for [Environments::lookup_environment_history][crate::client::Environments::lookup_environment_history] calls.
4670    ///
4671    /// # Example
4672    /// ```
4673    /// # use google_cloud_dialogflow_cx_v3::builder::environments::LookupEnvironmentHistory;
4674    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4675    /// use google_cloud_gax::paginator::ItemPaginator;
4676    ///
4677    /// let builder = prepare_request_builder();
4678    /// let mut items = builder.by_item();
4679    /// while let Some(result) = items.next().await {
4680    ///   let item = result?;
4681    /// }
4682    /// # Ok(()) }
4683    ///
4684    /// fn prepare_request_builder() -> LookupEnvironmentHistory {
4685    ///   # panic!();
4686    ///   // ... details omitted ...
4687    /// }
4688    /// ```
4689    #[derive(Clone, Debug)]
4690    pub struct LookupEnvironmentHistory(
4691        RequestBuilder<crate::model::LookupEnvironmentHistoryRequest>,
4692    );
4693
4694    impl LookupEnvironmentHistory {
4695        pub(crate) fn new(
4696            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4697        ) -> Self {
4698            Self(RequestBuilder::new(stub))
4699        }
4700
4701        /// Sets the full request, replacing any prior values.
4702        pub fn with_request<V: Into<crate::model::LookupEnvironmentHistoryRequest>>(
4703            mut self,
4704            v: V,
4705        ) -> Self {
4706            self.0.request = v.into();
4707            self
4708        }
4709
4710        /// Sets all the options, replacing any prior values.
4711        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4712            self.0.options = v.into();
4713            self
4714        }
4715
4716        /// Sends the request.
4717        pub async fn send(self) -> Result<crate::model::LookupEnvironmentHistoryResponse> {
4718            (*self.0.stub)
4719                .lookup_environment_history(self.0.request, self.0.options)
4720                .await
4721                .map(crate::Response::into_body)
4722        }
4723
4724        /// Streams each page in the collection.
4725        pub fn by_page(
4726            self,
4727        ) -> impl google_cloud_gax::paginator::Paginator<
4728            crate::model::LookupEnvironmentHistoryResponse,
4729            crate::Error,
4730        > {
4731            use std::clone::Clone;
4732            let token = self.0.request.page_token.clone();
4733            let execute = move |token: String| {
4734                let mut builder = self.clone();
4735                builder.0.request = builder.0.request.set_page_token(token);
4736                builder.send()
4737            };
4738            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4739        }
4740
4741        /// Streams each item in the collection.
4742        pub fn by_item(
4743            self,
4744        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4745            crate::model::LookupEnvironmentHistoryResponse,
4746            crate::Error,
4747        > {
4748            use google_cloud_gax::paginator::Paginator;
4749            self.by_page().items()
4750        }
4751
4752        /// Sets the value of [name][crate::model::LookupEnvironmentHistoryRequest::name].
4753        ///
4754        /// This is a **required** field for requests.
4755        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4756            self.0.request.name = v.into();
4757            self
4758        }
4759
4760        /// Sets the value of [page_size][crate::model::LookupEnvironmentHistoryRequest::page_size].
4761        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4762            self.0.request.page_size = v.into();
4763            self
4764        }
4765
4766        /// Sets the value of [page_token][crate::model::LookupEnvironmentHistoryRequest::page_token].
4767        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4768            self.0.request.page_token = v.into();
4769            self
4770        }
4771    }
4772
4773    #[doc(hidden)]
4774    impl crate::RequestBuilder for LookupEnvironmentHistory {
4775        fn request_options(&mut self) -> &mut crate::RequestOptions {
4776            &mut self.0.options
4777        }
4778    }
4779
4780    /// The request builder for [Environments::run_continuous_test][crate::client::Environments::run_continuous_test] calls.
4781    ///
4782    /// # Example
4783    /// ```
4784    /// # use google_cloud_dialogflow_cx_v3::builder::environments::RunContinuousTest;
4785    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4786    /// use google_cloud_lro::Poller;
4787    ///
4788    /// let builder = prepare_request_builder();
4789    /// let response = builder.poller().until_done().await?;
4790    /// # Ok(()) }
4791    ///
4792    /// fn prepare_request_builder() -> RunContinuousTest {
4793    ///   # panic!();
4794    ///   // ... details omitted ...
4795    /// }
4796    /// ```
4797    #[derive(Clone, Debug)]
4798    pub struct RunContinuousTest(RequestBuilder<crate::model::RunContinuousTestRequest>);
4799
4800    impl RunContinuousTest {
4801        pub(crate) fn new(
4802            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4803        ) -> Self {
4804            Self(RequestBuilder::new(stub))
4805        }
4806
4807        /// Sets the full request, replacing any prior values.
4808        pub fn with_request<V: Into<crate::model::RunContinuousTestRequest>>(
4809            mut self,
4810            v: V,
4811        ) -> Self {
4812            self.0.request = v.into();
4813            self
4814        }
4815
4816        /// Sets all the options, replacing any prior values.
4817        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4818            self.0.options = v.into();
4819            self
4820        }
4821
4822        /// Sends the request.
4823        ///
4824        /// # Long running operations
4825        ///
4826        /// This starts, but does not poll, a longrunning operation. More information
4827        /// on [run_continuous_test][crate::client::Environments::run_continuous_test].
4828        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4829            (*self.0.stub)
4830                .run_continuous_test(self.0.request, self.0.options)
4831                .await
4832                .map(crate::Response::into_body)
4833        }
4834
4835        /// Creates a [Poller][google_cloud_lro::Poller] to work with `run_continuous_test`.
4836        pub fn poller(
4837            self,
4838        ) -> impl google_cloud_lro::Poller<
4839            crate::model::RunContinuousTestResponse,
4840            crate::model::RunContinuousTestMetadata,
4841        > {
4842            type Operation = google_cloud_lro::internal::Operation<
4843                crate::model::RunContinuousTestResponse,
4844                crate::model::RunContinuousTestMetadata,
4845            >;
4846            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4847            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4848
4849            let stub = self.0.stub.clone();
4850            let mut options = self.0.options.clone();
4851            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4852            let query = move |name| {
4853                let stub = stub.clone();
4854                let options = options.clone();
4855                async {
4856                    let op = GetOperation::new(stub)
4857                        .set_name(name)
4858                        .with_options(options)
4859                        .send()
4860                        .await?;
4861                    Ok(Operation::new(op))
4862                }
4863            };
4864
4865            let start = move || async {
4866                let op = self.send().await?;
4867                Ok(Operation::new(op))
4868            };
4869
4870            google_cloud_lro::internal::new_poller(
4871                polling_error_policy,
4872                polling_backoff_policy,
4873                start,
4874                query,
4875            )
4876        }
4877
4878        /// Sets the value of [environment][crate::model::RunContinuousTestRequest::environment].
4879        ///
4880        /// This is a **required** field for requests.
4881        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
4882            self.0.request.environment = v.into();
4883            self
4884        }
4885    }
4886
4887    #[doc(hidden)]
4888    impl crate::RequestBuilder for RunContinuousTest {
4889        fn request_options(&mut self) -> &mut crate::RequestOptions {
4890            &mut self.0.options
4891        }
4892    }
4893
4894    /// The request builder for [Environments::list_continuous_test_results][crate::client::Environments::list_continuous_test_results] calls.
4895    ///
4896    /// # Example
4897    /// ```
4898    /// # use google_cloud_dialogflow_cx_v3::builder::environments::ListContinuousTestResults;
4899    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
4900    /// use google_cloud_gax::paginator::ItemPaginator;
4901    ///
4902    /// let builder = prepare_request_builder();
4903    /// let mut items = builder.by_item();
4904    /// while let Some(result) = items.next().await {
4905    ///   let item = result?;
4906    /// }
4907    /// # Ok(()) }
4908    ///
4909    /// fn prepare_request_builder() -> ListContinuousTestResults {
4910    ///   # panic!();
4911    ///   // ... details omitted ...
4912    /// }
4913    /// ```
4914    #[derive(Clone, Debug)]
4915    pub struct ListContinuousTestResults(
4916        RequestBuilder<crate::model::ListContinuousTestResultsRequest>,
4917    );
4918
4919    impl ListContinuousTestResults {
4920        pub(crate) fn new(
4921            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4922        ) -> Self {
4923            Self(RequestBuilder::new(stub))
4924        }
4925
4926        /// Sets the full request, replacing any prior values.
4927        pub fn with_request<V: Into<crate::model::ListContinuousTestResultsRequest>>(
4928            mut self,
4929            v: V,
4930        ) -> Self {
4931            self.0.request = v.into();
4932            self
4933        }
4934
4935        /// Sets all the options, replacing any prior values.
4936        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4937            self.0.options = v.into();
4938            self
4939        }
4940
4941        /// Sends the request.
4942        pub async fn send(self) -> Result<crate::model::ListContinuousTestResultsResponse> {
4943            (*self.0.stub)
4944                .list_continuous_test_results(self.0.request, self.0.options)
4945                .await
4946                .map(crate::Response::into_body)
4947        }
4948
4949        /// Streams each page in the collection.
4950        pub fn by_page(
4951            self,
4952        ) -> impl google_cloud_gax::paginator::Paginator<
4953            crate::model::ListContinuousTestResultsResponse,
4954            crate::Error,
4955        > {
4956            use std::clone::Clone;
4957            let token = self.0.request.page_token.clone();
4958            let execute = move |token: String| {
4959                let mut builder = self.clone();
4960                builder.0.request = builder.0.request.set_page_token(token);
4961                builder.send()
4962            };
4963            google_cloud_gax::paginator::internal::new_paginator(token, execute)
4964        }
4965
4966        /// Streams each item in the collection.
4967        pub fn by_item(
4968            self,
4969        ) -> impl google_cloud_gax::paginator::ItemPaginator<
4970            crate::model::ListContinuousTestResultsResponse,
4971            crate::Error,
4972        > {
4973            use google_cloud_gax::paginator::Paginator;
4974            self.by_page().items()
4975        }
4976
4977        /// Sets the value of [parent][crate::model::ListContinuousTestResultsRequest::parent].
4978        ///
4979        /// This is a **required** field for requests.
4980        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4981            self.0.request.parent = v.into();
4982            self
4983        }
4984
4985        /// Sets the value of [page_size][crate::model::ListContinuousTestResultsRequest::page_size].
4986        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4987            self.0.request.page_size = v.into();
4988            self
4989        }
4990
4991        /// Sets the value of [page_token][crate::model::ListContinuousTestResultsRequest::page_token].
4992        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993            self.0.request.page_token = v.into();
4994            self
4995        }
4996    }
4997
4998    #[doc(hidden)]
4999    impl crate::RequestBuilder for ListContinuousTestResults {
5000        fn request_options(&mut self) -> &mut crate::RequestOptions {
5001            &mut self.0.options
5002        }
5003    }
5004
5005    /// The request builder for [Environments::deploy_flow][crate::client::Environments::deploy_flow] calls.
5006    ///
5007    /// # Example
5008    /// ```
5009    /// # use google_cloud_dialogflow_cx_v3::builder::environments::DeployFlow;
5010    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5011    /// use google_cloud_lro::Poller;
5012    ///
5013    /// let builder = prepare_request_builder();
5014    /// let response = builder.poller().until_done().await?;
5015    /// # Ok(()) }
5016    ///
5017    /// fn prepare_request_builder() -> DeployFlow {
5018    ///   # panic!();
5019    ///   // ... details omitted ...
5020    /// }
5021    /// ```
5022    #[derive(Clone, Debug)]
5023    pub struct DeployFlow(RequestBuilder<crate::model::DeployFlowRequest>);
5024
5025    impl DeployFlow {
5026        pub(crate) fn new(
5027            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5028        ) -> Self {
5029            Self(RequestBuilder::new(stub))
5030        }
5031
5032        /// Sets the full request, replacing any prior values.
5033        pub fn with_request<V: Into<crate::model::DeployFlowRequest>>(mut self, v: V) -> Self {
5034            self.0.request = v.into();
5035            self
5036        }
5037
5038        /// Sets all the options, replacing any prior values.
5039        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5040            self.0.options = v.into();
5041            self
5042        }
5043
5044        /// Sends the request.
5045        ///
5046        /// # Long running operations
5047        ///
5048        /// This starts, but does not poll, a longrunning operation. More information
5049        /// on [deploy_flow][crate::client::Environments::deploy_flow].
5050        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5051            (*self.0.stub)
5052                .deploy_flow(self.0.request, self.0.options)
5053                .await
5054                .map(crate::Response::into_body)
5055        }
5056
5057        /// Creates a [Poller][google_cloud_lro::Poller] to work with `deploy_flow`.
5058        pub fn poller(
5059            self,
5060        ) -> impl google_cloud_lro::Poller<
5061            crate::model::DeployFlowResponse,
5062            crate::model::DeployFlowMetadata,
5063        > {
5064            type Operation = google_cloud_lro::internal::Operation<
5065                crate::model::DeployFlowResponse,
5066                crate::model::DeployFlowMetadata,
5067            >;
5068            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5069            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5070
5071            let stub = self.0.stub.clone();
5072            let mut options = self.0.options.clone();
5073            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5074            let query = move |name| {
5075                let stub = stub.clone();
5076                let options = options.clone();
5077                async {
5078                    let op = GetOperation::new(stub)
5079                        .set_name(name)
5080                        .with_options(options)
5081                        .send()
5082                        .await?;
5083                    Ok(Operation::new(op))
5084                }
5085            };
5086
5087            let start = move || async {
5088                let op = self.send().await?;
5089                Ok(Operation::new(op))
5090            };
5091
5092            google_cloud_lro::internal::new_poller(
5093                polling_error_policy,
5094                polling_backoff_policy,
5095                start,
5096                query,
5097            )
5098        }
5099
5100        /// Sets the value of [environment][crate::model::DeployFlowRequest::environment].
5101        ///
5102        /// This is a **required** field for requests.
5103        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
5104            self.0.request.environment = v.into();
5105            self
5106        }
5107
5108        /// Sets the value of [flow_version][crate::model::DeployFlowRequest::flow_version].
5109        ///
5110        /// This is a **required** field for requests.
5111        pub fn set_flow_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112            self.0.request.flow_version = v.into();
5113            self
5114        }
5115    }
5116
5117    #[doc(hidden)]
5118    impl crate::RequestBuilder for DeployFlow {
5119        fn request_options(&mut self) -> &mut crate::RequestOptions {
5120            &mut self.0.options
5121        }
5122    }
5123
5124    /// The request builder for [Environments::list_locations][crate::client::Environments::list_locations] calls.
5125    ///
5126    /// # Example
5127    /// ```
5128    /// # use google_cloud_dialogflow_cx_v3::builder::environments::ListLocations;
5129    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5130    /// use google_cloud_gax::paginator::ItemPaginator;
5131    ///
5132    /// let builder = prepare_request_builder();
5133    /// let mut items = builder.by_item();
5134    /// while let Some(result) = items.next().await {
5135    ///   let item = result?;
5136    /// }
5137    /// # Ok(()) }
5138    ///
5139    /// fn prepare_request_builder() -> ListLocations {
5140    ///   # panic!();
5141    ///   // ... details omitted ...
5142    /// }
5143    /// ```
5144    #[derive(Clone, Debug)]
5145    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5146
5147    impl ListLocations {
5148        pub(crate) fn new(
5149            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5150        ) -> Self {
5151            Self(RequestBuilder::new(stub))
5152        }
5153
5154        /// Sets the full request, replacing any prior values.
5155        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5156            mut self,
5157            v: V,
5158        ) -> Self {
5159            self.0.request = v.into();
5160            self
5161        }
5162
5163        /// Sets all the options, replacing any prior values.
5164        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5165            self.0.options = v.into();
5166            self
5167        }
5168
5169        /// Sends the request.
5170        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5171            (*self.0.stub)
5172                .list_locations(self.0.request, self.0.options)
5173                .await
5174                .map(crate::Response::into_body)
5175        }
5176
5177        /// Streams each page in the collection.
5178        pub fn by_page(
5179            self,
5180        ) -> impl google_cloud_gax::paginator::Paginator<
5181            google_cloud_location::model::ListLocationsResponse,
5182            crate::Error,
5183        > {
5184            use std::clone::Clone;
5185            let token = self.0.request.page_token.clone();
5186            let execute = move |token: String| {
5187                let mut builder = self.clone();
5188                builder.0.request = builder.0.request.set_page_token(token);
5189                builder.send()
5190            };
5191            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5192        }
5193
5194        /// Streams each item in the collection.
5195        pub fn by_item(
5196            self,
5197        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5198            google_cloud_location::model::ListLocationsResponse,
5199            crate::Error,
5200        > {
5201            use google_cloud_gax::paginator::Paginator;
5202            self.by_page().items()
5203        }
5204
5205        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
5206        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5207            self.0.request.name = v.into();
5208            self
5209        }
5210
5211        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
5212        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5213            self.0.request.filter = v.into();
5214            self
5215        }
5216
5217        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
5218        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5219            self.0.request.page_size = v.into();
5220            self
5221        }
5222
5223        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
5224        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5225            self.0.request.page_token = v.into();
5226            self
5227        }
5228    }
5229
5230    #[doc(hidden)]
5231    impl crate::RequestBuilder for ListLocations {
5232        fn request_options(&mut self) -> &mut crate::RequestOptions {
5233            &mut self.0.options
5234        }
5235    }
5236
5237    /// The request builder for [Environments::get_location][crate::client::Environments::get_location] calls.
5238    ///
5239    /// # Example
5240    /// ```
5241    /// # use google_cloud_dialogflow_cx_v3::builder::environments::GetLocation;
5242    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5243    ///
5244    /// let builder = prepare_request_builder();
5245    /// let response = builder.send().await?;
5246    /// # Ok(()) }
5247    ///
5248    /// fn prepare_request_builder() -> GetLocation {
5249    ///   # panic!();
5250    ///   // ... details omitted ...
5251    /// }
5252    /// ```
5253    #[derive(Clone, Debug)]
5254    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5255
5256    impl GetLocation {
5257        pub(crate) fn new(
5258            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5259        ) -> Self {
5260            Self(RequestBuilder::new(stub))
5261        }
5262
5263        /// Sets the full request, replacing any prior values.
5264        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5265            mut self,
5266            v: V,
5267        ) -> Self {
5268            self.0.request = v.into();
5269            self
5270        }
5271
5272        /// Sets all the options, replacing any prior values.
5273        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5274            self.0.options = v.into();
5275            self
5276        }
5277
5278        /// Sends the request.
5279        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5280            (*self.0.stub)
5281                .get_location(self.0.request, self.0.options)
5282                .await
5283                .map(crate::Response::into_body)
5284        }
5285
5286        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
5287        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5288            self.0.request.name = v.into();
5289            self
5290        }
5291    }
5292
5293    #[doc(hidden)]
5294    impl crate::RequestBuilder for GetLocation {
5295        fn request_options(&mut self) -> &mut crate::RequestOptions {
5296            &mut self.0.options
5297        }
5298    }
5299
5300    /// The request builder for [Environments::list_operations][crate::client::Environments::list_operations] calls.
5301    ///
5302    /// # Example
5303    /// ```
5304    /// # use google_cloud_dialogflow_cx_v3::builder::environments::ListOperations;
5305    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5306    /// use google_cloud_gax::paginator::ItemPaginator;
5307    ///
5308    /// let builder = prepare_request_builder();
5309    /// let mut items = builder.by_item();
5310    /// while let Some(result) = items.next().await {
5311    ///   let item = result?;
5312    /// }
5313    /// # Ok(()) }
5314    ///
5315    /// fn prepare_request_builder() -> ListOperations {
5316    ///   # panic!();
5317    ///   // ... details omitted ...
5318    /// }
5319    /// ```
5320    #[derive(Clone, Debug)]
5321    pub struct ListOperations(
5322        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5323    );
5324
5325    impl ListOperations {
5326        pub(crate) fn new(
5327            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5328        ) -> Self {
5329            Self(RequestBuilder::new(stub))
5330        }
5331
5332        /// Sets the full request, replacing any prior values.
5333        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5334            mut self,
5335            v: V,
5336        ) -> 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<crate::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<google_cloud_longrunning::model::ListOperationsResponse> {
5349            (*self.0.stub)
5350                .list_operations(self.0.request, self.0.options)
5351                .await
5352                .map(crate::Response::into_body)
5353        }
5354
5355        /// Streams each page in the collection.
5356        pub fn by_page(
5357            self,
5358        ) -> impl google_cloud_gax::paginator::Paginator<
5359            google_cloud_longrunning::model::ListOperationsResponse,
5360            crate::Error,
5361        > {
5362            use std::clone::Clone;
5363            let token = self.0.request.page_token.clone();
5364            let execute = move |token: String| {
5365                let mut builder = self.clone();
5366                builder.0.request = builder.0.request.set_page_token(token);
5367                builder.send()
5368            };
5369            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5370        }
5371
5372        /// Streams each item in the collection.
5373        pub fn by_item(
5374            self,
5375        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5376            google_cloud_longrunning::model::ListOperationsResponse,
5377            crate::Error,
5378        > {
5379            use google_cloud_gax::paginator::Paginator;
5380            self.by_page().items()
5381        }
5382
5383        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5384        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5385            self.0.request.name = v.into();
5386            self
5387        }
5388
5389        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5390        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5391            self.0.request.filter = v.into();
5392            self
5393        }
5394
5395        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5396        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5397            self.0.request.page_size = v.into();
5398            self
5399        }
5400
5401        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5402        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403            self.0.request.page_token = v.into();
5404            self
5405        }
5406
5407        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5408        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5409            self.0.request.return_partial_success = v.into();
5410            self
5411        }
5412    }
5413
5414    #[doc(hidden)]
5415    impl crate::RequestBuilder for ListOperations {
5416        fn request_options(&mut self) -> &mut crate::RequestOptions {
5417            &mut self.0.options
5418        }
5419    }
5420
5421    /// The request builder for [Environments::get_operation][crate::client::Environments::get_operation] calls.
5422    ///
5423    /// # Example
5424    /// ```
5425    /// # use google_cloud_dialogflow_cx_v3::builder::environments::GetOperation;
5426    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5427    ///
5428    /// let builder = prepare_request_builder();
5429    /// let response = builder.send().await?;
5430    /// # Ok(()) }
5431    ///
5432    /// fn prepare_request_builder() -> GetOperation {
5433    ///   # panic!();
5434    ///   // ... details omitted ...
5435    /// }
5436    /// ```
5437    #[derive(Clone, Debug)]
5438    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5439
5440    impl GetOperation {
5441        pub(crate) fn new(
5442            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5443        ) -> Self {
5444            Self(RequestBuilder::new(stub))
5445        }
5446
5447        /// Sets the full request, replacing any prior values.
5448        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5449            mut self,
5450            v: V,
5451        ) -> Self {
5452            self.0.request = v.into();
5453            self
5454        }
5455
5456        /// Sets all the options, replacing any prior values.
5457        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5458            self.0.options = v.into();
5459            self
5460        }
5461
5462        /// Sends the request.
5463        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5464            (*self.0.stub)
5465                .get_operation(self.0.request, self.0.options)
5466                .await
5467                .map(crate::Response::into_body)
5468        }
5469
5470        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5471        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5472            self.0.request.name = v.into();
5473            self
5474        }
5475    }
5476
5477    #[doc(hidden)]
5478    impl crate::RequestBuilder for GetOperation {
5479        fn request_options(&mut self) -> &mut crate::RequestOptions {
5480            &mut self.0.options
5481        }
5482    }
5483
5484    /// The request builder for [Environments::cancel_operation][crate::client::Environments::cancel_operation] calls.
5485    ///
5486    /// # Example
5487    /// ```
5488    /// # use google_cloud_dialogflow_cx_v3::builder::environments::CancelOperation;
5489    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5490    ///
5491    /// let builder = prepare_request_builder();
5492    /// let response = builder.send().await?;
5493    /// # Ok(()) }
5494    ///
5495    /// fn prepare_request_builder() -> CancelOperation {
5496    ///   # panic!();
5497    ///   // ... details omitted ...
5498    /// }
5499    /// ```
5500    #[derive(Clone, Debug)]
5501    pub struct CancelOperation(
5502        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5503    );
5504
5505    impl CancelOperation {
5506        pub(crate) fn new(
5507            stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5508        ) -> Self {
5509            Self(RequestBuilder::new(stub))
5510        }
5511
5512        /// Sets the full request, replacing any prior values.
5513        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5514            mut self,
5515            v: V,
5516        ) -> Self {
5517            self.0.request = v.into();
5518            self
5519        }
5520
5521        /// Sets all the options, replacing any prior values.
5522        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5523            self.0.options = v.into();
5524            self
5525        }
5526
5527        /// Sends the request.
5528        pub async fn send(self) -> Result<()> {
5529            (*self.0.stub)
5530                .cancel_operation(self.0.request, self.0.options)
5531                .await
5532                .map(crate::Response::into_body)
5533        }
5534
5535        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5536        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5537            self.0.request.name = v.into();
5538            self
5539        }
5540    }
5541
5542    #[doc(hidden)]
5543    impl crate::RequestBuilder for CancelOperation {
5544        fn request_options(&mut self) -> &mut crate::RequestOptions {
5545            &mut self.0.options
5546        }
5547    }
5548}
5549
5550/// Request and client builders for [Examples][crate::client::Examples].
5551#[cfg(feature = "examples")]
5552#[cfg_attr(docsrs, doc(cfg(feature = "examples")))]
5553pub mod examples {
5554    use crate::Result;
5555
5556    /// A builder for [Examples][crate::client::Examples].
5557    ///
5558    /// ```
5559    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5560    /// # use google_cloud_dialogflow_cx_v3::*;
5561    /// # use builder::examples::ClientBuilder;
5562    /// # use client::Examples;
5563    /// let builder : ClientBuilder = Examples::builder();
5564    /// let client = builder
5565    ///     .with_endpoint("https://dialogflow.googleapis.com")
5566    ///     .build().await?;
5567    /// # Ok(()) }
5568    /// ```
5569    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5570
5571    pub(crate) mod client {
5572        use super::super::super::client::Examples;
5573        pub struct Factory;
5574        impl crate::ClientFactory for Factory {
5575            type Client = Examples;
5576            type Credentials = gaxi::options::Credentials;
5577            async fn build(
5578                self,
5579                config: gaxi::options::ClientConfig,
5580            ) -> crate::ClientBuilderResult<Self::Client> {
5581                Self::Client::new(config).await
5582            }
5583        }
5584    }
5585
5586    /// Common implementation for [crate::client::Examples] request builders.
5587    #[derive(Clone, Debug)]
5588    pub(crate) struct RequestBuilder<R: std::default::Default> {
5589        stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>,
5590        request: R,
5591        options: crate::RequestOptions,
5592    }
5593
5594    impl<R> RequestBuilder<R>
5595    where
5596        R: std::default::Default,
5597    {
5598        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5599            Self {
5600                stub,
5601                request: R::default(),
5602                options: crate::RequestOptions::default(),
5603            }
5604        }
5605    }
5606
5607    /// The request builder for [Examples::create_example][crate::client::Examples::create_example] calls.
5608    ///
5609    /// # Example
5610    /// ```
5611    /// # use google_cloud_dialogflow_cx_v3::builder::examples::CreateExample;
5612    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5613    ///
5614    /// let builder = prepare_request_builder();
5615    /// let response = builder.send().await?;
5616    /// # Ok(()) }
5617    ///
5618    /// fn prepare_request_builder() -> CreateExample {
5619    ///   # panic!();
5620    ///   // ... details omitted ...
5621    /// }
5622    /// ```
5623    #[derive(Clone, Debug)]
5624    pub struct CreateExample(RequestBuilder<crate::model::CreateExampleRequest>);
5625
5626    impl CreateExample {
5627        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5628            Self(RequestBuilder::new(stub))
5629        }
5630
5631        /// Sets the full request, replacing any prior values.
5632        pub fn with_request<V: Into<crate::model::CreateExampleRequest>>(mut self, v: V) -> Self {
5633            self.0.request = v.into();
5634            self
5635        }
5636
5637        /// Sets all the options, replacing any prior values.
5638        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5639            self.0.options = v.into();
5640            self
5641        }
5642
5643        /// Sends the request.
5644        pub async fn send(self) -> Result<crate::model::Example> {
5645            (*self.0.stub)
5646                .create_example(self.0.request, self.0.options)
5647                .await
5648                .map(crate::Response::into_body)
5649        }
5650
5651        /// Sets the value of [parent][crate::model::CreateExampleRequest::parent].
5652        ///
5653        /// This is a **required** field for requests.
5654        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5655            self.0.request.parent = v.into();
5656            self
5657        }
5658
5659        /// Sets the value of [example][crate::model::CreateExampleRequest::example].
5660        ///
5661        /// This is a **required** field for requests.
5662        pub fn set_example<T>(mut self, v: T) -> Self
5663        where
5664            T: std::convert::Into<crate::model::Example>,
5665        {
5666            self.0.request.example = std::option::Option::Some(v.into());
5667            self
5668        }
5669
5670        /// Sets or clears the value of [example][crate::model::CreateExampleRequest::example].
5671        ///
5672        /// This is a **required** field for requests.
5673        pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
5674        where
5675            T: std::convert::Into<crate::model::Example>,
5676        {
5677            self.0.request.example = v.map(|x| x.into());
5678            self
5679        }
5680    }
5681
5682    #[doc(hidden)]
5683    impl crate::RequestBuilder for CreateExample {
5684        fn request_options(&mut self) -> &mut crate::RequestOptions {
5685            &mut self.0.options
5686        }
5687    }
5688
5689    /// The request builder for [Examples::delete_example][crate::client::Examples::delete_example] calls.
5690    ///
5691    /// # Example
5692    /// ```
5693    /// # use google_cloud_dialogflow_cx_v3::builder::examples::DeleteExample;
5694    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5695    ///
5696    /// let builder = prepare_request_builder();
5697    /// let response = builder.send().await?;
5698    /// # Ok(()) }
5699    ///
5700    /// fn prepare_request_builder() -> DeleteExample {
5701    ///   # panic!();
5702    ///   // ... details omitted ...
5703    /// }
5704    /// ```
5705    #[derive(Clone, Debug)]
5706    pub struct DeleteExample(RequestBuilder<crate::model::DeleteExampleRequest>);
5707
5708    impl DeleteExample {
5709        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5710            Self(RequestBuilder::new(stub))
5711        }
5712
5713        /// Sets the full request, replacing any prior values.
5714        pub fn with_request<V: Into<crate::model::DeleteExampleRequest>>(mut self, v: V) -> Self {
5715            self.0.request = v.into();
5716            self
5717        }
5718
5719        /// Sets all the options, replacing any prior values.
5720        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5721            self.0.options = v.into();
5722            self
5723        }
5724
5725        /// Sends the request.
5726        pub async fn send(self) -> Result<()> {
5727            (*self.0.stub)
5728                .delete_example(self.0.request, self.0.options)
5729                .await
5730                .map(crate::Response::into_body)
5731        }
5732
5733        /// Sets the value of [name][crate::model::DeleteExampleRequest::name].
5734        ///
5735        /// This is a **required** field for requests.
5736        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5737            self.0.request.name = v.into();
5738            self
5739        }
5740    }
5741
5742    #[doc(hidden)]
5743    impl crate::RequestBuilder for DeleteExample {
5744        fn request_options(&mut self) -> &mut crate::RequestOptions {
5745            &mut self.0.options
5746        }
5747    }
5748
5749    /// The request builder for [Examples::list_examples][crate::client::Examples::list_examples] calls.
5750    ///
5751    /// # Example
5752    /// ```
5753    /// # use google_cloud_dialogflow_cx_v3::builder::examples::ListExamples;
5754    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5755    /// use google_cloud_gax::paginator::ItemPaginator;
5756    ///
5757    /// let builder = prepare_request_builder();
5758    /// let mut items = builder.by_item();
5759    /// while let Some(result) = items.next().await {
5760    ///   let item = result?;
5761    /// }
5762    /// # Ok(()) }
5763    ///
5764    /// fn prepare_request_builder() -> ListExamples {
5765    ///   # panic!();
5766    ///   // ... details omitted ...
5767    /// }
5768    /// ```
5769    #[derive(Clone, Debug)]
5770    pub struct ListExamples(RequestBuilder<crate::model::ListExamplesRequest>);
5771
5772    impl ListExamples {
5773        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5774            Self(RequestBuilder::new(stub))
5775        }
5776
5777        /// Sets the full request, replacing any prior values.
5778        pub fn with_request<V: Into<crate::model::ListExamplesRequest>>(mut self, v: V) -> Self {
5779            self.0.request = v.into();
5780            self
5781        }
5782
5783        /// Sets all the options, replacing any prior values.
5784        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5785            self.0.options = v.into();
5786            self
5787        }
5788
5789        /// Sends the request.
5790        pub async fn send(self) -> Result<crate::model::ListExamplesResponse> {
5791            (*self.0.stub)
5792                .list_examples(self.0.request, self.0.options)
5793                .await
5794                .map(crate::Response::into_body)
5795        }
5796
5797        /// Streams each page in the collection.
5798        pub fn by_page(
5799            self,
5800        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListExamplesResponse, crate::Error>
5801        {
5802            use std::clone::Clone;
5803            let token = self.0.request.page_token.clone();
5804            let execute = move |token: String| {
5805                let mut builder = self.clone();
5806                builder.0.request = builder.0.request.set_page_token(token);
5807                builder.send()
5808            };
5809            google_cloud_gax::paginator::internal::new_paginator(token, execute)
5810        }
5811
5812        /// Streams each item in the collection.
5813        pub fn by_item(
5814            self,
5815        ) -> impl google_cloud_gax::paginator::ItemPaginator<
5816            crate::model::ListExamplesResponse,
5817            crate::Error,
5818        > {
5819            use google_cloud_gax::paginator::Paginator;
5820            self.by_page().items()
5821        }
5822
5823        /// Sets the value of [parent][crate::model::ListExamplesRequest::parent].
5824        ///
5825        /// This is a **required** field for requests.
5826        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5827            self.0.request.parent = v.into();
5828            self
5829        }
5830
5831        /// Sets the value of [page_size][crate::model::ListExamplesRequest::page_size].
5832        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5833            self.0.request.page_size = v.into();
5834            self
5835        }
5836
5837        /// Sets the value of [page_token][crate::model::ListExamplesRequest::page_token].
5838        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5839            self.0.request.page_token = v.into();
5840            self
5841        }
5842
5843        /// Sets the value of [language_code][crate::model::ListExamplesRequest::language_code].
5844        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
5845            self.0.request.language_code = v.into();
5846            self
5847        }
5848    }
5849
5850    #[doc(hidden)]
5851    impl crate::RequestBuilder for ListExamples {
5852        fn request_options(&mut self) -> &mut crate::RequestOptions {
5853            &mut self.0.options
5854        }
5855    }
5856
5857    /// The request builder for [Examples::get_example][crate::client::Examples::get_example] calls.
5858    ///
5859    /// # Example
5860    /// ```
5861    /// # use google_cloud_dialogflow_cx_v3::builder::examples::GetExample;
5862    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5863    ///
5864    /// let builder = prepare_request_builder();
5865    /// let response = builder.send().await?;
5866    /// # Ok(()) }
5867    ///
5868    /// fn prepare_request_builder() -> GetExample {
5869    ///   # panic!();
5870    ///   // ... details omitted ...
5871    /// }
5872    /// ```
5873    #[derive(Clone, Debug)]
5874    pub struct GetExample(RequestBuilder<crate::model::GetExampleRequest>);
5875
5876    impl GetExample {
5877        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5878            Self(RequestBuilder::new(stub))
5879        }
5880
5881        /// Sets the full request, replacing any prior values.
5882        pub fn with_request<V: Into<crate::model::GetExampleRequest>>(mut self, v: V) -> Self {
5883            self.0.request = v.into();
5884            self
5885        }
5886
5887        /// Sets all the options, replacing any prior values.
5888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5889            self.0.options = v.into();
5890            self
5891        }
5892
5893        /// Sends the request.
5894        pub async fn send(self) -> Result<crate::model::Example> {
5895            (*self.0.stub)
5896                .get_example(self.0.request, self.0.options)
5897                .await
5898                .map(crate::Response::into_body)
5899        }
5900
5901        /// Sets the value of [name][crate::model::GetExampleRequest::name].
5902        ///
5903        /// This is a **required** field for requests.
5904        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5905            self.0.request.name = v.into();
5906            self
5907        }
5908    }
5909
5910    #[doc(hidden)]
5911    impl crate::RequestBuilder for GetExample {
5912        fn request_options(&mut self) -> &mut crate::RequestOptions {
5913            &mut self.0.options
5914        }
5915    }
5916
5917    /// The request builder for [Examples::update_example][crate::client::Examples::update_example] calls.
5918    ///
5919    /// # Example
5920    /// ```
5921    /// # use google_cloud_dialogflow_cx_v3::builder::examples::UpdateExample;
5922    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
5923    ///
5924    /// let builder = prepare_request_builder();
5925    /// let response = builder.send().await?;
5926    /// # Ok(()) }
5927    ///
5928    /// fn prepare_request_builder() -> UpdateExample {
5929    ///   # panic!();
5930    ///   // ... details omitted ...
5931    /// }
5932    /// ```
5933    #[derive(Clone, Debug)]
5934    pub struct UpdateExample(RequestBuilder<crate::model::UpdateExampleRequest>);
5935
5936    impl UpdateExample {
5937        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5938            Self(RequestBuilder::new(stub))
5939        }
5940
5941        /// Sets the full request, replacing any prior values.
5942        pub fn with_request<V: Into<crate::model::UpdateExampleRequest>>(mut self, v: V) -> Self {
5943            self.0.request = v.into();
5944            self
5945        }
5946
5947        /// Sets all the options, replacing any prior values.
5948        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5949            self.0.options = v.into();
5950            self
5951        }
5952
5953        /// Sends the request.
5954        pub async fn send(self) -> Result<crate::model::Example> {
5955            (*self.0.stub)
5956                .update_example(self.0.request, self.0.options)
5957                .await
5958                .map(crate::Response::into_body)
5959        }
5960
5961        /// Sets the value of [example][crate::model::UpdateExampleRequest::example].
5962        ///
5963        /// This is a **required** field for requests.
5964        pub fn set_example<T>(mut self, v: T) -> Self
5965        where
5966            T: std::convert::Into<crate::model::Example>,
5967        {
5968            self.0.request.example = std::option::Option::Some(v.into());
5969            self
5970        }
5971
5972        /// Sets or clears the value of [example][crate::model::UpdateExampleRequest::example].
5973        ///
5974        /// This is a **required** field for requests.
5975        pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
5976        where
5977            T: std::convert::Into<crate::model::Example>,
5978        {
5979            self.0.request.example = v.map(|x| x.into());
5980            self
5981        }
5982
5983        /// Sets the value of [update_mask][crate::model::UpdateExampleRequest::update_mask].
5984        pub fn set_update_mask<T>(mut self, v: T) -> Self
5985        where
5986            T: std::convert::Into<wkt::FieldMask>,
5987        {
5988            self.0.request.update_mask = std::option::Option::Some(v.into());
5989            self
5990        }
5991
5992        /// Sets or clears the value of [update_mask][crate::model::UpdateExampleRequest::update_mask].
5993        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5994        where
5995            T: std::convert::Into<wkt::FieldMask>,
5996        {
5997            self.0.request.update_mask = v.map(|x| x.into());
5998            self
5999        }
6000    }
6001
6002    #[doc(hidden)]
6003    impl crate::RequestBuilder for UpdateExample {
6004        fn request_options(&mut self) -> &mut crate::RequestOptions {
6005            &mut self.0.options
6006        }
6007    }
6008
6009    /// The request builder for [Examples::list_locations][crate::client::Examples::list_locations] calls.
6010    ///
6011    /// # Example
6012    /// ```
6013    /// # use google_cloud_dialogflow_cx_v3::builder::examples::ListLocations;
6014    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6015    /// use google_cloud_gax::paginator::ItemPaginator;
6016    ///
6017    /// let builder = prepare_request_builder();
6018    /// let mut items = builder.by_item();
6019    /// while let Some(result) = items.next().await {
6020    ///   let item = result?;
6021    /// }
6022    /// # Ok(()) }
6023    ///
6024    /// fn prepare_request_builder() -> ListLocations {
6025    ///   # panic!();
6026    ///   // ... details omitted ...
6027    /// }
6028    /// ```
6029    #[derive(Clone, Debug)]
6030    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6031
6032    impl ListLocations {
6033        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6034            Self(RequestBuilder::new(stub))
6035        }
6036
6037        /// Sets the full request, replacing any prior values.
6038        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6039            mut self,
6040            v: V,
6041        ) -> Self {
6042            self.0.request = v.into();
6043            self
6044        }
6045
6046        /// Sets all the options, replacing any prior values.
6047        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6048            self.0.options = v.into();
6049            self
6050        }
6051
6052        /// Sends the request.
6053        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6054            (*self.0.stub)
6055                .list_locations(self.0.request, self.0.options)
6056                .await
6057                .map(crate::Response::into_body)
6058        }
6059
6060        /// Streams each page in the collection.
6061        pub fn by_page(
6062            self,
6063        ) -> impl google_cloud_gax::paginator::Paginator<
6064            google_cloud_location::model::ListLocationsResponse,
6065            crate::Error,
6066        > {
6067            use std::clone::Clone;
6068            let token = self.0.request.page_token.clone();
6069            let execute = move |token: String| {
6070                let mut builder = self.clone();
6071                builder.0.request = builder.0.request.set_page_token(token);
6072                builder.send()
6073            };
6074            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6075        }
6076
6077        /// Streams each item in the collection.
6078        pub fn by_item(
6079            self,
6080        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6081            google_cloud_location::model::ListLocationsResponse,
6082            crate::Error,
6083        > {
6084            use google_cloud_gax::paginator::Paginator;
6085            self.by_page().items()
6086        }
6087
6088        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6089        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6090            self.0.request.name = v.into();
6091            self
6092        }
6093
6094        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6095        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6096            self.0.request.filter = v.into();
6097            self
6098        }
6099
6100        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6101        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6102            self.0.request.page_size = v.into();
6103            self
6104        }
6105
6106        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6107        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6108            self.0.request.page_token = v.into();
6109            self
6110        }
6111    }
6112
6113    #[doc(hidden)]
6114    impl crate::RequestBuilder for ListLocations {
6115        fn request_options(&mut self) -> &mut crate::RequestOptions {
6116            &mut self.0.options
6117        }
6118    }
6119
6120    /// The request builder for [Examples::get_location][crate::client::Examples::get_location] calls.
6121    ///
6122    /// # Example
6123    /// ```
6124    /// # use google_cloud_dialogflow_cx_v3::builder::examples::GetLocation;
6125    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6126    ///
6127    /// let builder = prepare_request_builder();
6128    /// let response = builder.send().await?;
6129    /// # Ok(()) }
6130    ///
6131    /// fn prepare_request_builder() -> GetLocation {
6132    ///   # panic!();
6133    ///   // ... details omitted ...
6134    /// }
6135    /// ```
6136    #[derive(Clone, Debug)]
6137    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6138
6139    impl GetLocation {
6140        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6141            Self(RequestBuilder::new(stub))
6142        }
6143
6144        /// Sets the full request, replacing any prior values.
6145        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6146            mut self,
6147            v: V,
6148        ) -> Self {
6149            self.0.request = v.into();
6150            self
6151        }
6152
6153        /// Sets all the options, replacing any prior values.
6154        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6155            self.0.options = v.into();
6156            self
6157        }
6158
6159        /// Sends the request.
6160        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6161            (*self.0.stub)
6162                .get_location(self.0.request, self.0.options)
6163                .await
6164                .map(crate::Response::into_body)
6165        }
6166
6167        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6168        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6169            self.0.request.name = v.into();
6170            self
6171        }
6172    }
6173
6174    #[doc(hidden)]
6175    impl crate::RequestBuilder for GetLocation {
6176        fn request_options(&mut self) -> &mut crate::RequestOptions {
6177            &mut self.0.options
6178        }
6179    }
6180
6181    /// The request builder for [Examples::list_operations][crate::client::Examples::list_operations] calls.
6182    ///
6183    /// # Example
6184    /// ```
6185    /// # use google_cloud_dialogflow_cx_v3::builder::examples::ListOperations;
6186    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6187    /// use google_cloud_gax::paginator::ItemPaginator;
6188    ///
6189    /// let builder = prepare_request_builder();
6190    /// let mut items = builder.by_item();
6191    /// while let Some(result) = items.next().await {
6192    ///   let item = result?;
6193    /// }
6194    /// # Ok(()) }
6195    ///
6196    /// fn prepare_request_builder() -> ListOperations {
6197    ///   # panic!();
6198    ///   // ... details omitted ...
6199    /// }
6200    /// ```
6201    #[derive(Clone, Debug)]
6202    pub struct ListOperations(
6203        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6204    );
6205
6206    impl ListOperations {
6207        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6208            Self(RequestBuilder::new(stub))
6209        }
6210
6211        /// Sets the full request, replacing any prior values.
6212        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6213            mut self,
6214            v: V,
6215        ) -> Self {
6216            self.0.request = v.into();
6217            self
6218        }
6219
6220        /// Sets all the options, replacing any prior values.
6221        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6222            self.0.options = v.into();
6223            self
6224        }
6225
6226        /// Sends the request.
6227        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6228            (*self.0.stub)
6229                .list_operations(self.0.request, self.0.options)
6230                .await
6231                .map(crate::Response::into_body)
6232        }
6233
6234        /// Streams each page in the collection.
6235        pub fn by_page(
6236            self,
6237        ) -> impl google_cloud_gax::paginator::Paginator<
6238            google_cloud_longrunning::model::ListOperationsResponse,
6239            crate::Error,
6240        > {
6241            use std::clone::Clone;
6242            let token = self.0.request.page_token.clone();
6243            let execute = move |token: String| {
6244                let mut builder = self.clone();
6245                builder.0.request = builder.0.request.set_page_token(token);
6246                builder.send()
6247            };
6248            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6249        }
6250
6251        /// Streams each item in the collection.
6252        pub fn by_item(
6253            self,
6254        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6255            google_cloud_longrunning::model::ListOperationsResponse,
6256            crate::Error,
6257        > {
6258            use google_cloud_gax::paginator::Paginator;
6259            self.by_page().items()
6260        }
6261
6262        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6263        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6264            self.0.request.name = v.into();
6265            self
6266        }
6267
6268        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6269        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6270            self.0.request.filter = v.into();
6271            self
6272        }
6273
6274        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6275        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6276            self.0.request.page_size = v.into();
6277            self
6278        }
6279
6280        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6281        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6282            self.0.request.page_token = v.into();
6283            self
6284        }
6285
6286        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6287        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6288            self.0.request.return_partial_success = v.into();
6289            self
6290        }
6291    }
6292
6293    #[doc(hidden)]
6294    impl crate::RequestBuilder for ListOperations {
6295        fn request_options(&mut self) -> &mut crate::RequestOptions {
6296            &mut self.0.options
6297        }
6298    }
6299
6300    /// The request builder for [Examples::get_operation][crate::client::Examples::get_operation] calls.
6301    ///
6302    /// # Example
6303    /// ```
6304    /// # use google_cloud_dialogflow_cx_v3::builder::examples::GetOperation;
6305    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6306    ///
6307    /// let builder = prepare_request_builder();
6308    /// let response = builder.send().await?;
6309    /// # Ok(()) }
6310    ///
6311    /// fn prepare_request_builder() -> GetOperation {
6312    ///   # panic!();
6313    ///   // ... details omitted ...
6314    /// }
6315    /// ```
6316    #[derive(Clone, Debug)]
6317    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6318
6319    impl GetOperation {
6320        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6321            Self(RequestBuilder::new(stub))
6322        }
6323
6324        /// Sets the full request, replacing any prior values.
6325        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6326            mut self,
6327            v: V,
6328        ) -> Self {
6329            self.0.request = v.into();
6330            self
6331        }
6332
6333        /// Sets all the options, replacing any prior values.
6334        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6335            self.0.options = v.into();
6336            self
6337        }
6338
6339        /// Sends the request.
6340        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6341            (*self.0.stub)
6342                .get_operation(self.0.request, self.0.options)
6343                .await
6344                .map(crate::Response::into_body)
6345        }
6346
6347        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6348        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6349            self.0.request.name = v.into();
6350            self
6351        }
6352    }
6353
6354    #[doc(hidden)]
6355    impl crate::RequestBuilder for GetOperation {
6356        fn request_options(&mut self) -> &mut crate::RequestOptions {
6357            &mut self.0.options
6358        }
6359    }
6360
6361    /// The request builder for [Examples::cancel_operation][crate::client::Examples::cancel_operation] calls.
6362    ///
6363    /// # Example
6364    /// ```
6365    /// # use google_cloud_dialogflow_cx_v3::builder::examples::CancelOperation;
6366    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6367    ///
6368    /// let builder = prepare_request_builder();
6369    /// let response = builder.send().await?;
6370    /// # Ok(()) }
6371    ///
6372    /// fn prepare_request_builder() -> CancelOperation {
6373    ///   # panic!();
6374    ///   // ... details omitted ...
6375    /// }
6376    /// ```
6377    #[derive(Clone, Debug)]
6378    pub struct CancelOperation(
6379        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6380    );
6381
6382    impl CancelOperation {
6383        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6384            Self(RequestBuilder::new(stub))
6385        }
6386
6387        /// Sets the full request, replacing any prior values.
6388        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6389            mut self,
6390            v: V,
6391        ) -> Self {
6392            self.0.request = v.into();
6393            self
6394        }
6395
6396        /// Sets all the options, replacing any prior values.
6397        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6398            self.0.options = v.into();
6399            self
6400        }
6401
6402        /// Sends the request.
6403        pub async fn send(self) -> Result<()> {
6404            (*self.0.stub)
6405                .cancel_operation(self.0.request, self.0.options)
6406                .await
6407                .map(crate::Response::into_body)
6408        }
6409
6410        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
6411        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6412            self.0.request.name = v.into();
6413            self
6414        }
6415    }
6416
6417    #[doc(hidden)]
6418    impl crate::RequestBuilder for CancelOperation {
6419        fn request_options(&mut self) -> &mut crate::RequestOptions {
6420            &mut self.0.options
6421        }
6422    }
6423}
6424
6425/// Request and client builders for [Experiments][crate::client::Experiments].
6426#[cfg(feature = "experiments")]
6427#[cfg_attr(docsrs, doc(cfg(feature = "experiments")))]
6428pub mod experiments {
6429    use crate::Result;
6430
6431    /// A builder for [Experiments][crate::client::Experiments].
6432    ///
6433    /// ```
6434    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
6435    /// # use google_cloud_dialogflow_cx_v3::*;
6436    /// # use builder::experiments::ClientBuilder;
6437    /// # use client::Experiments;
6438    /// let builder : ClientBuilder = Experiments::builder();
6439    /// let client = builder
6440    ///     .with_endpoint("https://dialogflow.googleapis.com")
6441    ///     .build().await?;
6442    /// # Ok(()) }
6443    /// ```
6444    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6445
6446    pub(crate) mod client {
6447        use super::super::super::client::Experiments;
6448        pub struct Factory;
6449        impl crate::ClientFactory for Factory {
6450            type Client = Experiments;
6451            type Credentials = gaxi::options::Credentials;
6452            async fn build(
6453                self,
6454                config: gaxi::options::ClientConfig,
6455            ) -> crate::ClientBuilderResult<Self::Client> {
6456                Self::Client::new(config).await
6457            }
6458        }
6459    }
6460
6461    /// Common implementation for [crate::client::Experiments] request builders.
6462    #[derive(Clone, Debug)]
6463    pub(crate) struct RequestBuilder<R: std::default::Default> {
6464        stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6465        request: R,
6466        options: crate::RequestOptions,
6467    }
6468
6469    impl<R> RequestBuilder<R>
6470    where
6471        R: std::default::Default,
6472    {
6473        pub(crate) fn new(
6474            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6475        ) -> Self {
6476            Self {
6477                stub,
6478                request: R::default(),
6479                options: crate::RequestOptions::default(),
6480            }
6481        }
6482    }
6483
6484    /// The request builder for [Experiments::list_experiments][crate::client::Experiments::list_experiments] calls.
6485    ///
6486    /// # Example
6487    /// ```
6488    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::ListExperiments;
6489    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6490    /// use google_cloud_gax::paginator::ItemPaginator;
6491    ///
6492    /// let builder = prepare_request_builder();
6493    /// let mut items = builder.by_item();
6494    /// while let Some(result) = items.next().await {
6495    ///   let item = result?;
6496    /// }
6497    /// # Ok(()) }
6498    ///
6499    /// fn prepare_request_builder() -> ListExperiments {
6500    ///   # panic!();
6501    ///   // ... details omitted ...
6502    /// }
6503    /// ```
6504    #[derive(Clone, Debug)]
6505    pub struct ListExperiments(RequestBuilder<crate::model::ListExperimentsRequest>);
6506
6507    impl ListExperiments {
6508        pub(crate) fn new(
6509            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6510        ) -> Self {
6511            Self(RequestBuilder::new(stub))
6512        }
6513
6514        /// Sets the full request, replacing any prior values.
6515        pub fn with_request<V: Into<crate::model::ListExperimentsRequest>>(mut self, v: V) -> Self {
6516            self.0.request = v.into();
6517            self
6518        }
6519
6520        /// Sets all the options, replacing any prior values.
6521        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6522            self.0.options = v.into();
6523            self
6524        }
6525
6526        /// Sends the request.
6527        pub async fn send(self) -> Result<crate::model::ListExperimentsResponse> {
6528            (*self.0.stub)
6529                .list_experiments(self.0.request, self.0.options)
6530                .await
6531                .map(crate::Response::into_body)
6532        }
6533
6534        /// Streams each page in the collection.
6535        pub fn by_page(
6536            self,
6537        ) -> impl google_cloud_gax::paginator::Paginator<
6538            crate::model::ListExperimentsResponse,
6539            crate::Error,
6540        > {
6541            use std::clone::Clone;
6542            let token = self.0.request.page_token.clone();
6543            let execute = move |token: String| {
6544                let mut builder = self.clone();
6545                builder.0.request = builder.0.request.set_page_token(token);
6546                builder.send()
6547            };
6548            google_cloud_gax::paginator::internal::new_paginator(token, execute)
6549        }
6550
6551        /// Streams each item in the collection.
6552        pub fn by_item(
6553            self,
6554        ) -> impl google_cloud_gax::paginator::ItemPaginator<
6555            crate::model::ListExperimentsResponse,
6556            crate::Error,
6557        > {
6558            use google_cloud_gax::paginator::Paginator;
6559            self.by_page().items()
6560        }
6561
6562        /// Sets the value of [parent][crate::model::ListExperimentsRequest::parent].
6563        ///
6564        /// This is a **required** field for requests.
6565        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6566            self.0.request.parent = v.into();
6567            self
6568        }
6569
6570        /// Sets the value of [page_size][crate::model::ListExperimentsRequest::page_size].
6571        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6572            self.0.request.page_size = v.into();
6573            self
6574        }
6575
6576        /// Sets the value of [page_token][crate::model::ListExperimentsRequest::page_token].
6577        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6578            self.0.request.page_token = v.into();
6579            self
6580        }
6581    }
6582
6583    #[doc(hidden)]
6584    impl crate::RequestBuilder for ListExperiments {
6585        fn request_options(&mut self) -> &mut crate::RequestOptions {
6586            &mut self.0.options
6587        }
6588    }
6589
6590    /// The request builder for [Experiments::get_experiment][crate::client::Experiments::get_experiment] calls.
6591    ///
6592    /// # Example
6593    /// ```
6594    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::GetExperiment;
6595    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6596    ///
6597    /// let builder = prepare_request_builder();
6598    /// let response = builder.send().await?;
6599    /// # Ok(()) }
6600    ///
6601    /// fn prepare_request_builder() -> GetExperiment {
6602    ///   # panic!();
6603    ///   // ... details omitted ...
6604    /// }
6605    /// ```
6606    #[derive(Clone, Debug)]
6607    pub struct GetExperiment(RequestBuilder<crate::model::GetExperimentRequest>);
6608
6609    impl GetExperiment {
6610        pub(crate) fn new(
6611            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6612        ) -> Self {
6613            Self(RequestBuilder::new(stub))
6614        }
6615
6616        /// Sets the full request, replacing any prior values.
6617        pub fn with_request<V: Into<crate::model::GetExperimentRequest>>(mut self, v: V) -> Self {
6618            self.0.request = v.into();
6619            self
6620        }
6621
6622        /// Sets all the options, replacing any prior values.
6623        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6624            self.0.options = v.into();
6625            self
6626        }
6627
6628        /// Sends the request.
6629        pub async fn send(self) -> Result<crate::model::Experiment> {
6630            (*self.0.stub)
6631                .get_experiment(self.0.request, self.0.options)
6632                .await
6633                .map(crate::Response::into_body)
6634        }
6635
6636        /// Sets the value of [name][crate::model::GetExperimentRequest::name].
6637        ///
6638        /// This is a **required** field for requests.
6639        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6640            self.0.request.name = v.into();
6641            self
6642        }
6643    }
6644
6645    #[doc(hidden)]
6646    impl crate::RequestBuilder for GetExperiment {
6647        fn request_options(&mut self) -> &mut crate::RequestOptions {
6648            &mut self.0.options
6649        }
6650    }
6651
6652    /// The request builder for [Experiments::create_experiment][crate::client::Experiments::create_experiment] calls.
6653    ///
6654    /// # Example
6655    /// ```
6656    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::CreateExperiment;
6657    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6658    ///
6659    /// let builder = prepare_request_builder();
6660    /// let response = builder.send().await?;
6661    /// # Ok(()) }
6662    ///
6663    /// fn prepare_request_builder() -> CreateExperiment {
6664    ///   # panic!();
6665    ///   // ... details omitted ...
6666    /// }
6667    /// ```
6668    #[derive(Clone, Debug)]
6669    pub struct CreateExperiment(RequestBuilder<crate::model::CreateExperimentRequest>);
6670
6671    impl CreateExperiment {
6672        pub(crate) fn new(
6673            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6674        ) -> Self {
6675            Self(RequestBuilder::new(stub))
6676        }
6677
6678        /// Sets the full request, replacing any prior values.
6679        pub fn with_request<V: Into<crate::model::CreateExperimentRequest>>(
6680            mut self,
6681            v: V,
6682        ) -> Self {
6683            self.0.request = v.into();
6684            self
6685        }
6686
6687        /// Sets all the options, replacing any prior values.
6688        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6689            self.0.options = v.into();
6690            self
6691        }
6692
6693        /// Sends the request.
6694        pub async fn send(self) -> Result<crate::model::Experiment> {
6695            (*self.0.stub)
6696                .create_experiment(self.0.request, self.0.options)
6697                .await
6698                .map(crate::Response::into_body)
6699        }
6700
6701        /// Sets the value of [parent][crate::model::CreateExperimentRequest::parent].
6702        ///
6703        /// This is a **required** field for requests.
6704        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6705            self.0.request.parent = v.into();
6706            self
6707        }
6708
6709        /// Sets the value of [experiment][crate::model::CreateExperimentRequest::experiment].
6710        ///
6711        /// This is a **required** field for requests.
6712        pub fn set_experiment<T>(mut self, v: T) -> Self
6713        where
6714            T: std::convert::Into<crate::model::Experiment>,
6715        {
6716            self.0.request.experiment = std::option::Option::Some(v.into());
6717            self
6718        }
6719
6720        /// Sets or clears the value of [experiment][crate::model::CreateExperimentRequest::experiment].
6721        ///
6722        /// This is a **required** field for requests.
6723        pub fn set_or_clear_experiment<T>(mut self, v: std::option::Option<T>) -> Self
6724        where
6725            T: std::convert::Into<crate::model::Experiment>,
6726        {
6727            self.0.request.experiment = v.map(|x| x.into());
6728            self
6729        }
6730    }
6731
6732    #[doc(hidden)]
6733    impl crate::RequestBuilder for CreateExperiment {
6734        fn request_options(&mut self) -> &mut crate::RequestOptions {
6735            &mut self.0.options
6736        }
6737    }
6738
6739    /// The request builder for [Experiments::update_experiment][crate::client::Experiments::update_experiment] calls.
6740    ///
6741    /// # Example
6742    /// ```
6743    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::UpdateExperiment;
6744    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6745    ///
6746    /// let builder = prepare_request_builder();
6747    /// let response = builder.send().await?;
6748    /// # Ok(()) }
6749    ///
6750    /// fn prepare_request_builder() -> UpdateExperiment {
6751    ///   # panic!();
6752    ///   // ... details omitted ...
6753    /// }
6754    /// ```
6755    #[derive(Clone, Debug)]
6756    pub struct UpdateExperiment(RequestBuilder<crate::model::UpdateExperimentRequest>);
6757
6758    impl UpdateExperiment {
6759        pub(crate) fn new(
6760            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6761        ) -> Self {
6762            Self(RequestBuilder::new(stub))
6763        }
6764
6765        /// Sets the full request, replacing any prior values.
6766        pub fn with_request<V: Into<crate::model::UpdateExperimentRequest>>(
6767            mut self,
6768            v: V,
6769        ) -> Self {
6770            self.0.request = v.into();
6771            self
6772        }
6773
6774        /// Sets all the options, replacing any prior values.
6775        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6776            self.0.options = v.into();
6777            self
6778        }
6779
6780        /// Sends the request.
6781        pub async fn send(self) -> Result<crate::model::Experiment> {
6782            (*self.0.stub)
6783                .update_experiment(self.0.request, self.0.options)
6784                .await
6785                .map(crate::Response::into_body)
6786        }
6787
6788        /// Sets the value of [experiment][crate::model::UpdateExperimentRequest::experiment].
6789        ///
6790        /// This is a **required** field for requests.
6791        pub fn set_experiment<T>(mut self, v: T) -> Self
6792        where
6793            T: std::convert::Into<crate::model::Experiment>,
6794        {
6795            self.0.request.experiment = std::option::Option::Some(v.into());
6796            self
6797        }
6798
6799        /// Sets or clears the value of [experiment][crate::model::UpdateExperimentRequest::experiment].
6800        ///
6801        /// This is a **required** field for requests.
6802        pub fn set_or_clear_experiment<T>(mut self, v: std::option::Option<T>) -> Self
6803        where
6804            T: std::convert::Into<crate::model::Experiment>,
6805        {
6806            self.0.request.experiment = v.map(|x| x.into());
6807            self
6808        }
6809
6810        /// Sets the value of [update_mask][crate::model::UpdateExperimentRequest::update_mask].
6811        ///
6812        /// This is a **required** field for requests.
6813        pub fn set_update_mask<T>(mut self, v: T) -> Self
6814        where
6815            T: std::convert::Into<wkt::FieldMask>,
6816        {
6817            self.0.request.update_mask = std::option::Option::Some(v.into());
6818            self
6819        }
6820
6821        /// Sets or clears the value of [update_mask][crate::model::UpdateExperimentRequest::update_mask].
6822        ///
6823        /// This is a **required** field for requests.
6824        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6825        where
6826            T: std::convert::Into<wkt::FieldMask>,
6827        {
6828            self.0.request.update_mask = v.map(|x| x.into());
6829            self
6830        }
6831    }
6832
6833    #[doc(hidden)]
6834    impl crate::RequestBuilder for UpdateExperiment {
6835        fn request_options(&mut self) -> &mut crate::RequestOptions {
6836            &mut self.0.options
6837        }
6838    }
6839
6840    /// The request builder for [Experiments::delete_experiment][crate::client::Experiments::delete_experiment] calls.
6841    ///
6842    /// # Example
6843    /// ```
6844    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::DeleteExperiment;
6845    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6846    ///
6847    /// let builder = prepare_request_builder();
6848    /// let response = builder.send().await?;
6849    /// # Ok(()) }
6850    ///
6851    /// fn prepare_request_builder() -> DeleteExperiment {
6852    ///   # panic!();
6853    ///   // ... details omitted ...
6854    /// }
6855    /// ```
6856    #[derive(Clone, Debug)]
6857    pub struct DeleteExperiment(RequestBuilder<crate::model::DeleteExperimentRequest>);
6858
6859    impl DeleteExperiment {
6860        pub(crate) fn new(
6861            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6862        ) -> Self {
6863            Self(RequestBuilder::new(stub))
6864        }
6865
6866        /// Sets the full request, replacing any prior values.
6867        pub fn with_request<V: Into<crate::model::DeleteExperimentRequest>>(
6868            mut self,
6869            v: V,
6870        ) -> Self {
6871            self.0.request = v.into();
6872            self
6873        }
6874
6875        /// Sets all the options, replacing any prior values.
6876        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6877            self.0.options = v.into();
6878            self
6879        }
6880
6881        /// Sends the request.
6882        pub async fn send(self) -> Result<()> {
6883            (*self.0.stub)
6884                .delete_experiment(self.0.request, self.0.options)
6885                .await
6886                .map(crate::Response::into_body)
6887        }
6888
6889        /// Sets the value of [name][crate::model::DeleteExperimentRequest::name].
6890        ///
6891        /// This is a **required** field for requests.
6892        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6893            self.0.request.name = v.into();
6894            self
6895        }
6896    }
6897
6898    #[doc(hidden)]
6899    impl crate::RequestBuilder for DeleteExperiment {
6900        fn request_options(&mut self) -> &mut crate::RequestOptions {
6901            &mut self.0.options
6902        }
6903    }
6904
6905    /// The request builder for [Experiments::start_experiment][crate::client::Experiments::start_experiment] calls.
6906    ///
6907    /// # Example
6908    /// ```
6909    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::StartExperiment;
6910    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6911    ///
6912    /// let builder = prepare_request_builder();
6913    /// let response = builder.send().await?;
6914    /// # Ok(()) }
6915    ///
6916    /// fn prepare_request_builder() -> StartExperiment {
6917    ///   # panic!();
6918    ///   // ... details omitted ...
6919    /// }
6920    /// ```
6921    #[derive(Clone, Debug)]
6922    pub struct StartExperiment(RequestBuilder<crate::model::StartExperimentRequest>);
6923
6924    impl StartExperiment {
6925        pub(crate) fn new(
6926            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6927        ) -> Self {
6928            Self(RequestBuilder::new(stub))
6929        }
6930
6931        /// Sets the full request, replacing any prior values.
6932        pub fn with_request<V: Into<crate::model::StartExperimentRequest>>(mut self, v: V) -> Self {
6933            self.0.request = v.into();
6934            self
6935        }
6936
6937        /// Sets all the options, replacing any prior values.
6938        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6939            self.0.options = v.into();
6940            self
6941        }
6942
6943        /// Sends the request.
6944        pub async fn send(self) -> Result<crate::model::Experiment> {
6945            (*self.0.stub)
6946                .start_experiment(self.0.request, self.0.options)
6947                .await
6948                .map(crate::Response::into_body)
6949        }
6950
6951        /// Sets the value of [name][crate::model::StartExperimentRequest::name].
6952        ///
6953        /// This is a **required** field for requests.
6954        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6955            self.0.request.name = v.into();
6956            self
6957        }
6958    }
6959
6960    #[doc(hidden)]
6961    impl crate::RequestBuilder for StartExperiment {
6962        fn request_options(&mut self) -> &mut crate::RequestOptions {
6963            &mut self.0.options
6964        }
6965    }
6966
6967    /// The request builder for [Experiments::stop_experiment][crate::client::Experiments::stop_experiment] calls.
6968    ///
6969    /// # Example
6970    /// ```
6971    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::StopExperiment;
6972    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
6973    ///
6974    /// let builder = prepare_request_builder();
6975    /// let response = builder.send().await?;
6976    /// # Ok(()) }
6977    ///
6978    /// fn prepare_request_builder() -> StopExperiment {
6979    ///   # panic!();
6980    ///   // ... details omitted ...
6981    /// }
6982    /// ```
6983    #[derive(Clone, Debug)]
6984    pub struct StopExperiment(RequestBuilder<crate::model::StopExperimentRequest>);
6985
6986    impl StopExperiment {
6987        pub(crate) fn new(
6988            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6989        ) -> Self {
6990            Self(RequestBuilder::new(stub))
6991        }
6992
6993        /// Sets the full request, replacing any prior values.
6994        pub fn with_request<V: Into<crate::model::StopExperimentRequest>>(mut self, v: V) -> Self {
6995            self.0.request = v.into();
6996            self
6997        }
6998
6999        /// Sets all the options, replacing any prior values.
7000        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7001            self.0.options = v.into();
7002            self
7003        }
7004
7005        /// Sends the request.
7006        pub async fn send(self) -> Result<crate::model::Experiment> {
7007            (*self.0.stub)
7008                .stop_experiment(self.0.request, self.0.options)
7009                .await
7010                .map(crate::Response::into_body)
7011        }
7012
7013        /// Sets the value of [name][crate::model::StopExperimentRequest::name].
7014        ///
7015        /// This is a **required** field for requests.
7016        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7017            self.0.request.name = v.into();
7018            self
7019        }
7020    }
7021
7022    #[doc(hidden)]
7023    impl crate::RequestBuilder for StopExperiment {
7024        fn request_options(&mut self) -> &mut crate::RequestOptions {
7025            &mut self.0.options
7026        }
7027    }
7028
7029    /// The request builder for [Experiments::list_locations][crate::client::Experiments::list_locations] calls.
7030    ///
7031    /// # Example
7032    /// ```
7033    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::ListLocations;
7034    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7035    /// use google_cloud_gax::paginator::ItemPaginator;
7036    ///
7037    /// let builder = prepare_request_builder();
7038    /// let mut items = builder.by_item();
7039    /// while let Some(result) = items.next().await {
7040    ///   let item = result?;
7041    /// }
7042    /// # Ok(()) }
7043    ///
7044    /// fn prepare_request_builder() -> ListLocations {
7045    ///   # panic!();
7046    ///   // ... details omitted ...
7047    /// }
7048    /// ```
7049    #[derive(Clone, Debug)]
7050    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7051
7052    impl ListLocations {
7053        pub(crate) fn new(
7054            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7055        ) -> Self {
7056            Self(RequestBuilder::new(stub))
7057        }
7058
7059        /// Sets the full request, replacing any prior values.
7060        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7061            mut self,
7062            v: V,
7063        ) -> Self {
7064            self.0.request = v.into();
7065            self
7066        }
7067
7068        /// Sets all the options, replacing any prior values.
7069        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7070            self.0.options = v.into();
7071            self
7072        }
7073
7074        /// Sends the request.
7075        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7076            (*self.0.stub)
7077                .list_locations(self.0.request, self.0.options)
7078                .await
7079                .map(crate::Response::into_body)
7080        }
7081
7082        /// Streams each page in the collection.
7083        pub fn by_page(
7084            self,
7085        ) -> impl google_cloud_gax::paginator::Paginator<
7086            google_cloud_location::model::ListLocationsResponse,
7087            crate::Error,
7088        > {
7089            use std::clone::Clone;
7090            let token = self.0.request.page_token.clone();
7091            let execute = move |token: String| {
7092                let mut builder = self.clone();
7093                builder.0.request = builder.0.request.set_page_token(token);
7094                builder.send()
7095            };
7096            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7097        }
7098
7099        /// Streams each item in the collection.
7100        pub fn by_item(
7101            self,
7102        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7103            google_cloud_location::model::ListLocationsResponse,
7104            crate::Error,
7105        > {
7106            use google_cloud_gax::paginator::Paginator;
7107            self.by_page().items()
7108        }
7109
7110        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
7111        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7112            self.0.request.name = v.into();
7113            self
7114        }
7115
7116        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
7117        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7118            self.0.request.filter = v.into();
7119            self
7120        }
7121
7122        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
7123        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7124            self.0.request.page_size = v.into();
7125            self
7126        }
7127
7128        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
7129        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7130            self.0.request.page_token = v.into();
7131            self
7132        }
7133    }
7134
7135    #[doc(hidden)]
7136    impl crate::RequestBuilder for ListLocations {
7137        fn request_options(&mut self) -> &mut crate::RequestOptions {
7138            &mut self.0.options
7139        }
7140    }
7141
7142    /// The request builder for [Experiments::get_location][crate::client::Experiments::get_location] calls.
7143    ///
7144    /// # Example
7145    /// ```
7146    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::GetLocation;
7147    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7148    ///
7149    /// let builder = prepare_request_builder();
7150    /// let response = builder.send().await?;
7151    /// # Ok(()) }
7152    ///
7153    /// fn prepare_request_builder() -> GetLocation {
7154    ///   # panic!();
7155    ///   // ... details omitted ...
7156    /// }
7157    /// ```
7158    #[derive(Clone, Debug)]
7159    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7160
7161    impl GetLocation {
7162        pub(crate) fn new(
7163            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7164        ) -> Self {
7165            Self(RequestBuilder::new(stub))
7166        }
7167
7168        /// Sets the full request, replacing any prior values.
7169        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7170            mut self,
7171            v: V,
7172        ) -> Self {
7173            self.0.request = v.into();
7174            self
7175        }
7176
7177        /// Sets all the options, replacing any prior values.
7178        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7179            self.0.options = v.into();
7180            self
7181        }
7182
7183        /// Sends the request.
7184        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7185            (*self.0.stub)
7186                .get_location(self.0.request, self.0.options)
7187                .await
7188                .map(crate::Response::into_body)
7189        }
7190
7191        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
7192        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7193            self.0.request.name = v.into();
7194            self
7195        }
7196    }
7197
7198    #[doc(hidden)]
7199    impl crate::RequestBuilder for GetLocation {
7200        fn request_options(&mut self) -> &mut crate::RequestOptions {
7201            &mut self.0.options
7202        }
7203    }
7204
7205    /// The request builder for [Experiments::list_operations][crate::client::Experiments::list_operations] calls.
7206    ///
7207    /// # Example
7208    /// ```
7209    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::ListOperations;
7210    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7211    /// use google_cloud_gax::paginator::ItemPaginator;
7212    ///
7213    /// let builder = prepare_request_builder();
7214    /// let mut items = builder.by_item();
7215    /// while let Some(result) = items.next().await {
7216    ///   let item = result?;
7217    /// }
7218    /// # Ok(()) }
7219    ///
7220    /// fn prepare_request_builder() -> ListOperations {
7221    ///   # panic!();
7222    ///   // ... details omitted ...
7223    /// }
7224    /// ```
7225    #[derive(Clone, Debug)]
7226    pub struct ListOperations(
7227        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7228    );
7229
7230    impl ListOperations {
7231        pub(crate) fn new(
7232            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7233        ) -> Self {
7234            Self(RequestBuilder::new(stub))
7235        }
7236
7237        /// Sets the full request, replacing any prior values.
7238        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7239            mut self,
7240            v: V,
7241        ) -> Self {
7242            self.0.request = v.into();
7243            self
7244        }
7245
7246        /// Sets all the options, replacing any prior values.
7247        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7248            self.0.options = v.into();
7249            self
7250        }
7251
7252        /// Sends the request.
7253        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7254            (*self.0.stub)
7255                .list_operations(self.0.request, self.0.options)
7256                .await
7257                .map(crate::Response::into_body)
7258        }
7259
7260        /// Streams each page in the collection.
7261        pub fn by_page(
7262            self,
7263        ) -> impl google_cloud_gax::paginator::Paginator<
7264            google_cloud_longrunning::model::ListOperationsResponse,
7265            crate::Error,
7266        > {
7267            use std::clone::Clone;
7268            let token = self.0.request.page_token.clone();
7269            let execute = move |token: String| {
7270                let mut builder = self.clone();
7271                builder.0.request = builder.0.request.set_page_token(token);
7272                builder.send()
7273            };
7274            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7275        }
7276
7277        /// Streams each item in the collection.
7278        pub fn by_item(
7279            self,
7280        ) -> impl google_cloud_gax::paginator::ItemPaginator<
7281            google_cloud_longrunning::model::ListOperationsResponse,
7282            crate::Error,
7283        > {
7284            use google_cloud_gax::paginator::Paginator;
7285            self.by_page().items()
7286        }
7287
7288        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
7289        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7290            self.0.request.name = v.into();
7291            self
7292        }
7293
7294        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
7295        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7296            self.0.request.filter = v.into();
7297            self
7298        }
7299
7300        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
7301        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7302            self.0.request.page_size = v.into();
7303            self
7304        }
7305
7306        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
7307        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7308            self.0.request.page_token = v.into();
7309            self
7310        }
7311
7312        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
7313        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7314            self.0.request.return_partial_success = v.into();
7315            self
7316        }
7317    }
7318
7319    #[doc(hidden)]
7320    impl crate::RequestBuilder for ListOperations {
7321        fn request_options(&mut self) -> &mut crate::RequestOptions {
7322            &mut self.0.options
7323        }
7324    }
7325
7326    /// The request builder for [Experiments::get_operation][crate::client::Experiments::get_operation] calls.
7327    ///
7328    /// # Example
7329    /// ```
7330    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::GetOperation;
7331    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7332    ///
7333    /// let builder = prepare_request_builder();
7334    /// let response = builder.send().await?;
7335    /// # Ok(()) }
7336    ///
7337    /// fn prepare_request_builder() -> GetOperation {
7338    ///   # panic!();
7339    ///   // ... details omitted ...
7340    /// }
7341    /// ```
7342    #[derive(Clone, Debug)]
7343    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7344
7345    impl GetOperation {
7346        pub(crate) fn new(
7347            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7348        ) -> Self {
7349            Self(RequestBuilder::new(stub))
7350        }
7351
7352        /// Sets the full request, replacing any prior values.
7353        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7354            mut self,
7355            v: V,
7356        ) -> Self {
7357            self.0.request = v.into();
7358            self
7359        }
7360
7361        /// Sets all the options, replacing any prior values.
7362        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7363            self.0.options = v.into();
7364            self
7365        }
7366
7367        /// Sends the request.
7368        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7369            (*self.0.stub)
7370                .get_operation(self.0.request, self.0.options)
7371                .await
7372                .map(crate::Response::into_body)
7373        }
7374
7375        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
7376        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7377            self.0.request.name = v.into();
7378            self
7379        }
7380    }
7381
7382    #[doc(hidden)]
7383    impl crate::RequestBuilder for GetOperation {
7384        fn request_options(&mut self) -> &mut crate::RequestOptions {
7385            &mut self.0.options
7386        }
7387    }
7388
7389    /// The request builder for [Experiments::cancel_operation][crate::client::Experiments::cancel_operation] calls.
7390    ///
7391    /// # Example
7392    /// ```
7393    /// # use google_cloud_dialogflow_cx_v3::builder::experiments::CancelOperation;
7394    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7395    ///
7396    /// let builder = prepare_request_builder();
7397    /// let response = builder.send().await?;
7398    /// # Ok(()) }
7399    ///
7400    /// fn prepare_request_builder() -> CancelOperation {
7401    ///   # panic!();
7402    ///   // ... details omitted ...
7403    /// }
7404    /// ```
7405    #[derive(Clone, Debug)]
7406    pub struct CancelOperation(
7407        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7408    );
7409
7410    impl CancelOperation {
7411        pub(crate) fn new(
7412            stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
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<google_cloud_longrunning::model::CancelOperationRequest>>(
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<crate::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<()> {
7434            (*self.0.stub)
7435                .cancel_operation(self.0.request, self.0.options)
7436                .await
7437                .map(crate::Response::into_body)
7438        }
7439
7440        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
7441        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7442            self.0.request.name = v.into();
7443            self
7444        }
7445    }
7446
7447    #[doc(hidden)]
7448    impl crate::RequestBuilder for CancelOperation {
7449        fn request_options(&mut self) -> &mut crate::RequestOptions {
7450            &mut self.0.options
7451        }
7452    }
7453}
7454
7455/// Request and client builders for [Flows][crate::client::Flows].
7456#[cfg(feature = "flows")]
7457#[cfg_attr(docsrs, doc(cfg(feature = "flows")))]
7458pub mod flows {
7459    use crate::Result;
7460
7461    /// A builder for [Flows][crate::client::Flows].
7462    ///
7463    /// ```
7464    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
7465    /// # use google_cloud_dialogflow_cx_v3::*;
7466    /// # use builder::flows::ClientBuilder;
7467    /// # use client::Flows;
7468    /// let builder : ClientBuilder = Flows::builder();
7469    /// let client = builder
7470    ///     .with_endpoint("https://dialogflow.googleapis.com")
7471    ///     .build().await?;
7472    /// # Ok(()) }
7473    /// ```
7474    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7475
7476    pub(crate) mod client {
7477        use super::super::super::client::Flows;
7478        pub struct Factory;
7479        impl crate::ClientFactory for Factory {
7480            type Client = Flows;
7481            type Credentials = gaxi::options::Credentials;
7482            async fn build(
7483                self,
7484                config: gaxi::options::ClientConfig,
7485            ) -> crate::ClientBuilderResult<Self::Client> {
7486                Self::Client::new(config).await
7487            }
7488        }
7489    }
7490
7491    /// Common implementation for [crate::client::Flows] request builders.
7492    #[derive(Clone, Debug)]
7493    pub(crate) struct RequestBuilder<R: std::default::Default> {
7494        stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>,
7495        request: R,
7496        options: crate::RequestOptions,
7497    }
7498
7499    impl<R> RequestBuilder<R>
7500    where
7501        R: std::default::Default,
7502    {
7503        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7504            Self {
7505                stub,
7506                request: R::default(),
7507                options: crate::RequestOptions::default(),
7508            }
7509        }
7510    }
7511
7512    /// The request builder for [Flows::create_flow][crate::client::Flows::create_flow] calls.
7513    ///
7514    /// # Example
7515    /// ```
7516    /// # use google_cloud_dialogflow_cx_v3::builder::flows::CreateFlow;
7517    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7518    ///
7519    /// let builder = prepare_request_builder();
7520    /// let response = builder.send().await?;
7521    /// # Ok(()) }
7522    ///
7523    /// fn prepare_request_builder() -> CreateFlow {
7524    ///   # panic!();
7525    ///   // ... details omitted ...
7526    /// }
7527    /// ```
7528    #[derive(Clone, Debug)]
7529    pub struct CreateFlow(RequestBuilder<crate::model::CreateFlowRequest>);
7530
7531    impl CreateFlow {
7532        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7533            Self(RequestBuilder::new(stub))
7534        }
7535
7536        /// Sets the full request, replacing any prior values.
7537        pub fn with_request<V: Into<crate::model::CreateFlowRequest>>(mut self, v: V) -> Self {
7538            self.0.request = v.into();
7539            self
7540        }
7541
7542        /// Sets all the options, replacing any prior values.
7543        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7544            self.0.options = v.into();
7545            self
7546        }
7547
7548        /// Sends the request.
7549        pub async fn send(self) -> Result<crate::model::Flow> {
7550            (*self.0.stub)
7551                .create_flow(self.0.request, self.0.options)
7552                .await
7553                .map(crate::Response::into_body)
7554        }
7555
7556        /// Sets the value of [parent][crate::model::CreateFlowRequest::parent].
7557        ///
7558        /// This is a **required** field for requests.
7559        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7560            self.0.request.parent = v.into();
7561            self
7562        }
7563
7564        /// Sets the value of [flow][crate::model::CreateFlowRequest::flow].
7565        ///
7566        /// This is a **required** field for requests.
7567        pub fn set_flow<T>(mut self, v: T) -> Self
7568        where
7569            T: std::convert::Into<crate::model::Flow>,
7570        {
7571            self.0.request.flow = std::option::Option::Some(v.into());
7572            self
7573        }
7574
7575        /// Sets or clears the value of [flow][crate::model::CreateFlowRequest::flow].
7576        ///
7577        /// This is a **required** field for requests.
7578        pub fn set_or_clear_flow<T>(mut self, v: std::option::Option<T>) -> Self
7579        where
7580            T: std::convert::Into<crate::model::Flow>,
7581        {
7582            self.0.request.flow = v.map(|x| x.into());
7583            self
7584        }
7585
7586        /// Sets the value of [language_code][crate::model::CreateFlowRequest::language_code].
7587        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7588            self.0.request.language_code = v.into();
7589            self
7590        }
7591    }
7592
7593    #[doc(hidden)]
7594    impl crate::RequestBuilder for CreateFlow {
7595        fn request_options(&mut self) -> &mut crate::RequestOptions {
7596            &mut self.0.options
7597        }
7598    }
7599
7600    /// The request builder for [Flows::delete_flow][crate::client::Flows::delete_flow] calls.
7601    ///
7602    /// # Example
7603    /// ```
7604    /// # use google_cloud_dialogflow_cx_v3::builder::flows::DeleteFlow;
7605    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7606    ///
7607    /// let builder = prepare_request_builder();
7608    /// let response = builder.send().await?;
7609    /// # Ok(()) }
7610    ///
7611    /// fn prepare_request_builder() -> DeleteFlow {
7612    ///   # panic!();
7613    ///   // ... details omitted ...
7614    /// }
7615    /// ```
7616    #[derive(Clone, Debug)]
7617    pub struct DeleteFlow(RequestBuilder<crate::model::DeleteFlowRequest>);
7618
7619    impl DeleteFlow {
7620        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7621            Self(RequestBuilder::new(stub))
7622        }
7623
7624        /// Sets the full request, replacing any prior values.
7625        pub fn with_request<V: Into<crate::model::DeleteFlowRequest>>(mut self, v: V) -> Self {
7626            self.0.request = v.into();
7627            self
7628        }
7629
7630        /// Sets all the options, replacing any prior values.
7631        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7632            self.0.options = v.into();
7633            self
7634        }
7635
7636        /// Sends the request.
7637        pub async fn send(self) -> Result<()> {
7638            (*self.0.stub)
7639                .delete_flow(self.0.request, self.0.options)
7640                .await
7641                .map(crate::Response::into_body)
7642        }
7643
7644        /// Sets the value of [name][crate::model::DeleteFlowRequest::name].
7645        ///
7646        /// This is a **required** field for requests.
7647        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7648            self.0.request.name = v.into();
7649            self
7650        }
7651
7652        /// Sets the value of [force][crate::model::DeleteFlowRequest::force].
7653        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
7654            self.0.request.force = v.into();
7655            self
7656        }
7657    }
7658
7659    #[doc(hidden)]
7660    impl crate::RequestBuilder for DeleteFlow {
7661        fn request_options(&mut self) -> &mut crate::RequestOptions {
7662            &mut self.0.options
7663        }
7664    }
7665
7666    /// The request builder for [Flows::list_flows][crate::client::Flows::list_flows] calls.
7667    ///
7668    /// # Example
7669    /// ```
7670    /// # use google_cloud_dialogflow_cx_v3::builder::flows::ListFlows;
7671    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7672    /// use google_cloud_gax::paginator::ItemPaginator;
7673    ///
7674    /// let builder = prepare_request_builder();
7675    /// let mut items = builder.by_item();
7676    /// while let Some(result) = items.next().await {
7677    ///   let item = result?;
7678    /// }
7679    /// # Ok(()) }
7680    ///
7681    /// fn prepare_request_builder() -> ListFlows {
7682    ///   # panic!();
7683    ///   // ... details omitted ...
7684    /// }
7685    /// ```
7686    #[derive(Clone, Debug)]
7687    pub struct ListFlows(RequestBuilder<crate::model::ListFlowsRequest>);
7688
7689    impl ListFlows {
7690        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7691            Self(RequestBuilder::new(stub))
7692        }
7693
7694        /// Sets the full request, replacing any prior values.
7695        pub fn with_request<V: Into<crate::model::ListFlowsRequest>>(mut self, v: V) -> Self {
7696            self.0.request = v.into();
7697            self
7698        }
7699
7700        /// Sets all the options, replacing any prior values.
7701        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7702            self.0.options = v.into();
7703            self
7704        }
7705
7706        /// Sends the request.
7707        pub async fn send(self) -> Result<crate::model::ListFlowsResponse> {
7708            (*self.0.stub)
7709                .list_flows(self.0.request, self.0.options)
7710                .await
7711                .map(crate::Response::into_body)
7712        }
7713
7714        /// Streams each page in the collection.
7715        pub fn by_page(
7716            self,
7717        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFlowsResponse, crate::Error>
7718        {
7719            use std::clone::Clone;
7720            let token = self.0.request.page_token.clone();
7721            let execute = move |token: String| {
7722                let mut builder = self.clone();
7723                builder.0.request = builder.0.request.set_page_token(token);
7724                builder.send()
7725            };
7726            google_cloud_gax::paginator::internal::new_paginator(token, execute)
7727        }
7728
7729        /// Streams each item in the collection.
7730        pub fn by_item(
7731            self,
7732        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListFlowsResponse, crate::Error>
7733        {
7734            use google_cloud_gax::paginator::Paginator;
7735            self.by_page().items()
7736        }
7737
7738        /// Sets the value of [parent][crate::model::ListFlowsRequest::parent].
7739        ///
7740        /// This is a **required** field for requests.
7741        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7742            self.0.request.parent = v.into();
7743            self
7744        }
7745
7746        /// Sets the value of [page_size][crate::model::ListFlowsRequest::page_size].
7747        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7748            self.0.request.page_size = v.into();
7749            self
7750        }
7751
7752        /// Sets the value of [page_token][crate::model::ListFlowsRequest::page_token].
7753        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7754            self.0.request.page_token = v.into();
7755            self
7756        }
7757
7758        /// Sets the value of [language_code][crate::model::ListFlowsRequest::language_code].
7759        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7760            self.0.request.language_code = v.into();
7761            self
7762        }
7763    }
7764
7765    #[doc(hidden)]
7766    impl crate::RequestBuilder for ListFlows {
7767        fn request_options(&mut self) -> &mut crate::RequestOptions {
7768            &mut self.0.options
7769        }
7770    }
7771
7772    /// The request builder for [Flows::get_flow][crate::client::Flows::get_flow] calls.
7773    ///
7774    /// # Example
7775    /// ```
7776    /// # use google_cloud_dialogflow_cx_v3::builder::flows::GetFlow;
7777    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7778    ///
7779    /// let builder = prepare_request_builder();
7780    /// let response = builder.send().await?;
7781    /// # Ok(()) }
7782    ///
7783    /// fn prepare_request_builder() -> GetFlow {
7784    ///   # panic!();
7785    ///   // ... details omitted ...
7786    /// }
7787    /// ```
7788    #[derive(Clone, Debug)]
7789    pub struct GetFlow(RequestBuilder<crate::model::GetFlowRequest>);
7790
7791    impl GetFlow {
7792        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7793            Self(RequestBuilder::new(stub))
7794        }
7795
7796        /// Sets the full request, replacing any prior values.
7797        pub fn with_request<V: Into<crate::model::GetFlowRequest>>(mut self, v: V) -> Self {
7798            self.0.request = v.into();
7799            self
7800        }
7801
7802        /// Sets all the options, replacing any prior values.
7803        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7804            self.0.options = v.into();
7805            self
7806        }
7807
7808        /// Sends the request.
7809        pub async fn send(self) -> Result<crate::model::Flow> {
7810            (*self.0.stub)
7811                .get_flow(self.0.request, self.0.options)
7812                .await
7813                .map(crate::Response::into_body)
7814        }
7815
7816        /// Sets the value of [name][crate::model::GetFlowRequest::name].
7817        ///
7818        /// This is a **required** field for requests.
7819        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7820            self.0.request.name = v.into();
7821            self
7822        }
7823
7824        /// Sets the value of [language_code][crate::model::GetFlowRequest::language_code].
7825        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7826            self.0.request.language_code = v.into();
7827            self
7828        }
7829    }
7830
7831    #[doc(hidden)]
7832    impl crate::RequestBuilder for GetFlow {
7833        fn request_options(&mut self) -> &mut crate::RequestOptions {
7834            &mut self.0.options
7835        }
7836    }
7837
7838    /// The request builder for [Flows::update_flow][crate::client::Flows::update_flow] calls.
7839    ///
7840    /// # Example
7841    /// ```
7842    /// # use google_cloud_dialogflow_cx_v3::builder::flows::UpdateFlow;
7843    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7844    ///
7845    /// let builder = prepare_request_builder();
7846    /// let response = builder.send().await?;
7847    /// # Ok(()) }
7848    ///
7849    /// fn prepare_request_builder() -> UpdateFlow {
7850    ///   # panic!();
7851    ///   // ... details omitted ...
7852    /// }
7853    /// ```
7854    #[derive(Clone, Debug)]
7855    pub struct UpdateFlow(RequestBuilder<crate::model::UpdateFlowRequest>);
7856
7857    impl UpdateFlow {
7858        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7859            Self(RequestBuilder::new(stub))
7860        }
7861
7862        /// Sets the full request, replacing any prior values.
7863        pub fn with_request<V: Into<crate::model::UpdateFlowRequest>>(mut self, v: V) -> Self {
7864            self.0.request = v.into();
7865            self
7866        }
7867
7868        /// Sets all the options, replacing any prior values.
7869        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7870            self.0.options = v.into();
7871            self
7872        }
7873
7874        /// Sends the request.
7875        pub async fn send(self) -> Result<crate::model::Flow> {
7876            (*self.0.stub)
7877                .update_flow(self.0.request, self.0.options)
7878                .await
7879                .map(crate::Response::into_body)
7880        }
7881
7882        /// Sets the value of [flow][crate::model::UpdateFlowRequest::flow].
7883        ///
7884        /// This is a **required** field for requests.
7885        pub fn set_flow<T>(mut self, v: T) -> Self
7886        where
7887            T: std::convert::Into<crate::model::Flow>,
7888        {
7889            self.0.request.flow = std::option::Option::Some(v.into());
7890            self
7891        }
7892
7893        /// Sets or clears the value of [flow][crate::model::UpdateFlowRequest::flow].
7894        ///
7895        /// This is a **required** field for requests.
7896        pub fn set_or_clear_flow<T>(mut self, v: std::option::Option<T>) -> Self
7897        where
7898            T: std::convert::Into<crate::model::Flow>,
7899        {
7900            self.0.request.flow = v.map(|x| x.into());
7901            self
7902        }
7903
7904        /// Sets the value of [update_mask][crate::model::UpdateFlowRequest::update_mask].
7905        pub fn set_update_mask<T>(mut self, v: T) -> Self
7906        where
7907            T: std::convert::Into<wkt::FieldMask>,
7908        {
7909            self.0.request.update_mask = std::option::Option::Some(v.into());
7910            self
7911        }
7912
7913        /// Sets or clears the value of [update_mask][crate::model::UpdateFlowRequest::update_mask].
7914        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7915        where
7916            T: std::convert::Into<wkt::FieldMask>,
7917        {
7918            self.0.request.update_mask = v.map(|x| x.into());
7919            self
7920        }
7921
7922        /// Sets the value of [language_code][crate::model::UpdateFlowRequest::language_code].
7923        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7924            self.0.request.language_code = v.into();
7925            self
7926        }
7927    }
7928
7929    #[doc(hidden)]
7930    impl crate::RequestBuilder for UpdateFlow {
7931        fn request_options(&mut self) -> &mut crate::RequestOptions {
7932            &mut self.0.options
7933        }
7934    }
7935
7936    /// The request builder for [Flows::train_flow][crate::client::Flows::train_flow] calls.
7937    ///
7938    /// # Example
7939    /// ```
7940    /// # use google_cloud_dialogflow_cx_v3::builder::flows::TrainFlow;
7941    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
7942    /// use google_cloud_lro::Poller;
7943    ///
7944    /// let builder = prepare_request_builder();
7945    /// let response = builder.poller().until_done().await?;
7946    /// # Ok(()) }
7947    ///
7948    /// fn prepare_request_builder() -> TrainFlow {
7949    ///   # panic!();
7950    ///   // ... details omitted ...
7951    /// }
7952    /// ```
7953    #[derive(Clone, Debug)]
7954    pub struct TrainFlow(RequestBuilder<crate::model::TrainFlowRequest>);
7955
7956    impl TrainFlow {
7957        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7958            Self(RequestBuilder::new(stub))
7959        }
7960
7961        /// Sets the full request, replacing any prior values.
7962        pub fn with_request<V: Into<crate::model::TrainFlowRequest>>(mut self, v: V) -> Self {
7963            self.0.request = v.into();
7964            self
7965        }
7966
7967        /// Sets all the options, replacing any prior values.
7968        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7969            self.0.options = v.into();
7970            self
7971        }
7972
7973        /// Sends the request.
7974        ///
7975        /// # Long running operations
7976        ///
7977        /// This starts, but does not poll, a longrunning operation. More information
7978        /// on [train_flow][crate::client::Flows::train_flow].
7979        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7980            (*self.0.stub)
7981                .train_flow(self.0.request, self.0.options)
7982                .await
7983                .map(crate::Response::into_body)
7984        }
7985
7986        /// Creates a [Poller][google_cloud_lro::Poller] to work with `train_flow`.
7987        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
7988            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
7989            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7990            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7991
7992            let stub = self.0.stub.clone();
7993            let mut options = self.0.options.clone();
7994            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7995            let query = move |name| {
7996                let stub = stub.clone();
7997                let options = options.clone();
7998                async {
7999                    let op = GetOperation::new(stub)
8000                        .set_name(name)
8001                        .with_options(options)
8002                        .send()
8003                        .await?;
8004                    Ok(Operation::new(op))
8005                }
8006            };
8007
8008            let start = move || async {
8009                let op = self.send().await?;
8010                Ok(Operation::new(op))
8011            };
8012
8013            google_cloud_lro::internal::new_unit_response_poller(
8014                polling_error_policy,
8015                polling_backoff_policy,
8016                start,
8017                query,
8018            )
8019        }
8020
8021        /// Sets the value of [name][crate::model::TrainFlowRequest::name].
8022        ///
8023        /// This is a **required** field for requests.
8024        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8025            self.0.request.name = v.into();
8026            self
8027        }
8028    }
8029
8030    #[doc(hidden)]
8031    impl crate::RequestBuilder for TrainFlow {
8032        fn request_options(&mut self) -> &mut crate::RequestOptions {
8033            &mut self.0.options
8034        }
8035    }
8036
8037    /// The request builder for [Flows::validate_flow][crate::client::Flows::validate_flow] calls.
8038    ///
8039    /// # Example
8040    /// ```
8041    /// # use google_cloud_dialogflow_cx_v3::builder::flows::ValidateFlow;
8042    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8043    ///
8044    /// let builder = prepare_request_builder();
8045    /// let response = builder.send().await?;
8046    /// # Ok(()) }
8047    ///
8048    /// fn prepare_request_builder() -> ValidateFlow {
8049    ///   # panic!();
8050    ///   // ... details omitted ...
8051    /// }
8052    /// ```
8053    #[derive(Clone, Debug)]
8054    pub struct ValidateFlow(RequestBuilder<crate::model::ValidateFlowRequest>);
8055
8056    impl ValidateFlow {
8057        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8058            Self(RequestBuilder::new(stub))
8059        }
8060
8061        /// Sets the full request, replacing any prior values.
8062        pub fn with_request<V: Into<crate::model::ValidateFlowRequest>>(mut self, v: V) -> Self {
8063            self.0.request = v.into();
8064            self
8065        }
8066
8067        /// Sets all the options, replacing any prior values.
8068        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8069            self.0.options = v.into();
8070            self
8071        }
8072
8073        /// Sends the request.
8074        pub async fn send(self) -> Result<crate::model::FlowValidationResult> {
8075            (*self.0.stub)
8076                .validate_flow(self.0.request, self.0.options)
8077                .await
8078                .map(crate::Response::into_body)
8079        }
8080
8081        /// Sets the value of [name][crate::model::ValidateFlowRequest::name].
8082        ///
8083        /// This is a **required** field for requests.
8084        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8085            self.0.request.name = v.into();
8086            self
8087        }
8088
8089        /// Sets the value of [language_code][crate::model::ValidateFlowRequest::language_code].
8090        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
8091            self.0.request.language_code = v.into();
8092            self
8093        }
8094    }
8095
8096    #[doc(hidden)]
8097    impl crate::RequestBuilder for ValidateFlow {
8098        fn request_options(&mut self) -> &mut crate::RequestOptions {
8099            &mut self.0.options
8100        }
8101    }
8102
8103    /// The request builder for [Flows::get_flow_validation_result][crate::client::Flows::get_flow_validation_result] calls.
8104    ///
8105    /// # Example
8106    /// ```
8107    /// # use google_cloud_dialogflow_cx_v3::builder::flows::GetFlowValidationResult;
8108    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8109    ///
8110    /// let builder = prepare_request_builder();
8111    /// let response = builder.send().await?;
8112    /// # Ok(()) }
8113    ///
8114    /// fn prepare_request_builder() -> GetFlowValidationResult {
8115    ///   # panic!();
8116    ///   // ... details omitted ...
8117    /// }
8118    /// ```
8119    #[derive(Clone, Debug)]
8120    pub struct GetFlowValidationResult(
8121        RequestBuilder<crate::model::GetFlowValidationResultRequest>,
8122    );
8123
8124    impl GetFlowValidationResult {
8125        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8126            Self(RequestBuilder::new(stub))
8127        }
8128
8129        /// Sets the full request, replacing any prior values.
8130        pub fn with_request<V: Into<crate::model::GetFlowValidationResultRequest>>(
8131            mut self,
8132            v: V,
8133        ) -> Self {
8134            self.0.request = v.into();
8135            self
8136        }
8137
8138        /// Sets all the options, replacing any prior values.
8139        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8140            self.0.options = v.into();
8141            self
8142        }
8143
8144        /// Sends the request.
8145        pub async fn send(self) -> Result<crate::model::FlowValidationResult> {
8146            (*self.0.stub)
8147                .get_flow_validation_result(self.0.request, self.0.options)
8148                .await
8149                .map(crate::Response::into_body)
8150        }
8151
8152        /// Sets the value of [name][crate::model::GetFlowValidationResultRequest::name].
8153        ///
8154        /// This is a **required** field for requests.
8155        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8156            self.0.request.name = v.into();
8157            self
8158        }
8159
8160        /// Sets the value of [language_code][crate::model::GetFlowValidationResultRequest::language_code].
8161        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
8162            self.0.request.language_code = v.into();
8163            self
8164        }
8165    }
8166
8167    #[doc(hidden)]
8168    impl crate::RequestBuilder for GetFlowValidationResult {
8169        fn request_options(&mut self) -> &mut crate::RequestOptions {
8170            &mut self.0.options
8171        }
8172    }
8173
8174    /// The request builder for [Flows::import_flow][crate::client::Flows::import_flow] calls.
8175    ///
8176    /// # Example
8177    /// ```
8178    /// # use google_cloud_dialogflow_cx_v3::builder::flows::ImportFlow;
8179    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8180    /// use google_cloud_lro::Poller;
8181    ///
8182    /// let builder = prepare_request_builder();
8183    /// let response = builder.poller().until_done().await?;
8184    /// # Ok(()) }
8185    ///
8186    /// fn prepare_request_builder() -> ImportFlow {
8187    ///   # panic!();
8188    ///   // ... details omitted ...
8189    /// }
8190    /// ```
8191    #[derive(Clone, Debug)]
8192    pub struct ImportFlow(RequestBuilder<crate::model::ImportFlowRequest>);
8193
8194    impl ImportFlow {
8195        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8196            Self(RequestBuilder::new(stub))
8197        }
8198
8199        /// Sets the full request, replacing any prior values.
8200        pub fn with_request<V: Into<crate::model::ImportFlowRequest>>(mut self, v: V) -> Self {
8201            self.0.request = v.into();
8202            self
8203        }
8204
8205        /// Sets all the options, replacing any prior values.
8206        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8207            self.0.options = v.into();
8208            self
8209        }
8210
8211        /// Sends the request.
8212        ///
8213        /// # Long running operations
8214        ///
8215        /// This starts, but does not poll, a longrunning operation. More information
8216        /// on [import_flow][crate::client::Flows::import_flow].
8217        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8218            (*self.0.stub)
8219                .import_flow(self.0.request, self.0.options)
8220                .await
8221                .map(crate::Response::into_body)
8222        }
8223
8224        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_flow`.
8225        pub fn poller(
8226            self,
8227        ) -> impl google_cloud_lro::Poller<crate::model::ImportFlowResponse, wkt::Struct> {
8228            type Operation = google_cloud_lro::internal::Operation<
8229                crate::model::ImportFlowResponse,
8230                wkt::Struct,
8231            >;
8232            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8233            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8234
8235            let stub = self.0.stub.clone();
8236            let mut options = self.0.options.clone();
8237            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8238            let query = move |name| {
8239                let stub = stub.clone();
8240                let options = options.clone();
8241                async {
8242                    let op = GetOperation::new(stub)
8243                        .set_name(name)
8244                        .with_options(options)
8245                        .send()
8246                        .await?;
8247                    Ok(Operation::new(op))
8248                }
8249            };
8250
8251            let start = move || async {
8252                let op = self.send().await?;
8253                Ok(Operation::new(op))
8254            };
8255
8256            google_cloud_lro::internal::new_poller(
8257                polling_error_policy,
8258                polling_backoff_policy,
8259                start,
8260                query,
8261            )
8262        }
8263
8264        /// Sets the value of [parent][crate::model::ImportFlowRequest::parent].
8265        ///
8266        /// This is a **required** field for requests.
8267        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8268            self.0.request.parent = v.into();
8269            self
8270        }
8271
8272        /// Sets the value of [import_option][crate::model::ImportFlowRequest::import_option].
8273        pub fn set_import_option<T: Into<crate::model::import_flow_request::ImportOption>>(
8274            mut self,
8275            v: T,
8276        ) -> Self {
8277            self.0.request.import_option = v.into();
8278            self
8279        }
8280
8281        /// Sets the value of [flow_import_strategy][crate::model::ImportFlowRequest::flow_import_strategy].
8282        pub fn set_flow_import_strategy<T>(mut self, v: T) -> Self
8283        where
8284            T: std::convert::Into<crate::model::FlowImportStrategy>,
8285        {
8286            self.0.request.flow_import_strategy = std::option::Option::Some(v.into());
8287            self
8288        }
8289
8290        /// Sets or clears the value of [flow_import_strategy][crate::model::ImportFlowRequest::flow_import_strategy].
8291        pub fn set_or_clear_flow_import_strategy<T>(mut self, v: std::option::Option<T>) -> Self
8292        where
8293            T: std::convert::Into<crate::model::FlowImportStrategy>,
8294        {
8295            self.0.request.flow_import_strategy = v.map(|x| x.into());
8296            self
8297        }
8298
8299        /// Sets the value of [flow][crate::model::ImportFlowRequest::flow].
8300        ///
8301        /// Note that all the setters affecting `flow` are
8302        /// mutually exclusive.
8303        pub fn set_flow<T: Into<Option<crate::model::import_flow_request::Flow>>>(
8304            mut self,
8305            v: T,
8306        ) -> Self {
8307            self.0.request.flow = v.into();
8308            self
8309        }
8310
8311        /// Sets the value of [flow][crate::model::ImportFlowRequest::flow]
8312        /// to hold a `FlowUri`.
8313        ///
8314        /// Note that all the setters affecting `flow` are
8315        /// mutually exclusive.
8316        pub fn set_flow_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8317            self.0.request = self.0.request.set_flow_uri(v);
8318            self
8319        }
8320
8321        /// Sets the value of [flow][crate::model::ImportFlowRequest::flow]
8322        /// to hold a `FlowContent`.
8323        ///
8324        /// Note that all the setters affecting `flow` are
8325        /// mutually exclusive.
8326        pub fn set_flow_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
8327            self.0.request = self.0.request.set_flow_content(v);
8328            self
8329        }
8330    }
8331
8332    #[doc(hidden)]
8333    impl crate::RequestBuilder for ImportFlow {
8334        fn request_options(&mut self) -> &mut crate::RequestOptions {
8335            &mut self.0.options
8336        }
8337    }
8338
8339    /// The request builder for [Flows::export_flow][crate::client::Flows::export_flow] calls.
8340    ///
8341    /// # Example
8342    /// ```
8343    /// # use google_cloud_dialogflow_cx_v3::builder::flows::ExportFlow;
8344    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8345    /// use google_cloud_lro::Poller;
8346    ///
8347    /// let builder = prepare_request_builder();
8348    /// let response = builder.poller().until_done().await?;
8349    /// # Ok(()) }
8350    ///
8351    /// fn prepare_request_builder() -> ExportFlow {
8352    ///   # panic!();
8353    ///   // ... details omitted ...
8354    /// }
8355    /// ```
8356    #[derive(Clone, Debug)]
8357    pub struct ExportFlow(RequestBuilder<crate::model::ExportFlowRequest>);
8358
8359    impl ExportFlow {
8360        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8361            Self(RequestBuilder::new(stub))
8362        }
8363
8364        /// Sets the full request, replacing any prior values.
8365        pub fn with_request<V: Into<crate::model::ExportFlowRequest>>(mut self, v: V) -> Self {
8366            self.0.request = v.into();
8367            self
8368        }
8369
8370        /// Sets all the options, replacing any prior values.
8371        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8372            self.0.options = v.into();
8373            self
8374        }
8375
8376        /// Sends the request.
8377        ///
8378        /// # Long running operations
8379        ///
8380        /// This starts, but does not poll, a longrunning operation. More information
8381        /// on [export_flow][crate::client::Flows::export_flow].
8382        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8383            (*self.0.stub)
8384                .export_flow(self.0.request, self.0.options)
8385                .await
8386                .map(crate::Response::into_body)
8387        }
8388
8389        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_flow`.
8390        pub fn poller(
8391            self,
8392        ) -> impl google_cloud_lro::Poller<crate::model::ExportFlowResponse, wkt::Struct> {
8393            type Operation = google_cloud_lro::internal::Operation<
8394                crate::model::ExportFlowResponse,
8395                wkt::Struct,
8396            >;
8397            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8398            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8399
8400            let stub = self.0.stub.clone();
8401            let mut options = self.0.options.clone();
8402            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8403            let query = move |name| {
8404                let stub = stub.clone();
8405                let options = options.clone();
8406                async {
8407                    let op = GetOperation::new(stub)
8408                        .set_name(name)
8409                        .with_options(options)
8410                        .send()
8411                        .await?;
8412                    Ok(Operation::new(op))
8413                }
8414            };
8415
8416            let start = move || async {
8417                let op = self.send().await?;
8418                Ok(Operation::new(op))
8419            };
8420
8421            google_cloud_lro::internal::new_poller(
8422                polling_error_policy,
8423                polling_backoff_policy,
8424                start,
8425                query,
8426            )
8427        }
8428
8429        /// Sets the value of [name][crate::model::ExportFlowRequest::name].
8430        ///
8431        /// This is a **required** field for requests.
8432        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8433            self.0.request.name = v.into();
8434            self
8435        }
8436
8437        /// Sets the value of [flow_uri][crate::model::ExportFlowRequest::flow_uri].
8438        pub fn set_flow_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
8439            self.0.request.flow_uri = v.into();
8440            self
8441        }
8442
8443        /// Sets the value of [include_referenced_flows][crate::model::ExportFlowRequest::include_referenced_flows].
8444        pub fn set_include_referenced_flows<T: Into<bool>>(mut self, v: T) -> Self {
8445            self.0.request.include_referenced_flows = v.into();
8446            self
8447        }
8448    }
8449
8450    #[doc(hidden)]
8451    impl crate::RequestBuilder for ExportFlow {
8452        fn request_options(&mut self) -> &mut crate::RequestOptions {
8453            &mut self.0.options
8454        }
8455    }
8456
8457    /// The request builder for [Flows::list_locations][crate::client::Flows::list_locations] calls.
8458    ///
8459    /// # Example
8460    /// ```
8461    /// # use google_cloud_dialogflow_cx_v3::builder::flows::ListLocations;
8462    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8463    /// use google_cloud_gax::paginator::ItemPaginator;
8464    ///
8465    /// let builder = prepare_request_builder();
8466    /// let mut items = builder.by_item();
8467    /// while let Some(result) = items.next().await {
8468    ///   let item = result?;
8469    /// }
8470    /// # Ok(()) }
8471    ///
8472    /// fn prepare_request_builder() -> ListLocations {
8473    ///   # panic!();
8474    ///   // ... details omitted ...
8475    /// }
8476    /// ```
8477    #[derive(Clone, Debug)]
8478    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8479
8480    impl ListLocations {
8481        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8482            Self(RequestBuilder::new(stub))
8483        }
8484
8485        /// Sets the full request, replacing any prior values.
8486        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8487            mut self,
8488            v: V,
8489        ) -> Self {
8490            self.0.request = v.into();
8491            self
8492        }
8493
8494        /// Sets all the options, replacing any prior values.
8495        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8496            self.0.options = v.into();
8497            self
8498        }
8499
8500        /// Sends the request.
8501        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8502            (*self.0.stub)
8503                .list_locations(self.0.request, self.0.options)
8504                .await
8505                .map(crate::Response::into_body)
8506        }
8507
8508        /// Streams each page in the collection.
8509        pub fn by_page(
8510            self,
8511        ) -> impl google_cloud_gax::paginator::Paginator<
8512            google_cloud_location::model::ListLocationsResponse,
8513            crate::Error,
8514        > {
8515            use std::clone::Clone;
8516            let token = self.0.request.page_token.clone();
8517            let execute = move |token: String| {
8518                let mut builder = self.clone();
8519                builder.0.request = builder.0.request.set_page_token(token);
8520                builder.send()
8521            };
8522            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8523        }
8524
8525        /// Streams each item in the collection.
8526        pub fn by_item(
8527            self,
8528        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8529            google_cloud_location::model::ListLocationsResponse,
8530            crate::Error,
8531        > {
8532            use google_cloud_gax::paginator::Paginator;
8533            self.by_page().items()
8534        }
8535
8536        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
8537        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8538            self.0.request.name = v.into();
8539            self
8540        }
8541
8542        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
8543        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8544            self.0.request.filter = v.into();
8545            self
8546        }
8547
8548        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
8549        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8550            self.0.request.page_size = v.into();
8551            self
8552        }
8553
8554        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
8555        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8556            self.0.request.page_token = v.into();
8557            self
8558        }
8559    }
8560
8561    #[doc(hidden)]
8562    impl crate::RequestBuilder for ListLocations {
8563        fn request_options(&mut self) -> &mut crate::RequestOptions {
8564            &mut self.0.options
8565        }
8566    }
8567
8568    /// The request builder for [Flows::get_location][crate::client::Flows::get_location] calls.
8569    ///
8570    /// # Example
8571    /// ```
8572    /// # use google_cloud_dialogflow_cx_v3::builder::flows::GetLocation;
8573    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8574    ///
8575    /// let builder = prepare_request_builder();
8576    /// let response = builder.send().await?;
8577    /// # Ok(()) }
8578    ///
8579    /// fn prepare_request_builder() -> GetLocation {
8580    ///   # panic!();
8581    ///   // ... details omitted ...
8582    /// }
8583    /// ```
8584    #[derive(Clone, Debug)]
8585    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8586
8587    impl GetLocation {
8588        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8589            Self(RequestBuilder::new(stub))
8590        }
8591
8592        /// Sets the full request, replacing any prior values.
8593        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8594            mut self,
8595            v: V,
8596        ) -> Self {
8597            self.0.request = v.into();
8598            self
8599        }
8600
8601        /// Sets all the options, replacing any prior values.
8602        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8603            self.0.options = v.into();
8604            self
8605        }
8606
8607        /// Sends the request.
8608        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8609            (*self.0.stub)
8610                .get_location(self.0.request, self.0.options)
8611                .await
8612                .map(crate::Response::into_body)
8613        }
8614
8615        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
8616        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8617            self.0.request.name = v.into();
8618            self
8619        }
8620    }
8621
8622    #[doc(hidden)]
8623    impl crate::RequestBuilder for GetLocation {
8624        fn request_options(&mut self) -> &mut crate::RequestOptions {
8625            &mut self.0.options
8626        }
8627    }
8628
8629    /// The request builder for [Flows::list_operations][crate::client::Flows::list_operations] calls.
8630    ///
8631    /// # Example
8632    /// ```
8633    /// # use google_cloud_dialogflow_cx_v3::builder::flows::ListOperations;
8634    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8635    /// use google_cloud_gax::paginator::ItemPaginator;
8636    ///
8637    /// let builder = prepare_request_builder();
8638    /// let mut items = builder.by_item();
8639    /// while let Some(result) = items.next().await {
8640    ///   let item = result?;
8641    /// }
8642    /// # Ok(()) }
8643    ///
8644    /// fn prepare_request_builder() -> ListOperations {
8645    ///   # panic!();
8646    ///   // ... details omitted ...
8647    /// }
8648    /// ```
8649    #[derive(Clone, Debug)]
8650    pub struct ListOperations(
8651        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8652    );
8653
8654    impl ListOperations {
8655        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8656            Self(RequestBuilder::new(stub))
8657        }
8658
8659        /// Sets the full request, replacing any prior values.
8660        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8661            mut self,
8662            v: V,
8663        ) -> Self {
8664            self.0.request = v.into();
8665            self
8666        }
8667
8668        /// Sets all the options, replacing any prior values.
8669        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8670            self.0.options = v.into();
8671            self
8672        }
8673
8674        /// Sends the request.
8675        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8676            (*self.0.stub)
8677                .list_operations(self.0.request, self.0.options)
8678                .await
8679                .map(crate::Response::into_body)
8680        }
8681
8682        /// Streams each page in the collection.
8683        pub fn by_page(
8684            self,
8685        ) -> impl google_cloud_gax::paginator::Paginator<
8686            google_cloud_longrunning::model::ListOperationsResponse,
8687            crate::Error,
8688        > {
8689            use std::clone::Clone;
8690            let token = self.0.request.page_token.clone();
8691            let execute = move |token: String| {
8692                let mut builder = self.clone();
8693                builder.0.request = builder.0.request.set_page_token(token);
8694                builder.send()
8695            };
8696            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8697        }
8698
8699        /// Streams each item in the collection.
8700        pub fn by_item(
8701            self,
8702        ) -> impl google_cloud_gax::paginator::ItemPaginator<
8703            google_cloud_longrunning::model::ListOperationsResponse,
8704            crate::Error,
8705        > {
8706            use google_cloud_gax::paginator::Paginator;
8707            self.by_page().items()
8708        }
8709
8710        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
8711        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712            self.0.request.name = v.into();
8713            self
8714        }
8715
8716        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
8717        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8718            self.0.request.filter = v.into();
8719            self
8720        }
8721
8722        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
8723        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8724            self.0.request.page_size = v.into();
8725            self
8726        }
8727
8728        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
8729        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8730            self.0.request.page_token = v.into();
8731            self
8732        }
8733
8734        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
8735        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8736            self.0.request.return_partial_success = v.into();
8737            self
8738        }
8739    }
8740
8741    #[doc(hidden)]
8742    impl crate::RequestBuilder for ListOperations {
8743        fn request_options(&mut self) -> &mut crate::RequestOptions {
8744            &mut self.0.options
8745        }
8746    }
8747
8748    /// The request builder for [Flows::get_operation][crate::client::Flows::get_operation] calls.
8749    ///
8750    /// # Example
8751    /// ```
8752    /// # use google_cloud_dialogflow_cx_v3::builder::flows::GetOperation;
8753    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8754    ///
8755    /// let builder = prepare_request_builder();
8756    /// let response = builder.send().await?;
8757    /// # Ok(()) }
8758    ///
8759    /// fn prepare_request_builder() -> GetOperation {
8760    ///   # panic!();
8761    ///   // ... details omitted ...
8762    /// }
8763    /// ```
8764    #[derive(Clone, Debug)]
8765    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8766
8767    impl GetOperation {
8768        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8769            Self(RequestBuilder::new(stub))
8770        }
8771
8772        /// Sets the full request, replacing any prior values.
8773        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8774            mut self,
8775            v: V,
8776        ) -> Self {
8777            self.0.request = v.into();
8778            self
8779        }
8780
8781        /// Sets all the options, replacing any prior values.
8782        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8783            self.0.options = v.into();
8784            self
8785        }
8786
8787        /// Sends the request.
8788        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8789            (*self.0.stub)
8790                .get_operation(self.0.request, self.0.options)
8791                .await
8792                .map(crate::Response::into_body)
8793        }
8794
8795        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
8796        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8797            self.0.request.name = v.into();
8798            self
8799        }
8800    }
8801
8802    #[doc(hidden)]
8803    impl crate::RequestBuilder for GetOperation {
8804        fn request_options(&mut self) -> &mut crate::RequestOptions {
8805            &mut self.0.options
8806        }
8807    }
8808
8809    /// The request builder for [Flows::cancel_operation][crate::client::Flows::cancel_operation] calls.
8810    ///
8811    /// # Example
8812    /// ```
8813    /// # use google_cloud_dialogflow_cx_v3::builder::flows::CancelOperation;
8814    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8815    ///
8816    /// let builder = prepare_request_builder();
8817    /// let response = builder.send().await?;
8818    /// # Ok(()) }
8819    ///
8820    /// fn prepare_request_builder() -> CancelOperation {
8821    ///   # panic!();
8822    ///   // ... details omitted ...
8823    /// }
8824    /// ```
8825    #[derive(Clone, Debug)]
8826    pub struct CancelOperation(
8827        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8828    );
8829
8830    impl CancelOperation {
8831        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8832            Self(RequestBuilder::new(stub))
8833        }
8834
8835        /// Sets the full request, replacing any prior values.
8836        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8837            mut self,
8838            v: V,
8839        ) -> Self {
8840            self.0.request = v.into();
8841            self
8842        }
8843
8844        /// Sets all the options, replacing any prior values.
8845        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8846            self.0.options = v.into();
8847            self
8848        }
8849
8850        /// Sends the request.
8851        pub async fn send(self) -> Result<()> {
8852            (*self.0.stub)
8853                .cancel_operation(self.0.request, self.0.options)
8854                .await
8855                .map(crate::Response::into_body)
8856        }
8857
8858        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
8859        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8860            self.0.request.name = v.into();
8861            self
8862        }
8863    }
8864
8865    #[doc(hidden)]
8866    impl crate::RequestBuilder for CancelOperation {
8867        fn request_options(&mut self) -> &mut crate::RequestOptions {
8868            &mut self.0.options
8869        }
8870    }
8871}
8872
8873/// Request and client builders for [Generators][crate::client::Generators].
8874#[cfg(feature = "generators")]
8875#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
8876pub mod generators {
8877    use crate::Result;
8878
8879    /// A builder for [Generators][crate::client::Generators].
8880    ///
8881    /// ```
8882    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
8883    /// # use google_cloud_dialogflow_cx_v3::*;
8884    /// # use builder::generators::ClientBuilder;
8885    /// # use client::Generators;
8886    /// let builder : ClientBuilder = Generators::builder();
8887    /// let client = builder
8888    ///     .with_endpoint("https://dialogflow.googleapis.com")
8889    ///     .build().await?;
8890    /// # Ok(()) }
8891    /// ```
8892    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8893
8894    pub(crate) mod client {
8895        use super::super::super::client::Generators;
8896        pub struct Factory;
8897        impl crate::ClientFactory for Factory {
8898            type Client = Generators;
8899            type Credentials = gaxi::options::Credentials;
8900            async fn build(
8901                self,
8902                config: gaxi::options::ClientConfig,
8903            ) -> crate::ClientBuilderResult<Self::Client> {
8904                Self::Client::new(config).await
8905            }
8906        }
8907    }
8908
8909    /// Common implementation for [crate::client::Generators] request builders.
8910    #[derive(Clone, Debug)]
8911    pub(crate) struct RequestBuilder<R: std::default::Default> {
8912        stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
8913        request: R,
8914        options: crate::RequestOptions,
8915    }
8916
8917    impl<R> RequestBuilder<R>
8918    where
8919        R: std::default::Default,
8920    {
8921        pub(crate) fn new(
8922            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
8923        ) -> Self {
8924            Self {
8925                stub,
8926                request: R::default(),
8927                options: crate::RequestOptions::default(),
8928            }
8929        }
8930    }
8931
8932    /// The request builder for [Generators::list_generators][crate::client::Generators::list_generators] calls.
8933    ///
8934    /// # Example
8935    /// ```
8936    /// # use google_cloud_dialogflow_cx_v3::builder::generators::ListGenerators;
8937    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
8938    /// use google_cloud_gax::paginator::ItemPaginator;
8939    ///
8940    /// let builder = prepare_request_builder();
8941    /// let mut items = builder.by_item();
8942    /// while let Some(result) = items.next().await {
8943    ///   let item = result?;
8944    /// }
8945    /// # Ok(()) }
8946    ///
8947    /// fn prepare_request_builder() -> ListGenerators {
8948    ///   # panic!();
8949    ///   // ... details omitted ...
8950    /// }
8951    /// ```
8952    #[derive(Clone, Debug)]
8953    pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
8954
8955    impl ListGenerators {
8956        pub(crate) fn new(
8957            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
8958        ) -> Self {
8959            Self(RequestBuilder::new(stub))
8960        }
8961
8962        /// Sets the full request, replacing any prior values.
8963        pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
8964            self.0.request = v.into();
8965            self
8966        }
8967
8968        /// Sets all the options, replacing any prior values.
8969        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8970            self.0.options = v.into();
8971            self
8972        }
8973
8974        /// Sends the request.
8975        pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
8976            (*self.0.stub)
8977                .list_generators(self.0.request, self.0.options)
8978                .await
8979                .map(crate::Response::into_body)
8980        }
8981
8982        /// Streams each page in the collection.
8983        pub fn by_page(
8984            self,
8985        ) -> impl google_cloud_gax::paginator::Paginator<
8986            crate::model::ListGeneratorsResponse,
8987            crate::Error,
8988        > {
8989            use std::clone::Clone;
8990            let token = self.0.request.page_token.clone();
8991            let execute = move |token: String| {
8992                let mut builder = self.clone();
8993                builder.0.request = builder.0.request.set_page_token(token);
8994                builder.send()
8995            };
8996            google_cloud_gax::paginator::internal::new_paginator(token, execute)
8997        }
8998
8999        /// Streams each item in the collection.
9000        pub fn by_item(
9001            self,
9002        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9003            crate::model::ListGeneratorsResponse,
9004            crate::Error,
9005        > {
9006            use google_cloud_gax::paginator::Paginator;
9007            self.by_page().items()
9008        }
9009
9010        /// Sets the value of [parent][crate::model::ListGeneratorsRequest::parent].
9011        ///
9012        /// This is a **required** field for requests.
9013        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9014            self.0.request.parent = v.into();
9015            self
9016        }
9017
9018        /// Sets the value of [language_code][crate::model::ListGeneratorsRequest::language_code].
9019        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9020            self.0.request.language_code = v.into();
9021            self
9022        }
9023
9024        /// Sets the value of [page_size][crate::model::ListGeneratorsRequest::page_size].
9025        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9026            self.0.request.page_size = v.into();
9027            self
9028        }
9029
9030        /// Sets the value of [page_token][crate::model::ListGeneratorsRequest::page_token].
9031        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9032            self.0.request.page_token = v.into();
9033            self
9034        }
9035    }
9036
9037    #[doc(hidden)]
9038    impl crate::RequestBuilder for ListGenerators {
9039        fn request_options(&mut self) -> &mut crate::RequestOptions {
9040            &mut self.0.options
9041        }
9042    }
9043
9044    /// The request builder for [Generators::get_generator][crate::client::Generators::get_generator] calls.
9045    ///
9046    /// # Example
9047    /// ```
9048    /// # use google_cloud_dialogflow_cx_v3::builder::generators::GetGenerator;
9049    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9050    ///
9051    /// let builder = prepare_request_builder();
9052    /// let response = builder.send().await?;
9053    /// # Ok(()) }
9054    ///
9055    /// fn prepare_request_builder() -> GetGenerator {
9056    ///   # panic!();
9057    ///   // ... details omitted ...
9058    /// }
9059    /// ```
9060    #[derive(Clone, Debug)]
9061    pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
9062
9063    impl GetGenerator {
9064        pub(crate) fn new(
9065            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9066        ) -> Self {
9067            Self(RequestBuilder::new(stub))
9068        }
9069
9070        /// Sets the full request, replacing any prior values.
9071        pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
9072            self.0.request = v.into();
9073            self
9074        }
9075
9076        /// Sets all the options, replacing any prior values.
9077        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9078            self.0.options = v.into();
9079            self
9080        }
9081
9082        /// Sends the request.
9083        pub async fn send(self) -> Result<crate::model::Generator> {
9084            (*self.0.stub)
9085                .get_generator(self.0.request, self.0.options)
9086                .await
9087                .map(crate::Response::into_body)
9088        }
9089
9090        /// Sets the value of [name][crate::model::GetGeneratorRequest::name].
9091        ///
9092        /// This is a **required** field for requests.
9093        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9094            self.0.request.name = v.into();
9095            self
9096        }
9097
9098        /// Sets the value of [language_code][crate::model::GetGeneratorRequest::language_code].
9099        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9100            self.0.request.language_code = v.into();
9101            self
9102        }
9103    }
9104
9105    #[doc(hidden)]
9106    impl crate::RequestBuilder for GetGenerator {
9107        fn request_options(&mut self) -> &mut crate::RequestOptions {
9108            &mut self.0.options
9109        }
9110    }
9111
9112    /// The request builder for [Generators::create_generator][crate::client::Generators::create_generator] calls.
9113    ///
9114    /// # Example
9115    /// ```
9116    /// # use google_cloud_dialogflow_cx_v3::builder::generators::CreateGenerator;
9117    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9118    ///
9119    /// let builder = prepare_request_builder();
9120    /// let response = builder.send().await?;
9121    /// # Ok(()) }
9122    ///
9123    /// fn prepare_request_builder() -> CreateGenerator {
9124    ///   # panic!();
9125    ///   // ... details omitted ...
9126    /// }
9127    /// ```
9128    #[derive(Clone, Debug)]
9129    pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
9130
9131    impl CreateGenerator {
9132        pub(crate) fn new(
9133            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9134        ) -> Self {
9135            Self(RequestBuilder::new(stub))
9136        }
9137
9138        /// Sets the full request, replacing any prior values.
9139        pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
9140            self.0.request = v.into();
9141            self
9142        }
9143
9144        /// Sets all the options, replacing any prior values.
9145        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9146            self.0.options = v.into();
9147            self
9148        }
9149
9150        /// Sends the request.
9151        pub async fn send(self) -> Result<crate::model::Generator> {
9152            (*self.0.stub)
9153                .create_generator(self.0.request, self.0.options)
9154                .await
9155                .map(crate::Response::into_body)
9156        }
9157
9158        /// Sets the value of [parent][crate::model::CreateGeneratorRequest::parent].
9159        ///
9160        /// This is a **required** field for requests.
9161        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9162            self.0.request.parent = v.into();
9163            self
9164        }
9165
9166        /// Sets the value of [generator][crate::model::CreateGeneratorRequest::generator].
9167        ///
9168        /// This is a **required** field for requests.
9169        pub fn set_generator<T>(mut self, v: T) -> Self
9170        where
9171            T: std::convert::Into<crate::model::Generator>,
9172        {
9173            self.0.request.generator = std::option::Option::Some(v.into());
9174            self
9175        }
9176
9177        /// Sets or clears the value of [generator][crate::model::CreateGeneratorRequest::generator].
9178        ///
9179        /// This is a **required** field for requests.
9180        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
9181        where
9182            T: std::convert::Into<crate::model::Generator>,
9183        {
9184            self.0.request.generator = v.map(|x| x.into());
9185            self
9186        }
9187
9188        /// Sets the value of [language_code][crate::model::CreateGeneratorRequest::language_code].
9189        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9190            self.0.request.language_code = v.into();
9191            self
9192        }
9193    }
9194
9195    #[doc(hidden)]
9196    impl crate::RequestBuilder for CreateGenerator {
9197        fn request_options(&mut self) -> &mut crate::RequestOptions {
9198            &mut self.0.options
9199        }
9200    }
9201
9202    /// The request builder for [Generators::update_generator][crate::client::Generators::update_generator] calls.
9203    ///
9204    /// # Example
9205    /// ```
9206    /// # use google_cloud_dialogflow_cx_v3::builder::generators::UpdateGenerator;
9207    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9208    ///
9209    /// let builder = prepare_request_builder();
9210    /// let response = builder.send().await?;
9211    /// # Ok(()) }
9212    ///
9213    /// fn prepare_request_builder() -> UpdateGenerator {
9214    ///   # panic!();
9215    ///   // ... details omitted ...
9216    /// }
9217    /// ```
9218    #[derive(Clone, Debug)]
9219    pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
9220
9221    impl UpdateGenerator {
9222        pub(crate) fn new(
9223            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9224        ) -> Self {
9225            Self(RequestBuilder::new(stub))
9226        }
9227
9228        /// Sets the full request, replacing any prior values.
9229        pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
9230            self.0.request = v.into();
9231            self
9232        }
9233
9234        /// Sets all the options, replacing any prior values.
9235        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9236            self.0.options = v.into();
9237            self
9238        }
9239
9240        /// Sends the request.
9241        pub async fn send(self) -> Result<crate::model::Generator> {
9242            (*self.0.stub)
9243                .update_generator(self.0.request, self.0.options)
9244                .await
9245                .map(crate::Response::into_body)
9246        }
9247
9248        /// Sets the value of [generator][crate::model::UpdateGeneratorRequest::generator].
9249        ///
9250        /// This is a **required** field for requests.
9251        pub fn set_generator<T>(mut self, v: T) -> Self
9252        where
9253            T: std::convert::Into<crate::model::Generator>,
9254        {
9255            self.0.request.generator = std::option::Option::Some(v.into());
9256            self
9257        }
9258
9259        /// Sets or clears the value of [generator][crate::model::UpdateGeneratorRequest::generator].
9260        ///
9261        /// This is a **required** field for requests.
9262        pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
9263        where
9264            T: std::convert::Into<crate::model::Generator>,
9265        {
9266            self.0.request.generator = v.map(|x| x.into());
9267            self
9268        }
9269
9270        /// Sets the value of [language_code][crate::model::UpdateGeneratorRequest::language_code].
9271        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9272            self.0.request.language_code = v.into();
9273            self
9274        }
9275
9276        /// Sets the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
9277        pub fn set_update_mask<T>(mut self, v: T) -> Self
9278        where
9279            T: std::convert::Into<wkt::FieldMask>,
9280        {
9281            self.0.request.update_mask = std::option::Option::Some(v.into());
9282            self
9283        }
9284
9285        /// Sets or clears the value of [update_mask][crate::model::UpdateGeneratorRequest::update_mask].
9286        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9287        where
9288            T: std::convert::Into<wkt::FieldMask>,
9289        {
9290            self.0.request.update_mask = v.map(|x| x.into());
9291            self
9292        }
9293    }
9294
9295    #[doc(hidden)]
9296    impl crate::RequestBuilder for UpdateGenerator {
9297        fn request_options(&mut self) -> &mut crate::RequestOptions {
9298            &mut self.0.options
9299        }
9300    }
9301
9302    /// The request builder for [Generators::delete_generator][crate::client::Generators::delete_generator] calls.
9303    ///
9304    /// # Example
9305    /// ```
9306    /// # use google_cloud_dialogflow_cx_v3::builder::generators::DeleteGenerator;
9307    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9308    ///
9309    /// let builder = prepare_request_builder();
9310    /// let response = builder.send().await?;
9311    /// # Ok(()) }
9312    ///
9313    /// fn prepare_request_builder() -> DeleteGenerator {
9314    ///   # panic!();
9315    ///   // ... details omitted ...
9316    /// }
9317    /// ```
9318    #[derive(Clone, Debug)]
9319    pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
9320
9321    impl DeleteGenerator {
9322        pub(crate) fn new(
9323            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9324        ) -> Self {
9325            Self(RequestBuilder::new(stub))
9326        }
9327
9328        /// Sets the full request, replacing any prior values.
9329        pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
9330            self.0.request = v.into();
9331            self
9332        }
9333
9334        /// Sets all the options, replacing any prior values.
9335        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9336            self.0.options = v.into();
9337            self
9338        }
9339
9340        /// Sends the request.
9341        pub async fn send(self) -> Result<()> {
9342            (*self.0.stub)
9343                .delete_generator(self.0.request, self.0.options)
9344                .await
9345                .map(crate::Response::into_body)
9346        }
9347
9348        /// Sets the value of [name][crate::model::DeleteGeneratorRequest::name].
9349        ///
9350        /// This is a **required** field for requests.
9351        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9352            self.0.request.name = v.into();
9353            self
9354        }
9355
9356        /// Sets the value of [force][crate::model::DeleteGeneratorRequest::force].
9357        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
9358            self.0.request.force = v.into();
9359            self
9360        }
9361    }
9362
9363    #[doc(hidden)]
9364    impl crate::RequestBuilder for DeleteGenerator {
9365        fn request_options(&mut self) -> &mut crate::RequestOptions {
9366            &mut self.0.options
9367        }
9368    }
9369
9370    /// The request builder for [Generators::list_locations][crate::client::Generators::list_locations] calls.
9371    ///
9372    /// # Example
9373    /// ```
9374    /// # use google_cloud_dialogflow_cx_v3::builder::generators::ListLocations;
9375    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9376    /// use google_cloud_gax::paginator::ItemPaginator;
9377    ///
9378    /// let builder = prepare_request_builder();
9379    /// let mut items = builder.by_item();
9380    /// while let Some(result) = items.next().await {
9381    ///   let item = result?;
9382    /// }
9383    /// # Ok(()) }
9384    ///
9385    /// fn prepare_request_builder() -> ListLocations {
9386    ///   # panic!();
9387    ///   // ... details omitted ...
9388    /// }
9389    /// ```
9390    #[derive(Clone, Debug)]
9391    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9392
9393    impl ListLocations {
9394        pub(crate) fn new(
9395            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9396        ) -> Self {
9397            Self(RequestBuilder::new(stub))
9398        }
9399
9400        /// Sets the full request, replacing any prior values.
9401        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9402            mut self,
9403            v: V,
9404        ) -> Self {
9405            self.0.request = v.into();
9406            self
9407        }
9408
9409        /// Sets all the options, replacing any prior values.
9410        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9411            self.0.options = v.into();
9412            self
9413        }
9414
9415        /// Sends the request.
9416        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9417            (*self.0.stub)
9418                .list_locations(self.0.request, self.0.options)
9419                .await
9420                .map(crate::Response::into_body)
9421        }
9422
9423        /// Streams each page in the collection.
9424        pub fn by_page(
9425            self,
9426        ) -> impl google_cloud_gax::paginator::Paginator<
9427            google_cloud_location::model::ListLocationsResponse,
9428            crate::Error,
9429        > {
9430            use std::clone::Clone;
9431            let token = self.0.request.page_token.clone();
9432            let execute = move |token: String| {
9433                let mut builder = self.clone();
9434                builder.0.request = builder.0.request.set_page_token(token);
9435                builder.send()
9436            };
9437            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9438        }
9439
9440        /// Streams each item in the collection.
9441        pub fn by_item(
9442            self,
9443        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9444            google_cloud_location::model::ListLocationsResponse,
9445            crate::Error,
9446        > {
9447            use google_cloud_gax::paginator::Paginator;
9448            self.by_page().items()
9449        }
9450
9451        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
9452        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9453            self.0.request.name = v.into();
9454            self
9455        }
9456
9457        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
9458        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9459            self.0.request.filter = v.into();
9460            self
9461        }
9462
9463        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
9464        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9465            self.0.request.page_size = v.into();
9466            self
9467        }
9468
9469        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
9470        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9471            self.0.request.page_token = v.into();
9472            self
9473        }
9474    }
9475
9476    #[doc(hidden)]
9477    impl crate::RequestBuilder for ListLocations {
9478        fn request_options(&mut self) -> &mut crate::RequestOptions {
9479            &mut self.0.options
9480        }
9481    }
9482
9483    /// The request builder for [Generators::get_location][crate::client::Generators::get_location] calls.
9484    ///
9485    /// # Example
9486    /// ```
9487    /// # use google_cloud_dialogflow_cx_v3::builder::generators::GetLocation;
9488    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9489    ///
9490    /// let builder = prepare_request_builder();
9491    /// let response = builder.send().await?;
9492    /// # Ok(()) }
9493    ///
9494    /// fn prepare_request_builder() -> GetLocation {
9495    ///   # panic!();
9496    ///   // ... details omitted ...
9497    /// }
9498    /// ```
9499    #[derive(Clone, Debug)]
9500    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9501
9502    impl GetLocation {
9503        pub(crate) fn new(
9504            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9505        ) -> Self {
9506            Self(RequestBuilder::new(stub))
9507        }
9508
9509        /// Sets the full request, replacing any prior values.
9510        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9511            mut self,
9512            v: V,
9513        ) -> Self {
9514            self.0.request = v.into();
9515            self
9516        }
9517
9518        /// Sets all the options, replacing any prior values.
9519        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9520            self.0.options = v.into();
9521            self
9522        }
9523
9524        /// Sends the request.
9525        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9526            (*self.0.stub)
9527                .get_location(self.0.request, self.0.options)
9528                .await
9529                .map(crate::Response::into_body)
9530        }
9531
9532        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
9533        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9534            self.0.request.name = v.into();
9535            self
9536        }
9537    }
9538
9539    #[doc(hidden)]
9540    impl crate::RequestBuilder for GetLocation {
9541        fn request_options(&mut self) -> &mut crate::RequestOptions {
9542            &mut self.0.options
9543        }
9544    }
9545
9546    /// The request builder for [Generators::list_operations][crate::client::Generators::list_operations] calls.
9547    ///
9548    /// # Example
9549    /// ```
9550    /// # use google_cloud_dialogflow_cx_v3::builder::generators::ListOperations;
9551    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9552    /// use google_cloud_gax::paginator::ItemPaginator;
9553    ///
9554    /// let builder = prepare_request_builder();
9555    /// let mut items = builder.by_item();
9556    /// while let Some(result) = items.next().await {
9557    ///   let item = result?;
9558    /// }
9559    /// # Ok(()) }
9560    ///
9561    /// fn prepare_request_builder() -> ListOperations {
9562    ///   # panic!();
9563    ///   // ... details omitted ...
9564    /// }
9565    /// ```
9566    #[derive(Clone, Debug)]
9567    pub struct ListOperations(
9568        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9569    );
9570
9571    impl ListOperations {
9572        pub(crate) fn new(
9573            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9574        ) -> Self {
9575            Self(RequestBuilder::new(stub))
9576        }
9577
9578        /// Sets the full request, replacing any prior values.
9579        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9580            mut self,
9581            v: V,
9582        ) -> Self {
9583            self.0.request = v.into();
9584            self
9585        }
9586
9587        /// Sets all the options, replacing any prior values.
9588        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9589            self.0.options = v.into();
9590            self
9591        }
9592
9593        /// Sends the request.
9594        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9595            (*self.0.stub)
9596                .list_operations(self.0.request, self.0.options)
9597                .await
9598                .map(crate::Response::into_body)
9599        }
9600
9601        /// Streams each page in the collection.
9602        pub fn by_page(
9603            self,
9604        ) -> impl google_cloud_gax::paginator::Paginator<
9605            google_cloud_longrunning::model::ListOperationsResponse,
9606            crate::Error,
9607        > {
9608            use std::clone::Clone;
9609            let token = self.0.request.page_token.clone();
9610            let execute = move |token: String| {
9611                let mut builder = self.clone();
9612                builder.0.request = builder.0.request.set_page_token(token);
9613                builder.send()
9614            };
9615            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9616        }
9617
9618        /// Streams each item in the collection.
9619        pub fn by_item(
9620            self,
9621        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9622            google_cloud_longrunning::model::ListOperationsResponse,
9623            crate::Error,
9624        > {
9625            use google_cloud_gax::paginator::Paginator;
9626            self.by_page().items()
9627        }
9628
9629        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
9630        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9631            self.0.request.name = v.into();
9632            self
9633        }
9634
9635        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
9636        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9637            self.0.request.filter = v.into();
9638            self
9639        }
9640
9641        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
9642        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9643            self.0.request.page_size = v.into();
9644            self
9645        }
9646
9647        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
9648        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9649            self.0.request.page_token = v.into();
9650            self
9651        }
9652
9653        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
9654        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9655            self.0.request.return_partial_success = v.into();
9656            self
9657        }
9658    }
9659
9660    #[doc(hidden)]
9661    impl crate::RequestBuilder for ListOperations {
9662        fn request_options(&mut self) -> &mut crate::RequestOptions {
9663            &mut self.0.options
9664        }
9665    }
9666
9667    /// The request builder for [Generators::get_operation][crate::client::Generators::get_operation] calls.
9668    ///
9669    /// # Example
9670    /// ```
9671    /// # use google_cloud_dialogflow_cx_v3::builder::generators::GetOperation;
9672    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9673    ///
9674    /// let builder = prepare_request_builder();
9675    /// let response = builder.send().await?;
9676    /// # Ok(()) }
9677    ///
9678    /// fn prepare_request_builder() -> GetOperation {
9679    ///   # panic!();
9680    ///   // ... details omitted ...
9681    /// }
9682    /// ```
9683    #[derive(Clone, Debug)]
9684    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9685
9686    impl GetOperation {
9687        pub(crate) fn new(
9688            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9689        ) -> Self {
9690            Self(RequestBuilder::new(stub))
9691        }
9692
9693        /// Sets the full request, replacing any prior values.
9694        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9695            mut self,
9696            v: V,
9697        ) -> Self {
9698            self.0.request = v.into();
9699            self
9700        }
9701
9702        /// Sets all the options, replacing any prior values.
9703        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9704            self.0.options = v.into();
9705            self
9706        }
9707
9708        /// Sends the request.
9709        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9710            (*self.0.stub)
9711                .get_operation(self.0.request, self.0.options)
9712                .await
9713                .map(crate::Response::into_body)
9714        }
9715
9716        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
9717        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9718            self.0.request.name = v.into();
9719            self
9720        }
9721    }
9722
9723    #[doc(hidden)]
9724    impl crate::RequestBuilder for GetOperation {
9725        fn request_options(&mut self) -> &mut crate::RequestOptions {
9726            &mut self.0.options
9727        }
9728    }
9729
9730    /// The request builder for [Generators::cancel_operation][crate::client::Generators::cancel_operation] calls.
9731    ///
9732    /// # Example
9733    /// ```
9734    /// # use google_cloud_dialogflow_cx_v3::builder::generators::CancelOperation;
9735    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9736    ///
9737    /// let builder = prepare_request_builder();
9738    /// let response = builder.send().await?;
9739    /// # Ok(()) }
9740    ///
9741    /// fn prepare_request_builder() -> CancelOperation {
9742    ///   # panic!();
9743    ///   // ... details omitted ...
9744    /// }
9745    /// ```
9746    #[derive(Clone, Debug)]
9747    pub struct CancelOperation(
9748        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9749    );
9750
9751    impl CancelOperation {
9752        pub(crate) fn new(
9753            stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9754        ) -> Self {
9755            Self(RequestBuilder::new(stub))
9756        }
9757
9758        /// Sets the full request, replacing any prior values.
9759        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9760            mut self,
9761            v: V,
9762        ) -> Self {
9763            self.0.request = v.into();
9764            self
9765        }
9766
9767        /// Sets all the options, replacing any prior values.
9768        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9769            self.0.options = v.into();
9770            self
9771        }
9772
9773        /// Sends the request.
9774        pub async fn send(self) -> Result<()> {
9775            (*self.0.stub)
9776                .cancel_operation(self.0.request, self.0.options)
9777                .await
9778                .map(crate::Response::into_body)
9779        }
9780
9781        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
9782        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9783            self.0.request.name = v.into();
9784            self
9785        }
9786    }
9787
9788    #[doc(hidden)]
9789    impl crate::RequestBuilder for CancelOperation {
9790        fn request_options(&mut self) -> &mut crate::RequestOptions {
9791            &mut self.0.options
9792        }
9793    }
9794}
9795
9796/// Request and client builders for [Intents][crate::client::Intents].
9797#[cfg(feature = "intents")]
9798#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
9799pub mod intents {
9800    use crate::Result;
9801
9802    /// A builder for [Intents][crate::client::Intents].
9803    ///
9804    /// ```
9805    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
9806    /// # use google_cloud_dialogflow_cx_v3::*;
9807    /// # use builder::intents::ClientBuilder;
9808    /// # use client::Intents;
9809    /// let builder : ClientBuilder = Intents::builder();
9810    /// let client = builder
9811    ///     .with_endpoint("https://dialogflow.googleapis.com")
9812    ///     .build().await?;
9813    /// # Ok(()) }
9814    /// ```
9815    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9816
9817    pub(crate) mod client {
9818        use super::super::super::client::Intents;
9819        pub struct Factory;
9820        impl crate::ClientFactory for Factory {
9821            type Client = Intents;
9822            type Credentials = gaxi::options::Credentials;
9823            async fn build(
9824                self,
9825                config: gaxi::options::ClientConfig,
9826            ) -> crate::ClientBuilderResult<Self::Client> {
9827                Self::Client::new(config).await
9828            }
9829        }
9830    }
9831
9832    /// Common implementation for [crate::client::Intents] request builders.
9833    #[derive(Clone, Debug)]
9834    pub(crate) struct RequestBuilder<R: std::default::Default> {
9835        stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
9836        request: R,
9837        options: crate::RequestOptions,
9838    }
9839
9840    impl<R> RequestBuilder<R>
9841    where
9842        R: std::default::Default,
9843    {
9844        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
9845            Self {
9846                stub,
9847                request: R::default(),
9848                options: crate::RequestOptions::default(),
9849            }
9850        }
9851    }
9852
9853    /// The request builder for [Intents::list_intents][crate::client::Intents::list_intents] calls.
9854    ///
9855    /// # Example
9856    /// ```
9857    /// # use google_cloud_dialogflow_cx_v3::builder::intents::ListIntents;
9858    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9859    /// use google_cloud_gax::paginator::ItemPaginator;
9860    ///
9861    /// let builder = prepare_request_builder();
9862    /// let mut items = builder.by_item();
9863    /// while let Some(result) = items.next().await {
9864    ///   let item = result?;
9865    /// }
9866    /// # Ok(()) }
9867    ///
9868    /// fn prepare_request_builder() -> ListIntents {
9869    ///   # panic!();
9870    ///   // ... details omitted ...
9871    /// }
9872    /// ```
9873    #[derive(Clone, Debug)]
9874    pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
9875
9876    impl ListIntents {
9877        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
9878            Self(RequestBuilder::new(stub))
9879        }
9880
9881        /// Sets the full request, replacing any prior values.
9882        pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
9883            self.0.request = v.into();
9884            self
9885        }
9886
9887        /// Sets all the options, replacing any prior values.
9888        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9889            self.0.options = v.into();
9890            self
9891        }
9892
9893        /// Sends the request.
9894        pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
9895            (*self.0.stub)
9896                .list_intents(self.0.request, self.0.options)
9897                .await
9898                .map(crate::Response::into_body)
9899        }
9900
9901        /// Streams each page in the collection.
9902        pub fn by_page(
9903            self,
9904        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIntentsResponse, crate::Error>
9905        {
9906            use std::clone::Clone;
9907            let token = self.0.request.page_token.clone();
9908            let execute = move |token: String| {
9909                let mut builder = self.clone();
9910                builder.0.request = builder.0.request.set_page_token(token);
9911                builder.send()
9912            };
9913            google_cloud_gax::paginator::internal::new_paginator(token, execute)
9914        }
9915
9916        /// Streams each item in the collection.
9917        pub fn by_item(
9918            self,
9919        ) -> impl google_cloud_gax::paginator::ItemPaginator<
9920            crate::model::ListIntentsResponse,
9921            crate::Error,
9922        > {
9923            use google_cloud_gax::paginator::Paginator;
9924            self.by_page().items()
9925        }
9926
9927        /// Sets the value of [parent][crate::model::ListIntentsRequest::parent].
9928        ///
9929        /// This is a **required** field for requests.
9930        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9931            self.0.request.parent = v.into();
9932            self
9933        }
9934
9935        /// Sets the value of [language_code][crate::model::ListIntentsRequest::language_code].
9936        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9937            self.0.request.language_code = v.into();
9938            self
9939        }
9940
9941        /// Sets the value of [intent_view][crate::model::ListIntentsRequest::intent_view].
9942        pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
9943            self.0.request.intent_view = v.into();
9944            self
9945        }
9946
9947        /// Sets the value of [page_size][crate::model::ListIntentsRequest::page_size].
9948        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9949            self.0.request.page_size = v.into();
9950            self
9951        }
9952
9953        /// Sets the value of [page_token][crate::model::ListIntentsRequest::page_token].
9954        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9955            self.0.request.page_token = v.into();
9956            self
9957        }
9958    }
9959
9960    #[doc(hidden)]
9961    impl crate::RequestBuilder for ListIntents {
9962        fn request_options(&mut self) -> &mut crate::RequestOptions {
9963            &mut self.0.options
9964        }
9965    }
9966
9967    /// The request builder for [Intents::get_intent][crate::client::Intents::get_intent] calls.
9968    ///
9969    /// # Example
9970    /// ```
9971    /// # use google_cloud_dialogflow_cx_v3::builder::intents::GetIntent;
9972    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
9973    ///
9974    /// let builder = prepare_request_builder();
9975    /// let response = builder.send().await?;
9976    /// # Ok(()) }
9977    ///
9978    /// fn prepare_request_builder() -> GetIntent {
9979    ///   # panic!();
9980    ///   // ... details omitted ...
9981    /// }
9982    /// ```
9983    #[derive(Clone, Debug)]
9984    pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
9985
9986    impl GetIntent {
9987        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
9988            Self(RequestBuilder::new(stub))
9989        }
9990
9991        /// Sets the full request, replacing any prior values.
9992        pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
9993            self.0.request = v.into();
9994            self
9995        }
9996
9997        /// Sets all the options, replacing any prior values.
9998        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9999            self.0.options = v.into();
10000            self
10001        }
10002
10003        /// Sends the request.
10004        pub async fn send(self) -> Result<crate::model::Intent> {
10005            (*self.0.stub)
10006                .get_intent(self.0.request, self.0.options)
10007                .await
10008                .map(crate::Response::into_body)
10009        }
10010
10011        /// Sets the value of [name][crate::model::GetIntentRequest::name].
10012        ///
10013        /// This is a **required** field for requests.
10014        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10015            self.0.request.name = v.into();
10016            self
10017        }
10018
10019        /// Sets the value of [language_code][crate::model::GetIntentRequest::language_code].
10020        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10021            self.0.request.language_code = v.into();
10022            self
10023        }
10024    }
10025
10026    #[doc(hidden)]
10027    impl crate::RequestBuilder for GetIntent {
10028        fn request_options(&mut self) -> &mut crate::RequestOptions {
10029            &mut self.0.options
10030        }
10031    }
10032
10033    /// The request builder for [Intents::create_intent][crate::client::Intents::create_intent] calls.
10034    ///
10035    /// # Example
10036    /// ```
10037    /// # use google_cloud_dialogflow_cx_v3::builder::intents::CreateIntent;
10038    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10039    ///
10040    /// let builder = prepare_request_builder();
10041    /// let response = builder.send().await?;
10042    /// # Ok(()) }
10043    ///
10044    /// fn prepare_request_builder() -> CreateIntent {
10045    ///   # panic!();
10046    ///   // ... details omitted ...
10047    /// }
10048    /// ```
10049    #[derive(Clone, Debug)]
10050    pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
10051
10052    impl CreateIntent {
10053        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10054            Self(RequestBuilder::new(stub))
10055        }
10056
10057        /// Sets the full request, replacing any prior values.
10058        pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
10059            self.0.request = v.into();
10060            self
10061        }
10062
10063        /// Sets all the options, replacing any prior values.
10064        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10065            self.0.options = v.into();
10066            self
10067        }
10068
10069        /// Sends the request.
10070        pub async fn send(self) -> Result<crate::model::Intent> {
10071            (*self.0.stub)
10072                .create_intent(self.0.request, self.0.options)
10073                .await
10074                .map(crate::Response::into_body)
10075        }
10076
10077        /// Sets the value of [parent][crate::model::CreateIntentRequest::parent].
10078        ///
10079        /// This is a **required** field for requests.
10080        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10081            self.0.request.parent = v.into();
10082            self
10083        }
10084
10085        /// Sets the value of [intent][crate::model::CreateIntentRequest::intent].
10086        ///
10087        /// This is a **required** field for requests.
10088        pub fn set_intent<T>(mut self, v: T) -> Self
10089        where
10090            T: std::convert::Into<crate::model::Intent>,
10091        {
10092            self.0.request.intent = std::option::Option::Some(v.into());
10093            self
10094        }
10095
10096        /// Sets or clears the value of [intent][crate::model::CreateIntentRequest::intent].
10097        ///
10098        /// This is a **required** field for requests.
10099        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
10100        where
10101            T: std::convert::Into<crate::model::Intent>,
10102        {
10103            self.0.request.intent = v.map(|x| x.into());
10104            self
10105        }
10106
10107        /// Sets the value of [language_code][crate::model::CreateIntentRequest::language_code].
10108        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10109            self.0.request.language_code = v.into();
10110            self
10111        }
10112    }
10113
10114    #[doc(hidden)]
10115    impl crate::RequestBuilder for CreateIntent {
10116        fn request_options(&mut self) -> &mut crate::RequestOptions {
10117            &mut self.0.options
10118        }
10119    }
10120
10121    /// The request builder for [Intents::update_intent][crate::client::Intents::update_intent] calls.
10122    ///
10123    /// # Example
10124    /// ```
10125    /// # use google_cloud_dialogflow_cx_v3::builder::intents::UpdateIntent;
10126    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10127    ///
10128    /// let builder = prepare_request_builder();
10129    /// let response = builder.send().await?;
10130    /// # Ok(()) }
10131    ///
10132    /// fn prepare_request_builder() -> UpdateIntent {
10133    ///   # panic!();
10134    ///   // ... details omitted ...
10135    /// }
10136    /// ```
10137    #[derive(Clone, Debug)]
10138    pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
10139
10140    impl UpdateIntent {
10141        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10142            Self(RequestBuilder::new(stub))
10143        }
10144
10145        /// Sets the full request, replacing any prior values.
10146        pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
10147            self.0.request = v.into();
10148            self
10149        }
10150
10151        /// Sets all the options, replacing any prior values.
10152        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10153            self.0.options = v.into();
10154            self
10155        }
10156
10157        /// Sends the request.
10158        pub async fn send(self) -> Result<crate::model::Intent> {
10159            (*self.0.stub)
10160                .update_intent(self.0.request, self.0.options)
10161                .await
10162                .map(crate::Response::into_body)
10163        }
10164
10165        /// Sets the value of [intent][crate::model::UpdateIntentRequest::intent].
10166        ///
10167        /// This is a **required** field for requests.
10168        pub fn set_intent<T>(mut self, v: T) -> Self
10169        where
10170            T: std::convert::Into<crate::model::Intent>,
10171        {
10172            self.0.request.intent = std::option::Option::Some(v.into());
10173            self
10174        }
10175
10176        /// Sets or clears the value of [intent][crate::model::UpdateIntentRequest::intent].
10177        ///
10178        /// This is a **required** field for requests.
10179        pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
10180        where
10181            T: std::convert::Into<crate::model::Intent>,
10182        {
10183            self.0.request.intent = v.map(|x| x.into());
10184            self
10185        }
10186
10187        /// Sets the value of [language_code][crate::model::UpdateIntentRequest::language_code].
10188        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10189            self.0.request.language_code = v.into();
10190            self
10191        }
10192
10193        /// Sets the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
10194        pub fn set_update_mask<T>(mut self, v: T) -> Self
10195        where
10196            T: std::convert::Into<wkt::FieldMask>,
10197        {
10198            self.0.request.update_mask = std::option::Option::Some(v.into());
10199            self
10200        }
10201
10202        /// Sets or clears the value of [update_mask][crate::model::UpdateIntentRequest::update_mask].
10203        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10204        where
10205            T: std::convert::Into<wkt::FieldMask>,
10206        {
10207            self.0.request.update_mask = v.map(|x| x.into());
10208            self
10209        }
10210    }
10211
10212    #[doc(hidden)]
10213    impl crate::RequestBuilder for UpdateIntent {
10214        fn request_options(&mut self) -> &mut crate::RequestOptions {
10215            &mut self.0.options
10216        }
10217    }
10218
10219    /// The request builder for [Intents::delete_intent][crate::client::Intents::delete_intent] calls.
10220    ///
10221    /// # Example
10222    /// ```
10223    /// # use google_cloud_dialogflow_cx_v3::builder::intents::DeleteIntent;
10224    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10225    ///
10226    /// let builder = prepare_request_builder();
10227    /// let response = builder.send().await?;
10228    /// # Ok(()) }
10229    ///
10230    /// fn prepare_request_builder() -> DeleteIntent {
10231    ///   # panic!();
10232    ///   // ... details omitted ...
10233    /// }
10234    /// ```
10235    #[derive(Clone, Debug)]
10236    pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
10237
10238    impl DeleteIntent {
10239        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10240            Self(RequestBuilder::new(stub))
10241        }
10242
10243        /// Sets the full request, replacing any prior values.
10244        pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
10245            self.0.request = v.into();
10246            self
10247        }
10248
10249        /// Sets all the options, replacing any prior values.
10250        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10251            self.0.options = v.into();
10252            self
10253        }
10254
10255        /// Sends the request.
10256        pub async fn send(self) -> Result<()> {
10257            (*self.0.stub)
10258                .delete_intent(self.0.request, self.0.options)
10259                .await
10260                .map(crate::Response::into_body)
10261        }
10262
10263        /// Sets the value of [name][crate::model::DeleteIntentRequest::name].
10264        ///
10265        /// This is a **required** field for requests.
10266        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10267            self.0.request.name = v.into();
10268            self
10269        }
10270    }
10271
10272    #[doc(hidden)]
10273    impl crate::RequestBuilder for DeleteIntent {
10274        fn request_options(&mut self) -> &mut crate::RequestOptions {
10275            &mut self.0.options
10276        }
10277    }
10278
10279    /// The request builder for [Intents::import_intents][crate::client::Intents::import_intents] calls.
10280    ///
10281    /// # Example
10282    /// ```
10283    /// # use google_cloud_dialogflow_cx_v3::builder::intents::ImportIntents;
10284    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10285    /// use google_cloud_lro::Poller;
10286    ///
10287    /// let builder = prepare_request_builder();
10288    /// let response = builder.poller().until_done().await?;
10289    /// # Ok(()) }
10290    ///
10291    /// fn prepare_request_builder() -> ImportIntents {
10292    ///   # panic!();
10293    ///   // ... details omitted ...
10294    /// }
10295    /// ```
10296    #[derive(Clone, Debug)]
10297    pub struct ImportIntents(RequestBuilder<crate::model::ImportIntentsRequest>);
10298
10299    impl ImportIntents {
10300        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10301            Self(RequestBuilder::new(stub))
10302        }
10303
10304        /// Sets the full request, replacing any prior values.
10305        pub fn with_request<V: Into<crate::model::ImportIntentsRequest>>(mut self, v: V) -> Self {
10306            self.0.request = v.into();
10307            self
10308        }
10309
10310        /// Sets all the options, replacing any prior values.
10311        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10312            self.0.options = v.into();
10313            self
10314        }
10315
10316        /// Sends the request.
10317        ///
10318        /// # Long running operations
10319        ///
10320        /// This starts, but does not poll, a longrunning operation. More information
10321        /// on [import_intents][crate::client::Intents::import_intents].
10322        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10323            (*self.0.stub)
10324                .import_intents(self.0.request, self.0.options)
10325                .await
10326                .map(crate::Response::into_body)
10327        }
10328
10329        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_intents`.
10330        pub fn poller(
10331            self,
10332        ) -> impl google_cloud_lro::Poller<
10333            crate::model::ImportIntentsResponse,
10334            crate::model::ImportIntentsMetadata,
10335        > {
10336            type Operation = google_cloud_lro::internal::Operation<
10337                crate::model::ImportIntentsResponse,
10338                crate::model::ImportIntentsMetadata,
10339            >;
10340            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10341            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10342
10343            let stub = self.0.stub.clone();
10344            let mut options = self.0.options.clone();
10345            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10346            let query = move |name| {
10347                let stub = stub.clone();
10348                let options = options.clone();
10349                async {
10350                    let op = GetOperation::new(stub)
10351                        .set_name(name)
10352                        .with_options(options)
10353                        .send()
10354                        .await?;
10355                    Ok(Operation::new(op))
10356                }
10357            };
10358
10359            let start = move || async {
10360                let op = self.send().await?;
10361                Ok(Operation::new(op))
10362            };
10363
10364            google_cloud_lro::internal::new_poller(
10365                polling_error_policy,
10366                polling_backoff_policy,
10367                start,
10368                query,
10369            )
10370        }
10371
10372        /// Sets the value of [parent][crate::model::ImportIntentsRequest::parent].
10373        ///
10374        /// This is a **required** field for requests.
10375        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10376            self.0.request.parent = v.into();
10377            self
10378        }
10379
10380        /// Sets the value of [merge_option][crate::model::ImportIntentsRequest::merge_option].
10381        pub fn set_merge_option<T: Into<crate::model::import_intents_request::MergeOption>>(
10382            mut self,
10383            v: T,
10384        ) -> Self {
10385            self.0.request.merge_option = v.into();
10386            self
10387        }
10388
10389        /// Sets the value of [intents][crate::model::ImportIntentsRequest::intents].
10390        ///
10391        /// Note that all the setters affecting `intents` are
10392        /// mutually exclusive.
10393        pub fn set_intents<T: Into<Option<crate::model::import_intents_request::Intents>>>(
10394            mut self,
10395            v: T,
10396        ) -> Self {
10397            self.0.request.intents = v.into();
10398            self
10399        }
10400
10401        /// Sets the value of [intents][crate::model::ImportIntentsRequest::intents]
10402        /// to hold a `IntentsUri`.
10403        ///
10404        /// Note that all the setters affecting `intents` are
10405        /// mutually exclusive.
10406        pub fn set_intents_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10407            self.0.request = self.0.request.set_intents_uri(v);
10408            self
10409        }
10410
10411        /// Sets the value of [intents][crate::model::ImportIntentsRequest::intents]
10412        /// to hold a `IntentsContent`.
10413        ///
10414        /// Note that all the setters affecting `intents` are
10415        /// mutually exclusive.
10416        pub fn set_intents_content<
10417            T: std::convert::Into<std::boxed::Box<crate::model::InlineSource>>,
10418        >(
10419            mut self,
10420            v: T,
10421        ) -> Self {
10422            self.0.request = self.0.request.set_intents_content(v);
10423            self
10424        }
10425    }
10426
10427    #[doc(hidden)]
10428    impl crate::RequestBuilder for ImportIntents {
10429        fn request_options(&mut self) -> &mut crate::RequestOptions {
10430            &mut self.0.options
10431        }
10432    }
10433
10434    /// The request builder for [Intents::export_intents][crate::client::Intents::export_intents] calls.
10435    ///
10436    /// # Example
10437    /// ```
10438    /// # use google_cloud_dialogflow_cx_v3::builder::intents::ExportIntents;
10439    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10440    /// use google_cloud_lro::Poller;
10441    ///
10442    /// let builder = prepare_request_builder();
10443    /// let response = builder.poller().until_done().await?;
10444    /// # Ok(()) }
10445    ///
10446    /// fn prepare_request_builder() -> ExportIntents {
10447    ///   # panic!();
10448    ///   // ... details omitted ...
10449    /// }
10450    /// ```
10451    #[derive(Clone, Debug)]
10452    pub struct ExportIntents(RequestBuilder<crate::model::ExportIntentsRequest>);
10453
10454    impl ExportIntents {
10455        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10456            Self(RequestBuilder::new(stub))
10457        }
10458
10459        /// Sets the full request, replacing any prior values.
10460        pub fn with_request<V: Into<crate::model::ExportIntentsRequest>>(mut self, v: V) -> Self {
10461            self.0.request = v.into();
10462            self
10463        }
10464
10465        /// Sets all the options, replacing any prior values.
10466        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10467            self.0.options = v.into();
10468            self
10469        }
10470
10471        /// Sends the request.
10472        ///
10473        /// # Long running operations
10474        ///
10475        /// This starts, but does not poll, a longrunning operation. More information
10476        /// on [export_intents][crate::client::Intents::export_intents].
10477        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10478            (*self.0.stub)
10479                .export_intents(self.0.request, self.0.options)
10480                .await
10481                .map(crate::Response::into_body)
10482        }
10483
10484        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_intents`.
10485        pub fn poller(
10486            self,
10487        ) -> impl google_cloud_lro::Poller<
10488            crate::model::ExportIntentsResponse,
10489            crate::model::ExportIntentsMetadata,
10490        > {
10491            type Operation = google_cloud_lro::internal::Operation<
10492                crate::model::ExportIntentsResponse,
10493                crate::model::ExportIntentsMetadata,
10494            >;
10495            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10496            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10497
10498            let stub = self.0.stub.clone();
10499            let mut options = self.0.options.clone();
10500            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10501            let query = move |name| {
10502                let stub = stub.clone();
10503                let options = options.clone();
10504                async {
10505                    let op = GetOperation::new(stub)
10506                        .set_name(name)
10507                        .with_options(options)
10508                        .send()
10509                        .await?;
10510                    Ok(Operation::new(op))
10511                }
10512            };
10513
10514            let start = move || async {
10515                let op = self.send().await?;
10516                Ok(Operation::new(op))
10517            };
10518
10519            google_cloud_lro::internal::new_poller(
10520                polling_error_policy,
10521                polling_backoff_policy,
10522                start,
10523                query,
10524            )
10525        }
10526
10527        /// Sets the value of [parent][crate::model::ExportIntentsRequest::parent].
10528        ///
10529        /// This is a **required** field for requests.
10530        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10531            self.0.request.parent = v.into();
10532            self
10533        }
10534
10535        /// Sets the value of [intents][crate::model::ExportIntentsRequest::intents].
10536        ///
10537        /// This is a **required** field for requests.
10538        pub fn set_intents<T, V>(mut self, v: T) -> Self
10539        where
10540            T: std::iter::IntoIterator<Item = V>,
10541            V: std::convert::Into<std::string::String>,
10542        {
10543            use std::iter::Iterator;
10544            self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
10545            self
10546        }
10547
10548        /// Sets the value of [data_format][crate::model::ExportIntentsRequest::data_format].
10549        pub fn set_data_format<T: Into<crate::model::export_intents_request::DataFormat>>(
10550            mut self,
10551            v: T,
10552        ) -> Self {
10553            self.0.request.data_format = v.into();
10554            self
10555        }
10556
10557        /// Sets the value of [destination][crate::model::ExportIntentsRequest::destination].
10558        ///
10559        /// Note that all the setters affecting `destination` are
10560        /// mutually exclusive.
10561        pub fn set_destination<
10562            T: Into<Option<crate::model::export_intents_request::Destination>>,
10563        >(
10564            mut self,
10565            v: T,
10566        ) -> Self {
10567            self.0.request.destination = v.into();
10568            self
10569        }
10570
10571        /// Sets the value of [destination][crate::model::ExportIntentsRequest::destination]
10572        /// to hold a `IntentsUri`.
10573        ///
10574        /// Note that all the setters affecting `destination` are
10575        /// mutually exclusive.
10576        pub fn set_intents_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10577            self.0.request = self.0.request.set_intents_uri(v);
10578            self
10579        }
10580
10581        /// Sets the value of [destination][crate::model::ExportIntentsRequest::destination]
10582        /// to hold a `IntentsContentInline`.
10583        ///
10584        /// Note that all the setters affecting `destination` are
10585        /// mutually exclusive.
10586        pub fn set_intents_content_inline<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10587            self.0.request = self.0.request.set_intents_content_inline(v);
10588            self
10589        }
10590    }
10591
10592    #[doc(hidden)]
10593    impl crate::RequestBuilder for ExportIntents {
10594        fn request_options(&mut self) -> &mut crate::RequestOptions {
10595            &mut self.0.options
10596        }
10597    }
10598
10599    /// The request builder for [Intents::list_locations][crate::client::Intents::list_locations] calls.
10600    ///
10601    /// # Example
10602    /// ```
10603    /// # use google_cloud_dialogflow_cx_v3::builder::intents::ListLocations;
10604    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10605    /// use google_cloud_gax::paginator::ItemPaginator;
10606    ///
10607    /// let builder = prepare_request_builder();
10608    /// let mut items = builder.by_item();
10609    /// while let Some(result) = items.next().await {
10610    ///   let item = result?;
10611    /// }
10612    /// # Ok(()) }
10613    ///
10614    /// fn prepare_request_builder() -> ListLocations {
10615    ///   # panic!();
10616    ///   // ... details omitted ...
10617    /// }
10618    /// ```
10619    #[derive(Clone, Debug)]
10620    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10621
10622    impl ListLocations {
10623        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10624            Self(RequestBuilder::new(stub))
10625        }
10626
10627        /// Sets the full request, replacing any prior values.
10628        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10629            mut self,
10630            v: V,
10631        ) -> Self {
10632            self.0.request = v.into();
10633            self
10634        }
10635
10636        /// Sets all the options, replacing any prior values.
10637        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10638            self.0.options = v.into();
10639            self
10640        }
10641
10642        /// Sends the request.
10643        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10644            (*self.0.stub)
10645                .list_locations(self.0.request, self.0.options)
10646                .await
10647                .map(crate::Response::into_body)
10648        }
10649
10650        /// Streams each page in the collection.
10651        pub fn by_page(
10652            self,
10653        ) -> impl google_cloud_gax::paginator::Paginator<
10654            google_cloud_location::model::ListLocationsResponse,
10655            crate::Error,
10656        > {
10657            use std::clone::Clone;
10658            let token = self.0.request.page_token.clone();
10659            let execute = move |token: String| {
10660                let mut builder = self.clone();
10661                builder.0.request = builder.0.request.set_page_token(token);
10662                builder.send()
10663            };
10664            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10665        }
10666
10667        /// Streams each item in the collection.
10668        pub fn by_item(
10669            self,
10670        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10671            google_cloud_location::model::ListLocationsResponse,
10672            crate::Error,
10673        > {
10674            use google_cloud_gax::paginator::Paginator;
10675            self.by_page().items()
10676        }
10677
10678        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
10679        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10680            self.0.request.name = v.into();
10681            self
10682        }
10683
10684        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
10685        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10686            self.0.request.filter = v.into();
10687            self
10688        }
10689
10690        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
10691        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10692            self.0.request.page_size = v.into();
10693            self
10694        }
10695
10696        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
10697        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10698            self.0.request.page_token = v.into();
10699            self
10700        }
10701    }
10702
10703    #[doc(hidden)]
10704    impl crate::RequestBuilder for ListLocations {
10705        fn request_options(&mut self) -> &mut crate::RequestOptions {
10706            &mut self.0.options
10707        }
10708    }
10709
10710    /// The request builder for [Intents::get_location][crate::client::Intents::get_location] calls.
10711    ///
10712    /// # Example
10713    /// ```
10714    /// # use google_cloud_dialogflow_cx_v3::builder::intents::GetLocation;
10715    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10716    ///
10717    /// let builder = prepare_request_builder();
10718    /// let response = builder.send().await?;
10719    /// # Ok(()) }
10720    ///
10721    /// fn prepare_request_builder() -> GetLocation {
10722    ///   # panic!();
10723    ///   // ... details omitted ...
10724    /// }
10725    /// ```
10726    #[derive(Clone, Debug)]
10727    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10728
10729    impl GetLocation {
10730        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10731            Self(RequestBuilder::new(stub))
10732        }
10733
10734        /// Sets the full request, replacing any prior values.
10735        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10736            mut self,
10737            v: V,
10738        ) -> Self {
10739            self.0.request = v.into();
10740            self
10741        }
10742
10743        /// Sets all the options, replacing any prior values.
10744        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10745            self.0.options = v.into();
10746            self
10747        }
10748
10749        /// Sends the request.
10750        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10751            (*self.0.stub)
10752                .get_location(self.0.request, self.0.options)
10753                .await
10754                .map(crate::Response::into_body)
10755        }
10756
10757        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
10758        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10759            self.0.request.name = v.into();
10760            self
10761        }
10762    }
10763
10764    #[doc(hidden)]
10765    impl crate::RequestBuilder for GetLocation {
10766        fn request_options(&mut self) -> &mut crate::RequestOptions {
10767            &mut self.0.options
10768        }
10769    }
10770
10771    /// The request builder for [Intents::list_operations][crate::client::Intents::list_operations] calls.
10772    ///
10773    /// # Example
10774    /// ```
10775    /// # use google_cloud_dialogflow_cx_v3::builder::intents::ListOperations;
10776    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10777    /// use google_cloud_gax::paginator::ItemPaginator;
10778    ///
10779    /// let builder = prepare_request_builder();
10780    /// let mut items = builder.by_item();
10781    /// while let Some(result) = items.next().await {
10782    ///   let item = result?;
10783    /// }
10784    /// # Ok(()) }
10785    ///
10786    /// fn prepare_request_builder() -> ListOperations {
10787    ///   # panic!();
10788    ///   // ... details omitted ...
10789    /// }
10790    /// ```
10791    #[derive(Clone, Debug)]
10792    pub struct ListOperations(
10793        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10794    );
10795
10796    impl ListOperations {
10797        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10798            Self(RequestBuilder::new(stub))
10799        }
10800
10801        /// Sets the full request, replacing any prior values.
10802        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10803            mut self,
10804            v: V,
10805        ) -> Self {
10806            self.0.request = v.into();
10807            self
10808        }
10809
10810        /// Sets all the options, replacing any prior values.
10811        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10812            self.0.options = v.into();
10813            self
10814        }
10815
10816        /// Sends the request.
10817        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10818            (*self.0.stub)
10819                .list_operations(self.0.request, self.0.options)
10820                .await
10821                .map(crate::Response::into_body)
10822        }
10823
10824        /// Streams each page in the collection.
10825        pub fn by_page(
10826            self,
10827        ) -> impl google_cloud_gax::paginator::Paginator<
10828            google_cloud_longrunning::model::ListOperationsResponse,
10829            crate::Error,
10830        > {
10831            use std::clone::Clone;
10832            let token = self.0.request.page_token.clone();
10833            let execute = move |token: String| {
10834                let mut builder = self.clone();
10835                builder.0.request = builder.0.request.set_page_token(token);
10836                builder.send()
10837            };
10838            google_cloud_gax::paginator::internal::new_paginator(token, execute)
10839        }
10840
10841        /// Streams each item in the collection.
10842        pub fn by_item(
10843            self,
10844        ) -> impl google_cloud_gax::paginator::ItemPaginator<
10845            google_cloud_longrunning::model::ListOperationsResponse,
10846            crate::Error,
10847        > {
10848            use google_cloud_gax::paginator::Paginator;
10849            self.by_page().items()
10850        }
10851
10852        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
10853        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10854            self.0.request.name = v.into();
10855            self
10856        }
10857
10858        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
10859        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10860            self.0.request.filter = v.into();
10861            self
10862        }
10863
10864        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
10865        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10866            self.0.request.page_size = v.into();
10867            self
10868        }
10869
10870        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
10871        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10872            self.0.request.page_token = v.into();
10873            self
10874        }
10875
10876        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
10877        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10878            self.0.request.return_partial_success = v.into();
10879            self
10880        }
10881    }
10882
10883    #[doc(hidden)]
10884    impl crate::RequestBuilder for ListOperations {
10885        fn request_options(&mut self) -> &mut crate::RequestOptions {
10886            &mut self.0.options
10887        }
10888    }
10889
10890    /// The request builder for [Intents::get_operation][crate::client::Intents::get_operation] calls.
10891    ///
10892    /// # Example
10893    /// ```
10894    /// # use google_cloud_dialogflow_cx_v3::builder::intents::GetOperation;
10895    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10896    ///
10897    /// let builder = prepare_request_builder();
10898    /// let response = builder.send().await?;
10899    /// # Ok(()) }
10900    ///
10901    /// fn prepare_request_builder() -> GetOperation {
10902    ///   # panic!();
10903    ///   // ... details omitted ...
10904    /// }
10905    /// ```
10906    #[derive(Clone, Debug)]
10907    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10908
10909    impl GetOperation {
10910        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10911            Self(RequestBuilder::new(stub))
10912        }
10913
10914        /// Sets the full request, replacing any prior values.
10915        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10916            mut self,
10917            v: V,
10918        ) -> Self {
10919            self.0.request = v.into();
10920            self
10921        }
10922
10923        /// Sets all the options, replacing any prior values.
10924        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10925            self.0.options = v.into();
10926            self
10927        }
10928
10929        /// Sends the request.
10930        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10931            (*self.0.stub)
10932                .get_operation(self.0.request, self.0.options)
10933                .await
10934                .map(crate::Response::into_body)
10935        }
10936
10937        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
10938        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10939            self.0.request.name = v.into();
10940            self
10941        }
10942    }
10943
10944    #[doc(hidden)]
10945    impl crate::RequestBuilder for GetOperation {
10946        fn request_options(&mut self) -> &mut crate::RequestOptions {
10947            &mut self.0.options
10948        }
10949    }
10950
10951    /// The request builder for [Intents::cancel_operation][crate::client::Intents::cancel_operation] calls.
10952    ///
10953    /// # Example
10954    /// ```
10955    /// # use google_cloud_dialogflow_cx_v3::builder::intents::CancelOperation;
10956    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
10957    ///
10958    /// let builder = prepare_request_builder();
10959    /// let response = builder.send().await?;
10960    /// # Ok(()) }
10961    ///
10962    /// fn prepare_request_builder() -> CancelOperation {
10963    ///   # panic!();
10964    ///   // ... details omitted ...
10965    /// }
10966    /// ```
10967    #[derive(Clone, Debug)]
10968    pub struct CancelOperation(
10969        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10970    );
10971
10972    impl CancelOperation {
10973        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10974            Self(RequestBuilder::new(stub))
10975        }
10976
10977        /// Sets the full request, replacing any prior values.
10978        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10979            mut self,
10980            v: V,
10981        ) -> Self {
10982            self.0.request = v.into();
10983            self
10984        }
10985
10986        /// Sets all the options, replacing any prior values.
10987        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10988            self.0.options = v.into();
10989            self
10990        }
10991
10992        /// Sends the request.
10993        pub async fn send(self) -> Result<()> {
10994            (*self.0.stub)
10995                .cancel_operation(self.0.request, self.0.options)
10996                .await
10997                .map(crate::Response::into_body)
10998        }
10999
11000        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11001        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11002            self.0.request.name = v.into();
11003            self
11004        }
11005    }
11006
11007    #[doc(hidden)]
11008    impl crate::RequestBuilder for CancelOperation {
11009        fn request_options(&mut self) -> &mut crate::RequestOptions {
11010            &mut self.0.options
11011        }
11012    }
11013}
11014
11015/// Request and client builders for [Pages][crate::client::Pages].
11016#[cfg(feature = "pages")]
11017#[cfg_attr(docsrs, doc(cfg(feature = "pages")))]
11018pub mod pages {
11019    use crate::Result;
11020
11021    /// A builder for [Pages][crate::client::Pages].
11022    ///
11023    /// ```
11024    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11025    /// # use google_cloud_dialogflow_cx_v3::*;
11026    /// # use builder::pages::ClientBuilder;
11027    /// # use client::Pages;
11028    /// let builder : ClientBuilder = Pages::builder();
11029    /// let client = builder
11030    ///     .with_endpoint("https://dialogflow.googleapis.com")
11031    ///     .build().await?;
11032    /// # Ok(()) }
11033    /// ```
11034    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11035
11036    pub(crate) mod client {
11037        use super::super::super::client::Pages;
11038        pub struct Factory;
11039        impl crate::ClientFactory for Factory {
11040            type Client = Pages;
11041            type Credentials = gaxi::options::Credentials;
11042            async fn build(
11043                self,
11044                config: gaxi::options::ClientConfig,
11045            ) -> crate::ClientBuilderResult<Self::Client> {
11046                Self::Client::new(config).await
11047            }
11048        }
11049    }
11050
11051    /// Common implementation for [crate::client::Pages] request builders.
11052    #[derive(Clone, Debug)]
11053    pub(crate) struct RequestBuilder<R: std::default::Default> {
11054        stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>,
11055        request: R,
11056        options: crate::RequestOptions,
11057    }
11058
11059    impl<R> RequestBuilder<R>
11060    where
11061        R: std::default::Default,
11062    {
11063        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11064            Self {
11065                stub,
11066                request: R::default(),
11067                options: crate::RequestOptions::default(),
11068            }
11069        }
11070    }
11071
11072    /// The request builder for [Pages::list_pages][crate::client::Pages::list_pages] calls.
11073    ///
11074    /// # Example
11075    /// ```
11076    /// # use google_cloud_dialogflow_cx_v3::builder::pages::ListPages;
11077    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11078    /// use google_cloud_gax::paginator::ItemPaginator;
11079    ///
11080    /// let builder = prepare_request_builder();
11081    /// let mut items = builder.by_item();
11082    /// while let Some(result) = items.next().await {
11083    ///   let item = result?;
11084    /// }
11085    /// # Ok(()) }
11086    ///
11087    /// fn prepare_request_builder() -> ListPages {
11088    ///   # panic!();
11089    ///   // ... details omitted ...
11090    /// }
11091    /// ```
11092    #[derive(Clone, Debug)]
11093    pub struct ListPages(RequestBuilder<crate::model::ListPagesRequest>);
11094
11095    impl ListPages {
11096        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11097            Self(RequestBuilder::new(stub))
11098        }
11099
11100        /// Sets the full request, replacing any prior values.
11101        pub fn with_request<V: Into<crate::model::ListPagesRequest>>(mut self, v: V) -> Self {
11102            self.0.request = v.into();
11103            self
11104        }
11105
11106        /// Sets all the options, replacing any prior values.
11107        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11108            self.0.options = v.into();
11109            self
11110        }
11111
11112        /// Sends the request.
11113        pub async fn send(self) -> Result<crate::model::ListPagesResponse> {
11114            (*self.0.stub)
11115                .list_pages(self.0.request, self.0.options)
11116                .await
11117                .map(crate::Response::into_body)
11118        }
11119
11120        /// Streams each page in the collection.
11121        pub fn by_page(
11122            self,
11123        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPagesResponse, crate::Error>
11124        {
11125            use std::clone::Clone;
11126            let token = self.0.request.page_token.clone();
11127            let execute = move |token: String| {
11128                let mut builder = self.clone();
11129                builder.0.request = builder.0.request.set_page_token(token);
11130                builder.send()
11131            };
11132            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11133        }
11134
11135        /// Streams each item in the collection.
11136        pub fn by_item(
11137            self,
11138        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListPagesResponse, crate::Error>
11139        {
11140            use google_cloud_gax::paginator::Paginator;
11141            self.by_page().items()
11142        }
11143
11144        /// Sets the value of [parent][crate::model::ListPagesRequest::parent].
11145        ///
11146        /// This is a **required** field for requests.
11147        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11148            self.0.request.parent = v.into();
11149            self
11150        }
11151
11152        /// Sets the value of [language_code][crate::model::ListPagesRequest::language_code].
11153        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11154            self.0.request.language_code = v.into();
11155            self
11156        }
11157
11158        /// Sets the value of [page_size][crate::model::ListPagesRequest::page_size].
11159        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11160            self.0.request.page_size = v.into();
11161            self
11162        }
11163
11164        /// Sets the value of [page_token][crate::model::ListPagesRequest::page_token].
11165        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11166            self.0.request.page_token = v.into();
11167            self
11168        }
11169    }
11170
11171    #[doc(hidden)]
11172    impl crate::RequestBuilder for ListPages {
11173        fn request_options(&mut self) -> &mut crate::RequestOptions {
11174            &mut self.0.options
11175        }
11176    }
11177
11178    /// The request builder for [Pages::get_page][crate::client::Pages::get_page] calls.
11179    ///
11180    /// # Example
11181    /// ```
11182    /// # use google_cloud_dialogflow_cx_v3::builder::pages::GetPage;
11183    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11184    ///
11185    /// let builder = prepare_request_builder();
11186    /// let response = builder.send().await?;
11187    /// # Ok(()) }
11188    ///
11189    /// fn prepare_request_builder() -> GetPage {
11190    ///   # panic!();
11191    ///   // ... details omitted ...
11192    /// }
11193    /// ```
11194    #[derive(Clone, Debug)]
11195    pub struct GetPage(RequestBuilder<crate::model::GetPageRequest>);
11196
11197    impl GetPage {
11198        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11199            Self(RequestBuilder::new(stub))
11200        }
11201
11202        /// Sets the full request, replacing any prior values.
11203        pub fn with_request<V: Into<crate::model::GetPageRequest>>(mut self, v: V) -> Self {
11204            self.0.request = v.into();
11205            self
11206        }
11207
11208        /// Sets all the options, replacing any prior values.
11209        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11210            self.0.options = v.into();
11211            self
11212        }
11213
11214        /// Sends the request.
11215        pub async fn send(self) -> Result<crate::model::Page> {
11216            (*self.0.stub)
11217                .get_page(self.0.request, self.0.options)
11218                .await
11219                .map(crate::Response::into_body)
11220        }
11221
11222        /// Sets the value of [name][crate::model::GetPageRequest::name].
11223        ///
11224        /// This is a **required** field for requests.
11225        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11226            self.0.request.name = v.into();
11227            self
11228        }
11229
11230        /// Sets the value of [language_code][crate::model::GetPageRequest::language_code].
11231        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11232            self.0.request.language_code = v.into();
11233            self
11234        }
11235    }
11236
11237    #[doc(hidden)]
11238    impl crate::RequestBuilder for GetPage {
11239        fn request_options(&mut self) -> &mut crate::RequestOptions {
11240            &mut self.0.options
11241        }
11242    }
11243
11244    /// The request builder for [Pages::create_page][crate::client::Pages::create_page] calls.
11245    ///
11246    /// # Example
11247    /// ```
11248    /// # use google_cloud_dialogflow_cx_v3::builder::pages::CreatePage;
11249    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11250    ///
11251    /// let builder = prepare_request_builder();
11252    /// let response = builder.send().await?;
11253    /// # Ok(()) }
11254    ///
11255    /// fn prepare_request_builder() -> CreatePage {
11256    ///   # panic!();
11257    ///   // ... details omitted ...
11258    /// }
11259    /// ```
11260    #[derive(Clone, Debug)]
11261    pub struct CreatePage(RequestBuilder<crate::model::CreatePageRequest>);
11262
11263    impl CreatePage {
11264        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11265            Self(RequestBuilder::new(stub))
11266        }
11267
11268        /// Sets the full request, replacing any prior values.
11269        pub fn with_request<V: Into<crate::model::CreatePageRequest>>(mut self, v: V) -> Self {
11270            self.0.request = v.into();
11271            self
11272        }
11273
11274        /// Sets all the options, replacing any prior values.
11275        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11276            self.0.options = v.into();
11277            self
11278        }
11279
11280        /// Sends the request.
11281        pub async fn send(self) -> Result<crate::model::Page> {
11282            (*self.0.stub)
11283                .create_page(self.0.request, self.0.options)
11284                .await
11285                .map(crate::Response::into_body)
11286        }
11287
11288        /// Sets the value of [parent][crate::model::CreatePageRequest::parent].
11289        ///
11290        /// This is a **required** field for requests.
11291        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11292            self.0.request.parent = v.into();
11293            self
11294        }
11295
11296        /// Sets the value of [page][crate::model::CreatePageRequest::page].
11297        ///
11298        /// This is a **required** field for requests.
11299        pub fn set_page<T>(mut self, v: T) -> Self
11300        where
11301            T: std::convert::Into<crate::model::Page>,
11302        {
11303            self.0.request.page = std::option::Option::Some(v.into());
11304            self
11305        }
11306
11307        /// Sets or clears the value of [page][crate::model::CreatePageRequest::page].
11308        ///
11309        /// This is a **required** field for requests.
11310        pub fn set_or_clear_page<T>(mut self, v: std::option::Option<T>) -> Self
11311        where
11312            T: std::convert::Into<crate::model::Page>,
11313        {
11314            self.0.request.page = v.map(|x| x.into());
11315            self
11316        }
11317
11318        /// Sets the value of [language_code][crate::model::CreatePageRequest::language_code].
11319        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11320            self.0.request.language_code = v.into();
11321            self
11322        }
11323    }
11324
11325    #[doc(hidden)]
11326    impl crate::RequestBuilder for CreatePage {
11327        fn request_options(&mut self) -> &mut crate::RequestOptions {
11328            &mut self.0.options
11329        }
11330    }
11331
11332    /// The request builder for [Pages::update_page][crate::client::Pages::update_page] calls.
11333    ///
11334    /// # Example
11335    /// ```
11336    /// # use google_cloud_dialogflow_cx_v3::builder::pages::UpdatePage;
11337    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11338    ///
11339    /// let builder = prepare_request_builder();
11340    /// let response = builder.send().await?;
11341    /// # Ok(()) }
11342    ///
11343    /// fn prepare_request_builder() -> UpdatePage {
11344    ///   # panic!();
11345    ///   // ... details omitted ...
11346    /// }
11347    /// ```
11348    #[derive(Clone, Debug)]
11349    pub struct UpdatePage(RequestBuilder<crate::model::UpdatePageRequest>);
11350
11351    impl UpdatePage {
11352        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11353            Self(RequestBuilder::new(stub))
11354        }
11355
11356        /// Sets the full request, replacing any prior values.
11357        pub fn with_request<V: Into<crate::model::UpdatePageRequest>>(mut self, v: V) -> Self {
11358            self.0.request = v.into();
11359            self
11360        }
11361
11362        /// Sets all the options, replacing any prior values.
11363        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11364            self.0.options = v.into();
11365            self
11366        }
11367
11368        /// Sends the request.
11369        pub async fn send(self) -> Result<crate::model::Page> {
11370            (*self.0.stub)
11371                .update_page(self.0.request, self.0.options)
11372                .await
11373                .map(crate::Response::into_body)
11374        }
11375
11376        /// Sets the value of [page][crate::model::UpdatePageRequest::page].
11377        ///
11378        /// This is a **required** field for requests.
11379        pub fn set_page<T>(mut self, v: T) -> Self
11380        where
11381            T: std::convert::Into<crate::model::Page>,
11382        {
11383            self.0.request.page = std::option::Option::Some(v.into());
11384            self
11385        }
11386
11387        /// Sets or clears the value of [page][crate::model::UpdatePageRequest::page].
11388        ///
11389        /// This is a **required** field for requests.
11390        pub fn set_or_clear_page<T>(mut self, v: std::option::Option<T>) -> Self
11391        where
11392            T: std::convert::Into<crate::model::Page>,
11393        {
11394            self.0.request.page = v.map(|x| x.into());
11395            self
11396        }
11397
11398        /// Sets the value of [language_code][crate::model::UpdatePageRequest::language_code].
11399        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11400            self.0.request.language_code = v.into();
11401            self
11402        }
11403
11404        /// Sets the value of [update_mask][crate::model::UpdatePageRequest::update_mask].
11405        pub fn set_update_mask<T>(mut self, v: T) -> Self
11406        where
11407            T: std::convert::Into<wkt::FieldMask>,
11408        {
11409            self.0.request.update_mask = std::option::Option::Some(v.into());
11410            self
11411        }
11412
11413        /// Sets or clears the value of [update_mask][crate::model::UpdatePageRequest::update_mask].
11414        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11415        where
11416            T: std::convert::Into<wkt::FieldMask>,
11417        {
11418            self.0.request.update_mask = v.map(|x| x.into());
11419            self
11420        }
11421    }
11422
11423    #[doc(hidden)]
11424    impl crate::RequestBuilder for UpdatePage {
11425        fn request_options(&mut self) -> &mut crate::RequestOptions {
11426            &mut self.0.options
11427        }
11428    }
11429
11430    /// The request builder for [Pages::delete_page][crate::client::Pages::delete_page] calls.
11431    ///
11432    /// # Example
11433    /// ```
11434    /// # use google_cloud_dialogflow_cx_v3::builder::pages::DeletePage;
11435    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11436    ///
11437    /// let builder = prepare_request_builder();
11438    /// let response = builder.send().await?;
11439    /// # Ok(()) }
11440    ///
11441    /// fn prepare_request_builder() -> DeletePage {
11442    ///   # panic!();
11443    ///   // ... details omitted ...
11444    /// }
11445    /// ```
11446    #[derive(Clone, Debug)]
11447    pub struct DeletePage(RequestBuilder<crate::model::DeletePageRequest>);
11448
11449    impl DeletePage {
11450        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11451            Self(RequestBuilder::new(stub))
11452        }
11453
11454        /// Sets the full request, replacing any prior values.
11455        pub fn with_request<V: Into<crate::model::DeletePageRequest>>(mut self, v: V) -> Self {
11456            self.0.request = v.into();
11457            self
11458        }
11459
11460        /// Sets all the options, replacing any prior values.
11461        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11462            self.0.options = v.into();
11463            self
11464        }
11465
11466        /// Sends the request.
11467        pub async fn send(self) -> Result<()> {
11468            (*self.0.stub)
11469                .delete_page(self.0.request, self.0.options)
11470                .await
11471                .map(crate::Response::into_body)
11472        }
11473
11474        /// Sets the value of [name][crate::model::DeletePageRequest::name].
11475        ///
11476        /// This is a **required** field for requests.
11477        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11478            self.0.request.name = v.into();
11479            self
11480        }
11481
11482        /// Sets the value of [force][crate::model::DeletePageRequest::force].
11483        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
11484            self.0.request.force = v.into();
11485            self
11486        }
11487    }
11488
11489    #[doc(hidden)]
11490    impl crate::RequestBuilder for DeletePage {
11491        fn request_options(&mut self) -> &mut crate::RequestOptions {
11492            &mut self.0.options
11493        }
11494    }
11495
11496    /// The request builder for [Pages::list_locations][crate::client::Pages::list_locations] calls.
11497    ///
11498    /// # Example
11499    /// ```
11500    /// # use google_cloud_dialogflow_cx_v3::builder::pages::ListLocations;
11501    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11502    /// use google_cloud_gax::paginator::ItemPaginator;
11503    ///
11504    /// let builder = prepare_request_builder();
11505    /// let mut items = builder.by_item();
11506    /// while let Some(result) = items.next().await {
11507    ///   let item = result?;
11508    /// }
11509    /// # Ok(()) }
11510    ///
11511    /// fn prepare_request_builder() -> ListLocations {
11512    ///   # panic!();
11513    ///   // ... details omitted ...
11514    /// }
11515    /// ```
11516    #[derive(Clone, Debug)]
11517    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
11518
11519    impl ListLocations {
11520        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11521            Self(RequestBuilder::new(stub))
11522        }
11523
11524        /// Sets the full request, replacing any prior values.
11525        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
11526            mut self,
11527            v: V,
11528        ) -> Self {
11529            self.0.request = v.into();
11530            self
11531        }
11532
11533        /// Sets all the options, replacing any prior values.
11534        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11535            self.0.options = v.into();
11536            self
11537        }
11538
11539        /// Sends the request.
11540        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
11541            (*self.0.stub)
11542                .list_locations(self.0.request, self.0.options)
11543                .await
11544                .map(crate::Response::into_body)
11545        }
11546
11547        /// Streams each page in the collection.
11548        pub fn by_page(
11549            self,
11550        ) -> impl google_cloud_gax::paginator::Paginator<
11551            google_cloud_location::model::ListLocationsResponse,
11552            crate::Error,
11553        > {
11554            use std::clone::Clone;
11555            let token = self.0.request.page_token.clone();
11556            let execute = move |token: String| {
11557                let mut builder = self.clone();
11558                builder.0.request = builder.0.request.set_page_token(token);
11559                builder.send()
11560            };
11561            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11562        }
11563
11564        /// Streams each item in the collection.
11565        pub fn by_item(
11566            self,
11567        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11568            google_cloud_location::model::ListLocationsResponse,
11569            crate::Error,
11570        > {
11571            use google_cloud_gax::paginator::Paginator;
11572            self.by_page().items()
11573        }
11574
11575        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
11576        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11577            self.0.request.name = v.into();
11578            self
11579        }
11580
11581        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
11582        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11583            self.0.request.filter = v.into();
11584            self
11585        }
11586
11587        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
11588        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11589            self.0.request.page_size = v.into();
11590            self
11591        }
11592
11593        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
11594        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11595            self.0.request.page_token = v.into();
11596            self
11597        }
11598    }
11599
11600    #[doc(hidden)]
11601    impl crate::RequestBuilder for ListLocations {
11602        fn request_options(&mut self) -> &mut crate::RequestOptions {
11603            &mut self.0.options
11604        }
11605    }
11606
11607    /// The request builder for [Pages::get_location][crate::client::Pages::get_location] calls.
11608    ///
11609    /// # Example
11610    /// ```
11611    /// # use google_cloud_dialogflow_cx_v3::builder::pages::GetLocation;
11612    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11613    ///
11614    /// let builder = prepare_request_builder();
11615    /// let response = builder.send().await?;
11616    /// # Ok(()) }
11617    ///
11618    /// fn prepare_request_builder() -> GetLocation {
11619    ///   # panic!();
11620    ///   // ... details omitted ...
11621    /// }
11622    /// ```
11623    #[derive(Clone, Debug)]
11624    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
11625
11626    impl GetLocation {
11627        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11628            Self(RequestBuilder::new(stub))
11629        }
11630
11631        /// Sets the full request, replacing any prior values.
11632        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
11633            mut self,
11634            v: V,
11635        ) -> Self {
11636            self.0.request = v.into();
11637            self
11638        }
11639
11640        /// Sets all the options, replacing any prior values.
11641        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11642            self.0.options = v.into();
11643            self
11644        }
11645
11646        /// Sends the request.
11647        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
11648            (*self.0.stub)
11649                .get_location(self.0.request, self.0.options)
11650                .await
11651                .map(crate::Response::into_body)
11652        }
11653
11654        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
11655        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11656            self.0.request.name = v.into();
11657            self
11658        }
11659    }
11660
11661    #[doc(hidden)]
11662    impl crate::RequestBuilder for GetLocation {
11663        fn request_options(&mut self) -> &mut crate::RequestOptions {
11664            &mut self.0.options
11665        }
11666    }
11667
11668    /// The request builder for [Pages::list_operations][crate::client::Pages::list_operations] calls.
11669    ///
11670    /// # Example
11671    /// ```
11672    /// # use google_cloud_dialogflow_cx_v3::builder::pages::ListOperations;
11673    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11674    /// use google_cloud_gax::paginator::ItemPaginator;
11675    ///
11676    /// let builder = prepare_request_builder();
11677    /// let mut items = builder.by_item();
11678    /// while let Some(result) = items.next().await {
11679    ///   let item = result?;
11680    /// }
11681    /// # Ok(()) }
11682    ///
11683    /// fn prepare_request_builder() -> ListOperations {
11684    ///   # panic!();
11685    ///   // ... details omitted ...
11686    /// }
11687    /// ```
11688    #[derive(Clone, Debug)]
11689    pub struct ListOperations(
11690        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11691    );
11692
11693    impl ListOperations {
11694        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11695            Self(RequestBuilder::new(stub))
11696        }
11697
11698        /// Sets the full request, replacing any prior values.
11699        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11700            mut self,
11701            v: V,
11702        ) -> Self {
11703            self.0.request = v.into();
11704            self
11705        }
11706
11707        /// Sets all the options, replacing any prior values.
11708        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11709            self.0.options = v.into();
11710            self
11711        }
11712
11713        /// Sends the request.
11714        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11715            (*self.0.stub)
11716                .list_operations(self.0.request, self.0.options)
11717                .await
11718                .map(crate::Response::into_body)
11719        }
11720
11721        /// Streams each page in the collection.
11722        pub fn by_page(
11723            self,
11724        ) -> impl google_cloud_gax::paginator::Paginator<
11725            google_cloud_longrunning::model::ListOperationsResponse,
11726            crate::Error,
11727        > {
11728            use std::clone::Clone;
11729            let token = self.0.request.page_token.clone();
11730            let execute = move |token: String| {
11731                let mut builder = self.clone();
11732                builder.0.request = builder.0.request.set_page_token(token);
11733                builder.send()
11734            };
11735            google_cloud_gax::paginator::internal::new_paginator(token, execute)
11736        }
11737
11738        /// Streams each item in the collection.
11739        pub fn by_item(
11740            self,
11741        ) -> impl google_cloud_gax::paginator::ItemPaginator<
11742            google_cloud_longrunning::model::ListOperationsResponse,
11743            crate::Error,
11744        > {
11745            use google_cloud_gax::paginator::Paginator;
11746            self.by_page().items()
11747        }
11748
11749        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
11750        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11751            self.0.request.name = v.into();
11752            self
11753        }
11754
11755        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
11756        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11757            self.0.request.filter = v.into();
11758            self
11759        }
11760
11761        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
11762        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11763            self.0.request.page_size = v.into();
11764            self
11765        }
11766
11767        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
11768        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11769            self.0.request.page_token = v.into();
11770            self
11771        }
11772
11773        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
11774        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11775            self.0.request.return_partial_success = v.into();
11776            self
11777        }
11778    }
11779
11780    #[doc(hidden)]
11781    impl crate::RequestBuilder for ListOperations {
11782        fn request_options(&mut self) -> &mut crate::RequestOptions {
11783            &mut self.0.options
11784        }
11785    }
11786
11787    /// The request builder for [Pages::get_operation][crate::client::Pages::get_operation] calls.
11788    ///
11789    /// # Example
11790    /// ```
11791    /// # use google_cloud_dialogflow_cx_v3::builder::pages::GetOperation;
11792    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11793    ///
11794    /// let builder = prepare_request_builder();
11795    /// let response = builder.send().await?;
11796    /// # Ok(()) }
11797    ///
11798    /// fn prepare_request_builder() -> GetOperation {
11799    ///   # panic!();
11800    ///   // ... details omitted ...
11801    /// }
11802    /// ```
11803    #[derive(Clone, Debug)]
11804    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11805
11806    impl GetOperation {
11807        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11808            Self(RequestBuilder::new(stub))
11809        }
11810
11811        /// Sets the full request, replacing any prior values.
11812        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11813            mut self,
11814            v: V,
11815        ) -> Self {
11816            self.0.request = v.into();
11817            self
11818        }
11819
11820        /// Sets all the options, replacing any prior values.
11821        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11822            self.0.options = v.into();
11823            self
11824        }
11825
11826        /// Sends the request.
11827        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11828            (*self.0.stub)
11829                .get_operation(self.0.request, self.0.options)
11830                .await
11831                .map(crate::Response::into_body)
11832        }
11833
11834        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
11835        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11836            self.0.request.name = v.into();
11837            self
11838        }
11839    }
11840
11841    #[doc(hidden)]
11842    impl crate::RequestBuilder for GetOperation {
11843        fn request_options(&mut self) -> &mut crate::RequestOptions {
11844            &mut self.0.options
11845        }
11846    }
11847
11848    /// The request builder for [Pages::cancel_operation][crate::client::Pages::cancel_operation] calls.
11849    ///
11850    /// # Example
11851    /// ```
11852    /// # use google_cloud_dialogflow_cx_v3::builder::pages::CancelOperation;
11853    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11854    ///
11855    /// let builder = prepare_request_builder();
11856    /// let response = builder.send().await?;
11857    /// # Ok(()) }
11858    ///
11859    /// fn prepare_request_builder() -> CancelOperation {
11860    ///   # panic!();
11861    ///   // ... details omitted ...
11862    /// }
11863    /// ```
11864    #[derive(Clone, Debug)]
11865    pub struct CancelOperation(
11866        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11867    );
11868
11869    impl CancelOperation {
11870        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11871            Self(RequestBuilder::new(stub))
11872        }
11873
11874        /// Sets the full request, replacing any prior values.
11875        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11876            mut self,
11877            v: V,
11878        ) -> Self {
11879            self.0.request = v.into();
11880            self
11881        }
11882
11883        /// Sets all the options, replacing any prior values.
11884        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11885            self.0.options = v.into();
11886            self
11887        }
11888
11889        /// Sends the request.
11890        pub async fn send(self) -> Result<()> {
11891            (*self.0.stub)
11892                .cancel_operation(self.0.request, self.0.options)
11893                .await
11894                .map(crate::Response::into_body)
11895        }
11896
11897        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
11898        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11899            self.0.request.name = v.into();
11900            self
11901        }
11902    }
11903
11904    #[doc(hidden)]
11905    impl crate::RequestBuilder for CancelOperation {
11906        fn request_options(&mut self) -> &mut crate::RequestOptions {
11907            &mut self.0.options
11908        }
11909    }
11910}
11911
11912/// Request and client builders for [Playbooks][crate::client::Playbooks].
11913#[cfg(feature = "playbooks")]
11914#[cfg_attr(docsrs, doc(cfg(feature = "playbooks")))]
11915pub mod playbooks {
11916    use crate::Result;
11917
11918    /// A builder for [Playbooks][crate::client::Playbooks].
11919    ///
11920    /// ```
11921    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
11922    /// # use google_cloud_dialogflow_cx_v3::*;
11923    /// # use builder::playbooks::ClientBuilder;
11924    /// # use client::Playbooks;
11925    /// let builder : ClientBuilder = Playbooks::builder();
11926    /// let client = builder
11927    ///     .with_endpoint("https://dialogflow.googleapis.com")
11928    ///     .build().await?;
11929    /// # Ok(()) }
11930    /// ```
11931    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11932
11933    pub(crate) mod client {
11934        use super::super::super::client::Playbooks;
11935        pub struct Factory;
11936        impl crate::ClientFactory for Factory {
11937            type Client = Playbooks;
11938            type Credentials = gaxi::options::Credentials;
11939            async fn build(
11940                self,
11941                config: gaxi::options::ClientConfig,
11942            ) -> crate::ClientBuilderResult<Self::Client> {
11943                Self::Client::new(config).await
11944            }
11945        }
11946    }
11947
11948    /// Common implementation for [crate::client::Playbooks] request builders.
11949    #[derive(Clone, Debug)]
11950    pub(crate) struct RequestBuilder<R: std::default::Default> {
11951        stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
11952        request: R,
11953        options: crate::RequestOptions,
11954    }
11955
11956    impl<R> RequestBuilder<R>
11957    where
11958        R: std::default::Default,
11959    {
11960        pub(crate) fn new(
11961            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
11962        ) -> Self {
11963            Self {
11964                stub,
11965                request: R::default(),
11966                options: crate::RequestOptions::default(),
11967            }
11968        }
11969    }
11970
11971    /// The request builder for [Playbooks::create_playbook][crate::client::Playbooks::create_playbook] calls.
11972    ///
11973    /// # Example
11974    /// ```
11975    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::CreatePlaybook;
11976    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
11977    ///
11978    /// let builder = prepare_request_builder();
11979    /// let response = builder.send().await?;
11980    /// # Ok(()) }
11981    ///
11982    /// fn prepare_request_builder() -> CreatePlaybook {
11983    ///   # panic!();
11984    ///   // ... details omitted ...
11985    /// }
11986    /// ```
11987    #[derive(Clone, Debug)]
11988    pub struct CreatePlaybook(RequestBuilder<crate::model::CreatePlaybookRequest>);
11989
11990    impl CreatePlaybook {
11991        pub(crate) fn new(
11992            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
11993        ) -> Self {
11994            Self(RequestBuilder::new(stub))
11995        }
11996
11997        /// Sets the full request, replacing any prior values.
11998        pub fn with_request<V: Into<crate::model::CreatePlaybookRequest>>(mut self, v: V) -> Self {
11999            self.0.request = v.into();
12000            self
12001        }
12002
12003        /// Sets all the options, replacing any prior values.
12004        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12005            self.0.options = v.into();
12006            self
12007        }
12008
12009        /// Sends the request.
12010        pub async fn send(self) -> Result<crate::model::Playbook> {
12011            (*self.0.stub)
12012                .create_playbook(self.0.request, self.0.options)
12013                .await
12014                .map(crate::Response::into_body)
12015        }
12016
12017        /// Sets the value of [parent][crate::model::CreatePlaybookRequest::parent].
12018        ///
12019        /// This is a **required** field for requests.
12020        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12021            self.0.request.parent = v.into();
12022            self
12023        }
12024
12025        /// Sets the value of [playbook][crate::model::CreatePlaybookRequest::playbook].
12026        ///
12027        /// This is a **required** field for requests.
12028        pub fn set_playbook<T>(mut self, v: T) -> Self
12029        where
12030            T: std::convert::Into<crate::model::Playbook>,
12031        {
12032            self.0.request.playbook = std::option::Option::Some(v.into());
12033            self
12034        }
12035
12036        /// Sets or clears the value of [playbook][crate::model::CreatePlaybookRequest::playbook].
12037        ///
12038        /// This is a **required** field for requests.
12039        pub fn set_or_clear_playbook<T>(mut self, v: std::option::Option<T>) -> Self
12040        where
12041            T: std::convert::Into<crate::model::Playbook>,
12042        {
12043            self.0.request.playbook = v.map(|x| x.into());
12044            self
12045        }
12046    }
12047
12048    #[doc(hidden)]
12049    impl crate::RequestBuilder for CreatePlaybook {
12050        fn request_options(&mut self) -> &mut crate::RequestOptions {
12051            &mut self.0.options
12052        }
12053    }
12054
12055    /// The request builder for [Playbooks::delete_playbook][crate::client::Playbooks::delete_playbook] calls.
12056    ///
12057    /// # Example
12058    /// ```
12059    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::DeletePlaybook;
12060    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12061    ///
12062    /// let builder = prepare_request_builder();
12063    /// let response = builder.send().await?;
12064    /// # Ok(()) }
12065    ///
12066    /// fn prepare_request_builder() -> DeletePlaybook {
12067    ///   # panic!();
12068    ///   // ... details omitted ...
12069    /// }
12070    /// ```
12071    #[derive(Clone, Debug)]
12072    pub struct DeletePlaybook(RequestBuilder<crate::model::DeletePlaybookRequest>);
12073
12074    impl DeletePlaybook {
12075        pub(crate) fn new(
12076            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12077        ) -> Self {
12078            Self(RequestBuilder::new(stub))
12079        }
12080
12081        /// Sets the full request, replacing any prior values.
12082        pub fn with_request<V: Into<crate::model::DeletePlaybookRequest>>(mut self, v: V) -> Self {
12083            self.0.request = v.into();
12084            self
12085        }
12086
12087        /// Sets all the options, replacing any prior values.
12088        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12089            self.0.options = v.into();
12090            self
12091        }
12092
12093        /// Sends the request.
12094        pub async fn send(self) -> Result<()> {
12095            (*self.0.stub)
12096                .delete_playbook(self.0.request, self.0.options)
12097                .await
12098                .map(crate::Response::into_body)
12099        }
12100
12101        /// Sets the value of [name][crate::model::DeletePlaybookRequest::name].
12102        ///
12103        /// This is a **required** field for requests.
12104        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12105            self.0.request.name = v.into();
12106            self
12107        }
12108    }
12109
12110    #[doc(hidden)]
12111    impl crate::RequestBuilder for DeletePlaybook {
12112        fn request_options(&mut self) -> &mut crate::RequestOptions {
12113            &mut self.0.options
12114        }
12115    }
12116
12117    /// The request builder for [Playbooks::list_playbooks][crate::client::Playbooks::list_playbooks] calls.
12118    ///
12119    /// # Example
12120    /// ```
12121    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::ListPlaybooks;
12122    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12123    /// use google_cloud_gax::paginator::ItemPaginator;
12124    ///
12125    /// let builder = prepare_request_builder();
12126    /// let mut items = builder.by_item();
12127    /// while let Some(result) = items.next().await {
12128    ///   let item = result?;
12129    /// }
12130    /// # Ok(()) }
12131    ///
12132    /// fn prepare_request_builder() -> ListPlaybooks {
12133    ///   # panic!();
12134    ///   // ... details omitted ...
12135    /// }
12136    /// ```
12137    #[derive(Clone, Debug)]
12138    pub struct ListPlaybooks(RequestBuilder<crate::model::ListPlaybooksRequest>);
12139
12140    impl ListPlaybooks {
12141        pub(crate) fn new(
12142            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12143        ) -> Self {
12144            Self(RequestBuilder::new(stub))
12145        }
12146
12147        /// Sets the full request, replacing any prior values.
12148        pub fn with_request<V: Into<crate::model::ListPlaybooksRequest>>(mut self, v: V) -> Self {
12149            self.0.request = v.into();
12150            self
12151        }
12152
12153        /// Sets all the options, replacing any prior values.
12154        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12155            self.0.options = v.into();
12156            self
12157        }
12158
12159        /// Sends the request.
12160        pub async fn send(self) -> Result<crate::model::ListPlaybooksResponse> {
12161            (*self.0.stub)
12162                .list_playbooks(self.0.request, self.0.options)
12163                .await
12164                .map(crate::Response::into_body)
12165        }
12166
12167        /// Streams each page in the collection.
12168        pub fn by_page(
12169            self,
12170        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPlaybooksResponse, crate::Error>
12171        {
12172            use std::clone::Clone;
12173            let token = self.0.request.page_token.clone();
12174            let execute = move |token: String| {
12175                let mut builder = self.clone();
12176                builder.0.request = builder.0.request.set_page_token(token);
12177                builder.send()
12178            };
12179            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12180        }
12181
12182        /// Streams each item in the collection.
12183        pub fn by_item(
12184            self,
12185        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12186            crate::model::ListPlaybooksResponse,
12187            crate::Error,
12188        > {
12189            use google_cloud_gax::paginator::Paginator;
12190            self.by_page().items()
12191        }
12192
12193        /// Sets the value of [parent][crate::model::ListPlaybooksRequest::parent].
12194        ///
12195        /// This is a **required** field for requests.
12196        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12197            self.0.request.parent = v.into();
12198            self
12199        }
12200
12201        /// Sets the value of [page_size][crate::model::ListPlaybooksRequest::page_size].
12202        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12203            self.0.request.page_size = v.into();
12204            self
12205        }
12206
12207        /// Sets the value of [page_token][crate::model::ListPlaybooksRequest::page_token].
12208        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12209            self.0.request.page_token = v.into();
12210            self
12211        }
12212    }
12213
12214    #[doc(hidden)]
12215    impl crate::RequestBuilder for ListPlaybooks {
12216        fn request_options(&mut self) -> &mut crate::RequestOptions {
12217            &mut self.0.options
12218        }
12219    }
12220
12221    /// The request builder for [Playbooks::get_playbook][crate::client::Playbooks::get_playbook] calls.
12222    ///
12223    /// # Example
12224    /// ```
12225    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::GetPlaybook;
12226    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12227    ///
12228    /// let builder = prepare_request_builder();
12229    /// let response = builder.send().await?;
12230    /// # Ok(()) }
12231    ///
12232    /// fn prepare_request_builder() -> GetPlaybook {
12233    ///   # panic!();
12234    ///   // ... details omitted ...
12235    /// }
12236    /// ```
12237    #[derive(Clone, Debug)]
12238    pub struct GetPlaybook(RequestBuilder<crate::model::GetPlaybookRequest>);
12239
12240    impl GetPlaybook {
12241        pub(crate) fn new(
12242            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12243        ) -> Self {
12244            Self(RequestBuilder::new(stub))
12245        }
12246
12247        /// Sets the full request, replacing any prior values.
12248        pub fn with_request<V: Into<crate::model::GetPlaybookRequest>>(mut self, v: V) -> Self {
12249            self.0.request = v.into();
12250            self
12251        }
12252
12253        /// Sets all the options, replacing any prior values.
12254        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12255            self.0.options = v.into();
12256            self
12257        }
12258
12259        /// Sends the request.
12260        pub async fn send(self) -> Result<crate::model::Playbook> {
12261            (*self.0.stub)
12262                .get_playbook(self.0.request, self.0.options)
12263                .await
12264                .map(crate::Response::into_body)
12265        }
12266
12267        /// Sets the value of [name][crate::model::GetPlaybookRequest::name].
12268        ///
12269        /// This is a **required** field for requests.
12270        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12271            self.0.request.name = v.into();
12272            self
12273        }
12274    }
12275
12276    #[doc(hidden)]
12277    impl crate::RequestBuilder for GetPlaybook {
12278        fn request_options(&mut self) -> &mut crate::RequestOptions {
12279            &mut self.0.options
12280        }
12281    }
12282
12283    /// The request builder for [Playbooks::export_playbook][crate::client::Playbooks::export_playbook] calls.
12284    ///
12285    /// # Example
12286    /// ```
12287    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::ExportPlaybook;
12288    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12289    /// use google_cloud_lro::Poller;
12290    ///
12291    /// let builder = prepare_request_builder();
12292    /// let response = builder.poller().until_done().await?;
12293    /// # Ok(()) }
12294    ///
12295    /// fn prepare_request_builder() -> ExportPlaybook {
12296    ///   # panic!();
12297    ///   // ... details omitted ...
12298    /// }
12299    /// ```
12300    #[derive(Clone, Debug)]
12301    pub struct ExportPlaybook(RequestBuilder<crate::model::ExportPlaybookRequest>);
12302
12303    impl ExportPlaybook {
12304        pub(crate) fn new(
12305            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12306        ) -> Self {
12307            Self(RequestBuilder::new(stub))
12308        }
12309
12310        /// Sets the full request, replacing any prior values.
12311        pub fn with_request<V: Into<crate::model::ExportPlaybookRequest>>(mut self, v: V) -> Self {
12312            self.0.request = v.into();
12313            self
12314        }
12315
12316        /// Sets all the options, replacing any prior values.
12317        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12318            self.0.options = v.into();
12319            self
12320        }
12321
12322        /// Sends the request.
12323        ///
12324        /// # Long running operations
12325        ///
12326        /// This starts, but does not poll, a longrunning operation. More information
12327        /// on [export_playbook][crate::client::Playbooks::export_playbook].
12328        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12329            (*self.0.stub)
12330                .export_playbook(self.0.request, self.0.options)
12331                .await
12332                .map(crate::Response::into_body)
12333        }
12334
12335        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_playbook`.
12336        pub fn poller(
12337            self,
12338        ) -> impl google_cloud_lro::Poller<crate::model::ExportPlaybookResponse, wkt::Struct>
12339        {
12340            type Operation = google_cloud_lro::internal::Operation<
12341                crate::model::ExportPlaybookResponse,
12342                wkt::Struct,
12343            >;
12344            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12345            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12346
12347            let stub = self.0.stub.clone();
12348            let mut options = self.0.options.clone();
12349            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12350            let query = move |name| {
12351                let stub = stub.clone();
12352                let options = options.clone();
12353                async {
12354                    let op = GetOperation::new(stub)
12355                        .set_name(name)
12356                        .with_options(options)
12357                        .send()
12358                        .await?;
12359                    Ok(Operation::new(op))
12360                }
12361            };
12362
12363            let start = move || async {
12364                let op = self.send().await?;
12365                Ok(Operation::new(op))
12366            };
12367
12368            google_cloud_lro::internal::new_poller(
12369                polling_error_policy,
12370                polling_backoff_policy,
12371                start,
12372                query,
12373            )
12374        }
12375
12376        /// Sets the value of [name][crate::model::ExportPlaybookRequest::name].
12377        ///
12378        /// This is a **required** field for requests.
12379        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12380            self.0.request.name = v.into();
12381            self
12382        }
12383
12384        /// Sets the value of [playbook_uri][crate::model::ExportPlaybookRequest::playbook_uri].
12385        pub fn set_playbook_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
12386            self.0.request.playbook_uri = v.into();
12387            self
12388        }
12389
12390        /// Sets the value of [data_format][crate::model::ExportPlaybookRequest::data_format].
12391        pub fn set_data_format<T: Into<crate::model::export_playbook_request::DataFormat>>(
12392            mut self,
12393            v: T,
12394        ) -> Self {
12395            self.0.request.data_format = v.into();
12396            self
12397        }
12398    }
12399
12400    #[doc(hidden)]
12401    impl crate::RequestBuilder for ExportPlaybook {
12402        fn request_options(&mut self) -> &mut crate::RequestOptions {
12403            &mut self.0.options
12404        }
12405    }
12406
12407    /// The request builder for [Playbooks::import_playbook][crate::client::Playbooks::import_playbook] calls.
12408    ///
12409    /// # Example
12410    /// ```
12411    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::ImportPlaybook;
12412    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12413    /// use google_cloud_lro::Poller;
12414    ///
12415    /// let builder = prepare_request_builder();
12416    /// let response = builder.poller().until_done().await?;
12417    /// # Ok(()) }
12418    ///
12419    /// fn prepare_request_builder() -> ImportPlaybook {
12420    ///   # panic!();
12421    ///   // ... details omitted ...
12422    /// }
12423    /// ```
12424    #[derive(Clone, Debug)]
12425    pub struct ImportPlaybook(RequestBuilder<crate::model::ImportPlaybookRequest>);
12426
12427    impl ImportPlaybook {
12428        pub(crate) fn new(
12429            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12430        ) -> Self {
12431            Self(RequestBuilder::new(stub))
12432        }
12433
12434        /// Sets the full request, replacing any prior values.
12435        pub fn with_request<V: Into<crate::model::ImportPlaybookRequest>>(mut self, v: V) -> Self {
12436            self.0.request = v.into();
12437            self
12438        }
12439
12440        /// Sets all the options, replacing any prior values.
12441        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12442            self.0.options = v.into();
12443            self
12444        }
12445
12446        /// Sends the request.
12447        ///
12448        /// # Long running operations
12449        ///
12450        /// This starts, but does not poll, a longrunning operation. More information
12451        /// on [import_playbook][crate::client::Playbooks::import_playbook].
12452        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12453            (*self.0.stub)
12454                .import_playbook(self.0.request, self.0.options)
12455                .await
12456                .map(crate::Response::into_body)
12457        }
12458
12459        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_playbook`.
12460        pub fn poller(
12461            self,
12462        ) -> impl google_cloud_lro::Poller<crate::model::ImportPlaybookResponse, wkt::Struct>
12463        {
12464            type Operation = google_cloud_lro::internal::Operation<
12465                crate::model::ImportPlaybookResponse,
12466                wkt::Struct,
12467            >;
12468            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12469            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12470
12471            let stub = self.0.stub.clone();
12472            let mut options = self.0.options.clone();
12473            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12474            let query = move |name| {
12475                let stub = stub.clone();
12476                let options = options.clone();
12477                async {
12478                    let op = GetOperation::new(stub)
12479                        .set_name(name)
12480                        .with_options(options)
12481                        .send()
12482                        .await?;
12483                    Ok(Operation::new(op))
12484                }
12485            };
12486
12487            let start = move || async {
12488                let op = self.send().await?;
12489                Ok(Operation::new(op))
12490            };
12491
12492            google_cloud_lro::internal::new_poller(
12493                polling_error_policy,
12494                polling_backoff_policy,
12495                start,
12496                query,
12497            )
12498        }
12499
12500        /// Sets the value of [parent][crate::model::ImportPlaybookRequest::parent].
12501        ///
12502        /// This is a **required** field for requests.
12503        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12504            self.0.request.parent = v.into();
12505            self
12506        }
12507
12508        /// Sets the value of [import_strategy][crate::model::ImportPlaybookRequest::import_strategy].
12509        pub fn set_import_strategy<T>(mut self, v: T) -> Self
12510        where
12511            T: std::convert::Into<crate::model::PlaybookImportStrategy>,
12512        {
12513            self.0.request.import_strategy = std::option::Option::Some(v.into());
12514            self
12515        }
12516
12517        /// Sets or clears the value of [import_strategy][crate::model::ImportPlaybookRequest::import_strategy].
12518        pub fn set_or_clear_import_strategy<T>(mut self, v: std::option::Option<T>) -> Self
12519        where
12520            T: std::convert::Into<crate::model::PlaybookImportStrategy>,
12521        {
12522            self.0.request.import_strategy = v.map(|x| x.into());
12523            self
12524        }
12525
12526        /// Sets the value of [playbook][crate::model::ImportPlaybookRequest::playbook].
12527        ///
12528        /// Note that all the setters affecting `playbook` are
12529        /// mutually exclusive.
12530        pub fn set_playbook<T: Into<Option<crate::model::import_playbook_request::Playbook>>>(
12531            mut self,
12532            v: T,
12533        ) -> Self {
12534            self.0.request.playbook = v.into();
12535            self
12536        }
12537
12538        /// Sets the value of [playbook][crate::model::ImportPlaybookRequest::playbook]
12539        /// to hold a `PlaybookUri`.
12540        ///
12541        /// Note that all the setters affecting `playbook` are
12542        /// mutually exclusive.
12543        pub fn set_playbook_uri<T: std::convert::Into<std::string::String>>(
12544            mut self,
12545            v: T,
12546        ) -> Self {
12547            self.0.request = self.0.request.set_playbook_uri(v);
12548            self
12549        }
12550
12551        /// Sets the value of [playbook][crate::model::ImportPlaybookRequest::playbook]
12552        /// to hold a `PlaybookContent`.
12553        ///
12554        /// Note that all the setters affecting `playbook` are
12555        /// mutually exclusive.
12556        pub fn set_playbook_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
12557            self.0.request = self.0.request.set_playbook_content(v);
12558            self
12559        }
12560    }
12561
12562    #[doc(hidden)]
12563    impl crate::RequestBuilder for ImportPlaybook {
12564        fn request_options(&mut self) -> &mut crate::RequestOptions {
12565            &mut self.0.options
12566        }
12567    }
12568
12569    /// The request builder for [Playbooks::update_playbook][crate::client::Playbooks::update_playbook] calls.
12570    ///
12571    /// # Example
12572    /// ```
12573    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::UpdatePlaybook;
12574    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12575    ///
12576    /// let builder = prepare_request_builder();
12577    /// let response = builder.send().await?;
12578    /// # Ok(()) }
12579    ///
12580    /// fn prepare_request_builder() -> UpdatePlaybook {
12581    ///   # panic!();
12582    ///   // ... details omitted ...
12583    /// }
12584    /// ```
12585    #[derive(Clone, Debug)]
12586    pub struct UpdatePlaybook(RequestBuilder<crate::model::UpdatePlaybookRequest>);
12587
12588    impl UpdatePlaybook {
12589        pub(crate) fn new(
12590            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12591        ) -> Self {
12592            Self(RequestBuilder::new(stub))
12593        }
12594
12595        /// Sets the full request, replacing any prior values.
12596        pub fn with_request<V: Into<crate::model::UpdatePlaybookRequest>>(mut self, v: V) -> Self {
12597            self.0.request = v.into();
12598            self
12599        }
12600
12601        /// Sets all the options, replacing any prior values.
12602        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12603            self.0.options = v.into();
12604            self
12605        }
12606
12607        /// Sends the request.
12608        pub async fn send(self) -> Result<crate::model::Playbook> {
12609            (*self.0.stub)
12610                .update_playbook(self.0.request, self.0.options)
12611                .await
12612                .map(crate::Response::into_body)
12613        }
12614
12615        /// Sets the value of [playbook][crate::model::UpdatePlaybookRequest::playbook].
12616        ///
12617        /// This is a **required** field for requests.
12618        pub fn set_playbook<T>(mut self, v: T) -> Self
12619        where
12620            T: std::convert::Into<crate::model::Playbook>,
12621        {
12622            self.0.request.playbook = std::option::Option::Some(v.into());
12623            self
12624        }
12625
12626        /// Sets or clears the value of [playbook][crate::model::UpdatePlaybookRequest::playbook].
12627        ///
12628        /// This is a **required** field for requests.
12629        pub fn set_or_clear_playbook<T>(mut self, v: std::option::Option<T>) -> Self
12630        where
12631            T: std::convert::Into<crate::model::Playbook>,
12632        {
12633            self.0.request.playbook = v.map(|x| x.into());
12634            self
12635        }
12636
12637        /// Sets the value of [update_mask][crate::model::UpdatePlaybookRequest::update_mask].
12638        pub fn set_update_mask<T>(mut self, v: T) -> Self
12639        where
12640            T: std::convert::Into<wkt::FieldMask>,
12641        {
12642            self.0.request.update_mask = std::option::Option::Some(v.into());
12643            self
12644        }
12645
12646        /// Sets or clears the value of [update_mask][crate::model::UpdatePlaybookRequest::update_mask].
12647        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12648        where
12649            T: std::convert::Into<wkt::FieldMask>,
12650        {
12651            self.0.request.update_mask = v.map(|x| x.into());
12652            self
12653        }
12654    }
12655
12656    #[doc(hidden)]
12657    impl crate::RequestBuilder for UpdatePlaybook {
12658        fn request_options(&mut self) -> &mut crate::RequestOptions {
12659            &mut self.0.options
12660        }
12661    }
12662
12663    /// The request builder for [Playbooks::create_playbook_version][crate::client::Playbooks::create_playbook_version] calls.
12664    ///
12665    /// # Example
12666    /// ```
12667    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::CreatePlaybookVersion;
12668    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12669    ///
12670    /// let builder = prepare_request_builder();
12671    /// let response = builder.send().await?;
12672    /// # Ok(()) }
12673    ///
12674    /// fn prepare_request_builder() -> CreatePlaybookVersion {
12675    ///   # panic!();
12676    ///   // ... details omitted ...
12677    /// }
12678    /// ```
12679    #[derive(Clone, Debug)]
12680    pub struct CreatePlaybookVersion(RequestBuilder<crate::model::CreatePlaybookVersionRequest>);
12681
12682    impl CreatePlaybookVersion {
12683        pub(crate) fn new(
12684            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12685        ) -> Self {
12686            Self(RequestBuilder::new(stub))
12687        }
12688
12689        /// Sets the full request, replacing any prior values.
12690        pub fn with_request<V: Into<crate::model::CreatePlaybookVersionRequest>>(
12691            mut self,
12692            v: V,
12693        ) -> Self {
12694            self.0.request = v.into();
12695            self
12696        }
12697
12698        /// Sets all the options, replacing any prior values.
12699        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12700            self.0.options = v.into();
12701            self
12702        }
12703
12704        /// Sends the request.
12705        pub async fn send(self) -> Result<crate::model::PlaybookVersion> {
12706            (*self.0.stub)
12707                .create_playbook_version(self.0.request, self.0.options)
12708                .await
12709                .map(crate::Response::into_body)
12710        }
12711
12712        /// Sets the value of [parent][crate::model::CreatePlaybookVersionRequest::parent].
12713        ///
12714        /// This is a **required** field for requests.
12715        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12716            self.0.request.parent = v.into();
12717            self
12718        }
12719
12720        /// Sets the value of [playbook_version][crate::model::CreatePlaybookVersionRequest::playbook_version].
12721        ///
12722        /// This is a **required** field for requests.
12723        pub fn set_playbook_version<T>(mut self, v: T) -> Self
12724        where
12725            T: std::convert::Into<crate::model::PlaybookVersion>,
12726        {
12727            self.0.request.playbook_version = std::option::Option::Some(v.into());
12728            self
12729        }
12730
12731        /// Sets or clears the value of [playbook_version][crate::model::CreatePlaybookVersionRequest::playbook_version].
12732        ///
12733        /// This is a **required** field for requests.
12734        pub fn set_or_clear_playbook_version<T>(mut self, v: std::option::Option<T>) -> Self
12735        where
12736            T: std::convert::Into<crate::model::PlaybookVersion>,
12737        {
12738            self.0.request.playbook_version = v.map(|x| x.into());
12739            self
12740        }
12741    }
12742
12743    #[doc(hidden)]
12744    impl crate::RequestBuilder for CreatePlaybookVersion {
12745        fn request_options(&mut self) -> &mut crate::RequestOptions {
12746            &mut self.0.options
12747        }
12748    }
12749
12750    /// The request builder for [Playbooks::get_playbook_version][crate::client::Playbooks::get_playbook_version] calls.
12751    ///
12752    /// # Example
12753    /// ```
12754    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::GetPlaybookVersion;
12755    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12756    ///
12757    /// let builder = prepare_request_builder();
12758    /// let response = builder.send().await?;
12759    /// # Ok(()) }
12760    ///
12761    /// fn prepare_request_builder() -> GetPlaybookVersion {
12762    ///   # panic!();
12763    ///   // ... details omitted ...
12764    /// }
12765    /// ```
12766    #[derive(Clone, Debug)]
12767    pub struct GetPlaybookVersion(RequestBuilder<crate::model::GetPlaybookVersionRequest>);
12768
12769    impl GetPlaybookVersion {
12770        pub(crate) fn new(
12771            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12772        ) -> Self {
12773            Self(RequestBuilder::new(stub))
12774        }
12775
12776        /// Sets the full request, replacing any prior values.
12777        pub fn with_request<V: Into<crate::model::GetPlaybookVersionRequest>>(
12778            mut self,
12779            v: V,
12780        ) -> Self {
12781            self.0.request = v.into();
12782            self
12783        }
12784
12785        /// Sets all the options, replacing any prior values.
12786        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12787            self.0.options = v.into();
12788            self
12789        }
12790
12791        /// Sends the request.
12792        pub async fn send(self) -> Result<crate::model::PlaybookVersion> {
12793            (*self.0.stub)
12794                .get_playbook_version(self.0.request, self.0.options)
12795                .await
12796                .map(crate::Response::into_body)
12797        }
12798
12799        /// Sets the value of [name][crate::model::GetPlaybookVersionRequest::name].
12800        ///
12801        /// This is a **required** field for requests.
12802        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12803            self.0.request.name = v.into();
12804            self
12805        }
12806    }
12807
12808    #[doc(hidden)]
12809    impl crate::RequestBuilder for GetPlaybookVersion {
12810        fn request_options(&mut self) -> &mut crate::RequestOptions {
12811            &mut self.0.options
12812        }
12813    }
12814
12815    /// The request builder for [Playbooks::restore_playbook_version][crate::client::Playbooks::restore_playbook_version] calls.
12816    ///
12817    /// # Example
12818    /// ```
12819    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::RestorePlaybookVersion;
12820    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12821    ///
12822    /// let builder = prepare_request_builder();
12823    /// let response = builder.send().await?;
12824    /// # Ok(()) }
12825    ///
12826    /// fn prepare_request_builder() -> RestorePlaybookVersion {
12827    ///   # panic!();
12828    ///   // ... details omitted ...
12829    /// }
12830    /// ```
12831    #[derive(Clone, Debug)]
12832    pub struct RestorePlaybookVersion(RequestBuilder<crate::model::RestorePlaybookVersionRequest>);
12833
12834    impl RestorePlaybookVersion {
12835        pub(crate) fn new(
12836            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12837        ) -> Self {
12838            Self(RequestBuilder::new(stub))
12839        }
12840
12841        /// Sets the full request, replacing any prior values.
12842        pub fn with_request<V: Into<crate::model::RestorePlaybookVersionRequest>>(
12843            mut self,
12844            v: V,
12845        ) -> Self {
12846            self.0.request = v.into();
12847            self
12848        }
12849
12850        /// Sets all the options, replacing any prior values.
12851        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12852            self.0.options = v.into();
12853            self
12854        }
12855
12856        /// Sends the request.
12857        pub async fn send(self) -> Result<crate::model::RestorePlaybookVersionResponse> {
12858            (*self.0.stub)
12859                .restore_playbook_version(self.0.request, self.0.options)
12860                .await
12861                .map(crate::Response::into_body)
12862        }
12863
12864        /// Sets the value of [name][crate::model::RestorePlaybookVersionRequest::name].
12865        ///
12866        /// This is a **required** field for requests.
12867        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12868            self.0.request.name = v.into();
12869            self
12870        }
12871    }
12872
12873    #[doc(hidden)]
12874    impl crate::RequestBuilder for RestorePlaybookVersion {
12875        fn request_options(&mut self) -> &mut crate::RequestOptions {
12876            &mut self.0.options
12877        }
12878    }
12879
12880    /// The request builder for [Playbooks::list_playbook_versions][crate::client::Playbooks::list_playbook_versions] calls.
12881    ///
12882    /// # Example
12883    /// ```
12884    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::ListPlaybookVersions;
12885    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12886    /// use google_cloud_gax::paginator::ItemPaginator;
12887    ///
12888    /// let builder = prepare_request_builder();
12889    /// let mut items = builder.by_item();
12890    /// while let Some(result) = items.next().await {
12891    ///   let item = result?;
12892    /// }
12893    /// # Ok(()) }
12894    ///
12895    /// fn prepare_request_builder() -> ListPlaybookVersions {
12896    ///   # panic!();
12897    ///   // ... details omitted ...
12898    /// }
12899    /// ```
12900    #[derive(Clone, Debug)]
12901    pub struct ListPlaybookVersions(RequestBuilder<crate::model::ListPlaybookVersionsRequest>);
12902
12903    impl ListPlaybookVersions {
12904        pub(crate) fn new(
12905            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12906        ) -> Self {
12907            Self(RequestBuilder::new(stub))
12908        }
12909
12910        /// Sets the full request, replacing any prior values.
12911        pub fn with_request<V: Into<crate::model::ListPlaybookVersionsRequest>>(
12912            mut self,
12913            v: V,
12914        ) -> Self {
12915            self.0.request = v.into();
12916            self
12917        }
12918
12919        /// Sets all the options, replacing any prior values.
12920        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12921            self.0.options = v.into();
12922            self
12923        }
12924
12925        /// Sends the request.
12926        pub async fn send(self) -> Result<crate::model::ListPlaybookVersionsResponse> {
12927            (*self.0.stub)
12928                .list_playbook_versions(self.0.request, self.0.options)
12929                .await
12930                .map(crate::Response::into_body)
12931        }
12932
12933        /// Streams each page in the collection.
12934        pub fn by_page(
12935            self,
12936        ) -> impl google_cloud_gax::paginator::Paginator<
12937            crate::model::ListPlaybookVersionsResponse,
12938            crate::Error,
12939        > {
12940            use std::clone::Clone;
12941            let token = self.0.request.page_token.clone();
12942            let execute = move |token: String| {
12943                let mut builder = self.clone();
12944                builder.0.request = builder.0.request.set_page_token(token);
12945                builder.send()
12946            };
12947            google_cloud_gax::paginator::internal::new_paginator(token, execute)
12948        }
12949
12950        /// Streams each item in the collection.
12951        pub fn by_item(
12952            self,
12953        ) -> impl google_cloud_gax::paginator::ItemPaginator<
12954            crate::model::ListPlaybookVersionsResponse,
12955            crate::Error,
12956        > {
12957            use google_cloud_gax::paginator::Paginator;
12958            self.by_page().items()
12959        }
12960
12961        /// Sets the value of [parent][crate::model::ListPlaybookVersionsRequest::parent].
12962        ///
12963        /// This is a **required** field for requests.
12964        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12965            self.0.request.parent = v.into();
12966            self
12967        }
12968
12969        /// Sets the value of [page_size][crate::model::ListPlaybookVersionsRequest::page_size].
12970        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12971            self.0.request.page_size = v.into();
12972            self
12973        }
12974
12975        /// Sets the value of [page_token][crate::model::ListPlaybookVersionsRequest::page_token].
12976        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12977            self.0.request.page_token = v.into();
12978            self
12979        }
12980    }
12981
12982    #[doc(hidden)]
12983    impl crate::RequestBuilder for ListPlaybookVersions {
12984        fn request_options(&mut self) -> &mut crate::RequestOptions {
12985            &mut self.0.options
12986        }
12987    }
12988
12989    /// The request builder for [Playbooks::delete_playbook_version][crate::client::Playbooks::delete_playbook_version] calls.
12990    ///
12991    /// # Example
12992    /// ```
12993    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::DeletePlaybookVersion;
12994    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
12995    ///
12996    /// let builder = prepare_request_builder();
12997    /// let response = builder.send().await?;
12998    /// # Ok(()) }
12999    ///
13000    /// fn prepare_request_builder() -> DeletePlaybookVersion {
13001    ///   # panic!();
13002    ///   // ... details omitted ...
13003    /// }
13004    /// ```
13005    #[derive(Clone, Debug)]
13006    pub struct DeletePlaybookVersion(RequestBuilder<crate::model::DeletePlaybookVersionRequest>);
13007
13008    impl DeletePlaybookVersion {
13009        pub(crate) fn new(
13010            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13011        ) -> Self {
13012            Self(RequestBuilder::new(stub))
13013        }
13014
13015        /// Sets the full request, replacing any prior values.
13016        pub fn with_request<V: Into<crate::model::DeletePlaybookVersionRequest>>(
13017            mut self,
13018            v: V,
13019        ) -> Self {
13020            self.0.request = v.into();
13021            self
13022        }
13023
13024        /// Sets all the options, replacing any prior values.
13025        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13026            self.0.options = v.into();
13027            self
13028        }
13029
13030        /// Sends the request.
13031        pub async fn send(self) -> Result<()> {
13032            (*self.0.stub)
13033                .delete_playbook_version(self.0.request, self.0.options)
13034                .await
13035                .map(crate::Response::into_body)
13036        }
13037
13038        /// Sets the value of [name][crate::model::DeletePlaybookVersionRequest::name].
13039        ///
13040        /// This is a **required** field for requests.
13041        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13042            self.0.request.name = v.into();
13043            self
13044        }
13045    }
13046
13047    #[doc(hidden)]
13048    impl crate::RequestBuilder for DeletePlaybookVersion {
13049        fn request_options(&mut self) -> &mut crate::RequestOptions {
13050            &mut self.0.options
13051        }
13052    }
13053
13054    /// The request builder for [Playbooks::list_locations][crate::client::Playbooks::list_locations] calls.
13055    ///
13056    /// # Example
13057    /// ```
13058    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::ListLocations;
13059    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13060    /// use google_cloud_gax::paginator::ItemPaginator;
13061    ///
13062    /// let builder = prepare_request_builder();
13063    /// let mut items = builder.by_item();
13064    /// while let Some(result) = items.next().await {
13065    ///   let item = result?;
13066    /// }
13067    /// # Ok(()) }
13068    ///
13069    /// fn prepare_request_builder() -> ListLocations {
13070    ///   # panic!();
13071    ///   // ... details omitted ...
13072    /// }
13073    /// ```
13074    #[derive(Clone, Debug)]
13075    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13076
13077    impl ListLocations {
13078        pub(crate) fn new(
13079            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13080        ) -> Self {
13081            Self(RequestBuilder::new(stub))
13082        }
13083
13084        /// Sets the full request, replacing any prior values.
13085        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13086            mut self,
13087            v: V,
13088        ) -> Self {
13089            self.0.request = v.into();
13090            self
13091        }
13092
13093        /// Sets all the options, replacing any prior values.
13094        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13095            self.0.options = v.into();
13096            self
13097        }
13098
13099        /// Sends the request.
13100        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13101            (*self.0.stub)
13102                .list_locations(self.0.request, self.0.options)
13103                .await
13104                .map(crate::Response::into_body)
13105        }
13106
13107        /// Streams each page in the collection.
13108        pub fn by_page(
13109            self,
13110        ) -> impl google_cloud_gax::paginator::Paginator<
13111            google_cloud_location::model::ListLocationsResponse,
13112            crate::Error,
13113        > {
13114            use std::clone::Clone;
13115            let token = self.0.request.page_token.clone();
13116            let execute = move |token: String| {
13117                let mut builder = self.clone();
13118                builder.0.request = builder.0.request.set_page_token(token);
13119                builder.send()
13120            };
13121            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13122        }
13123
13124        /// Streams each item in the collection.
13125        pub fn by_item(
13126            self,
13127        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13128            google_cloud_location::model::ListLocationsResponse,
13129            crate::Error,
13130        > {
13131            use google_cloud_gax::paginator::Paginator;
13132            self.by_page().items()
13133        }
13134
13135        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
13136        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13137            self.0.request.name = v.into();
13138            self
13139        }
13140
13141        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
13142        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13143            self.0.request.filter = v.into();
13144            self
13145        }
13146
13147        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
13148        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13149            self.0.request.page_size = v.into();
13150            self
13151        }
13152
13153        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
13154        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13155            self.0.request.page_token = v.into();
13156            self
13157        }
13158    }
13159
13160    #[doc(hidden)]
13161    impl crate::RequestBuilder for ListLocations {
13162        fn request_options(&mut self) -> &mut crate::RequestOptions {
13163            &mut self.0.options
13164        }
13165    }
13166
13167    /// The request builder for [Playbooks::get_location][crate::client::Playbooks::get_location] calls.
13168    ///
13169    /// # Example
13170    /// ```
13171    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::GetLocation;
13172    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13173    ///
13174    /// let builder = prepare_request_builder();
13175    /// let response = builder.send().await?;
13176    /// # Ok(()) }
13177    ///
13178    /// fn prepare_request_builder() -> GetLocation {
13179    ///   # panic!();
13180    ///   // ... details omitted ...
13181    /// }
13182    /// ```
13183    #[derive(Clone, Debug)]
13184    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13185
13186    impl GetLocation {
13187        pub(crate) fn new(
13188            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13189        ) -> Self {
13190            Self(RequestBuilder::new(stub))
13191        }
13192
13193        /// Sets the full request, replacing any prior values.
13194        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13195            mut self,
13196            v: V,
13197        ) -> Self {
13198            self.0.request = v.into();
13199            self
13200        }
13201
13202        /// Sets all the options, replacing any prior values.
13203        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13204            self.0.options = v.into();
13205            self
13206        }
13207
13208        /// Sends the request.
13209        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13210            (*self.0.stub)
13211                .get_location(self.0.request, self.0.options)
13212                .await
13213                .map(crate::Response::into_body)
13214        }
13215
13216        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
13217        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13218            self.0.request.name = v.into();
13219            self
13220        }
13221    }
13222
13223    #[doc(hidden)]
13224    impl crate::RequestBuilder for GetLocation {
13225        fn request_options(&mut self) -> &mut crate::RequestOptions {
13226            &mut self.0.options
13227        }
13228    }
13229
13230    /// The request builder for [Playbooks::list_operations][crate::client::Playbooks::list_operations] calls.
13231    ///
13232    /// # Example
13233    /// ```
13234    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::ListOperations;
13235    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13236    /// use google_cloud_gax::paginator::ItemPaginator;
13237    ///
13238    /// let builder = prepare_request_builder();
13239    /// let mut items = builder.by_item();
13240    /// while let Some(result) = items.next().await {
13241    ///   let item = result?;
13242    /// }
13243    /// # Ok(()) }
13244    ///
13245    /// fn prepare_request_builder() -> ListOperations {
13246    ///   # panic!();
13247    ///   // ... details omitted ...
13248    /// }
13249    /// ```
13250    #[derive(Clone, Debug)]
13251    pub struct ListOperations(
13252        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13253    );
13254
13255    impl ListOperations {
13256        pub(crate) fn new(
13257            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13258        ) -> Self {
13259            Self(RequestBuilder::new(stub))
13260        }
13261
13262        /// Sets the full request, replacing any prior values.
13263        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13264            mut self,
13265            v: V,
13266        ) -> Self {
13267            self.0.request = v.into();
13268            self
13269        }
13270
13271        /// Sets all the options, replacing any prior values.
13272        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13273            self.0.options = v.into();
13274            self
13275        }
13276
13277        /// Sends the request.
13278        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13279            (*self.0.stub)
13280                .list_operations(self.0.request, self.0.options)
13281                .await
13282                .map(crate::Response::into_body)
13283        }
13284
13285        /// Streams each page in the collection.
13286        pub fn by_page(
13287            self,
13288        ) -> impl google_cloud_gax::paginator::Paginator<
13289            google_cloud_longrunning::model::ListOperationsResponse,
13290            crate::Error,
13291        > {
13292            use std::clone::Clone;
13293            let token = self.0.request.page_token.clone();
13294            let execute = move |token: String| {
13295                let mut builder = self.clone();
13296                builder.0.request = builder.0.request.set_page_token(token);
13297                builder.send()
13298            };
13299            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13300        }
13301
13302        /// Streams each item in the collection.
13303        pub fn by_item(
13304            self,
13305        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13306            google_cloud_longrunning::model::ListOperationsResponse,
13307            crate::Error,
13308        > {
13309            use google_cloud_gax::paginator::Paginator;
13310            self.by_page().items()
13311        }
13312
13313        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
13314        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13315            self.0.request.name = v.into();
13316            self
13317        }
13318
13319        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
13320        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13321            self.0.request.filter = v.into();
13322            self
13323        }
13324
13325        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
13326        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13327            self.0.request.page_size = v.into();
13328            self
13329        }
13330
13331        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
13332        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13333            self.0.request.page_token = v.into();
13334            self
13335        }
13336
13337        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
13338        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13339            self.0.request.return_partial_success = v.into();
13340            self
13341        }
13342    }
13343
13344    #[doc(hidden)]
13345    impl crate::RequestBuilder for ListOperations {
13346        fn request_options(&mut self) -> &mut crate::RequestOptions {
13347            &mut self.0.options
13348        }
13349    }
13350
13351    /// The request builder for [Playbooks::get_operation][crate::client::Playbooks::get_operation] calls.
13352    ///
13353    /// # Example
13354    /// ```
13355    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::GetOperation;
13356    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13357    ///
13358    /// let builder = prepare_request_builder();
13359    /// let response = builder.send().await?;
13360    /// # Ok(()) }
13361    ///
13362    /// fn prepare_request_builder() -> GetOperation {
13363    ///   # panic!();
13364    ///   // ... details omitted ...
13365    /// }
13366    /// ```
13367    #[derive(Clone, Debug)]
13368    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13369
13370    impl GetOperation {
13371        pub(crate) fn new(
13372            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13373        ) -> Self {
13374            Self(RequestBuilder::new(stub))
13375        }
13376
13377        /// Sets the full request, replacing any prior values.
13378        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13379            mut self,
13380            v: V,
13381        ) -> Self {
13382            self.0.request = v.into();
13383            self
13384        }
13385
13386        /// Sets all the options, replacing any prior values.
13387        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13388            self.0.options = v.into();
13389            self
13390        }
13391
13392        /// Sends the request.
13393        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13394            (*self.0.stub)
13395                .get_operation(self.0.request, self.0.options)
13396                .await
13397                .map(crate::Response::into_body)
13398        }
13399
13400        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
13401        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13402            self.0.request.name = v.into();
13403            self
13404        }
13405    }
13406
13407    #[doc(hidden)]
13408    impl crate::RequestBuilder for GetOperation {
13409        fn request_options(&mut self) -> &mut crate::RequestOptions {
13410            &mut self.0.options
13411        }
13412    }
13413
13414    /// The request builder for [Playbooks::cancel_operation][crate::client::Playbooks::cancel_operation] calls.
13415    ///
13416    /// # Example
13417    /// ```
13418    /// # use google_cloud_dialogflow_cx_v3::builder::playbooks::CancelOperation;
13419    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13420    ///
13421    /// let builder = prepare_request_builder();
13422    /// let response = builder.send().await?;
13423    /// # Ok(()) }
13424    ///
13425    /// fn prepare_request_builder() -> CancelOperation {
13426    ///   # panic!();
13427    ///   // ... details omitted ...
13428    /// }
13429    /// ```
13430    #[derive(Clone, Debug)]
13431    pub struct CancelOperation(
13432        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13433    );
13434
13435    impl CancelOperation {
13436        pub(crate) fn new(
13437            stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13438        ) -> Self {
13439            Self(RequestBuilder::new(stub))
13440        }
13441
13442        /// Sets the full request, replacing any prior values.
13443        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13444            mut self,
13445            v: V,
13446        ) -> Self {
13447            self.0.request = v.into();
13448            self
13449        }
13450
13451        /// Sets all the options, replacing any prior values.
13452        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13453            self.0.options = v.into();
13454            self
13455        }
13456
13457        /// Sends the request.
13458        pub async fn send(self) -> Result<()> {
13459            (*self.0.stub)
13460                .cancel_operation(self.0.request, self.0.options)
13461                .await
13462                .map(crate::Response::into_body)
13463        }
13464
13465        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
13466        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13467            self.0.request.name = v.into();
13468            self
13469        }
13470    }
13471
13472    #[doc(hidden)]
13473    impl crate::RequestBuilder for CancelOperation {
13474        fn request_options(&mut self) -> &mut crate::RequestOptions {
13475            &mut self.0.options
13476        }
13477    }
13478}
13479
13480/// Request and client builders for [SecuritySettingsService][crate::client::SecuritySettingsService].
13481#[cfg(feature = "security-settings-service")]
13482#[cfg_attr(docsrs, doc(cfg(feature = "security-settings-service")))]
13483pub mod security_settings_service {
13484    use crate::Result;
13485
13486    /// A builder for [SecuritySettingsService][crate::client::SecuritySettingsService].
13487    ///
13488    /// ```
13489    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
13490    /// # use google_cloud_dialogflow_cx_v3::*;
13491    /// # use builder::security_settings_service::ClientBuilder;
13492    /// # use client::SecuritySettingsService;
13493    /// let builder : ClientBuilder = SecuritySettingsService::builder();
13494    /// let client = builder
13495    ///     .with_endpoint("https://dialogflow.googleapis.com")
13496    ///     .build().await?;
13497    /// # Ok(()) }
13498    /// ```
13499    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13500
13501    pub(crate) mod client {
13502        use super::super::super::client::SecuritySettingsService;
13503        pub struct Factory;
13504        impl crate::ClientFactory for Factory {
13505            type Client = SecuritySettingsService;
13506            type Credentials = gaxi::options::Credentials;
13507            async fn build(
13508                self,
13509                config: gaxi::options::ClientConfig,
13510            ) -> crate::ClientBuilderResult<Self::Client> {
13511                Self::Client::new(config).await
13512            }
13513        }
13514    }
13515
13516    /// Common implementation for [crate::client::SecuritySettingsService] request builders.
13517    #[derive(Clone, Debug)]
13518    pub(crate) struct RequestBuilder<R: std::default::Default> {
13519        stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13520        request: R,
13521        options: crate::RequestOptions,
13522    }
13523
13524    impl<R> RequestBuilder<R>
13525    where
13526        R: std::default::Default,
13527    {
13528        pub(crate) fn new(
13529            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13530        ) -> Self {
13531            Self {
13532                stub,
13533                request: R::default(),
13534                options: crate::RequestOptions::default(),
13535            }
13536        }
13537    }
13538
13539    /// The request builder for [SecuritySettingsService::create_security_settings][crate::client::SecuritySettingsService::create_security_settings] calls.
13540    ///
13541    /// # Example
13542    /// ```
13543    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::CreateSecuritySettings;
13544    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13545    ///
13546    /// let builder = prepare_request_builder();
13547    /// let response = builder.send().await?;
13548    /// # Ok(()) }
13549    ///
13550    /// fn prepare_request_builder() -> CreateSecuritySettings {
13551    ///   # panic!();
13552    ///   // ... details omitted ...
13553    /// }
13554    /// ```
13555    #[derive(Clone, Debug)]
13556    pub struct CreateSecuritySettings(RequestBuilder<crate::model::CreateSecuritySettingsRequest>);
13557
13558    impl CreateSecuritySettings {
13559        pub(crate) fn new(
13560            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13561        ) -> Self {
13562            Self(RequestBuilder::new(stub))
13563        }
13564
13565        /// Sets the full request, replacing any prior values.
13566        pub fn with_request<V: Into<crate::model::CreateSecuritySettingsRequest>>(
13567            mut self,
13568            v: V,
13569        ) -> Self {
13570            self.0.request = v.into();
13571            self
13572        }
13573
13574        /// Sets all the options, replacing any prior values.
13575        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13576            self.0.options = v.into();
13577            self
13578        }
13579
13580        /// Sends the request.
13581        pub async fn send(self) -> Result<crate::model::SecuritySettings> {
13582            (*self.0.stub)
13583                .create_security_settings(self.0.request, self.0.options)
13584                .await
13585                .map(crate::Response::into_body)
13586        }
13587
13588        /// Sets the value of [parent][crate::model::CreateSecuritySettingsRequest::parent].
13589        ///
13590        /// This is a **required** field for requests.
13591        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13592            self.0.request.parent = v.into();
13593            self
13594        }
13595
13596        /// Sets the value of [security_settings][crate::model::CreateSecuritySettingsRequest::security_settings].
13597        ///
13598        /// This is a **required** field for requests.
13599        pub fn set_security_settings<T>(mut self, v: T) -> Self
13600        where
13601            T: std::convert::Into<crate::model::SecuritySettings>,
13602        {
13603            self.0.request.security_settings = std::option::Option::Some(v.into());
13604            self
13605        }
13606
13607        /// Sets or clears the value of [security_settings][crate::model::CreateSecuritySettingsRequest::security_settings].
13608        ///
13609        /// This is a **required** field for requests.
13610        pub fn set_or_clear_security_settings<T>(mut self, v: std::option::Option<T>) -> Self
13611        where
13612            T: std::convert::Into<crate::model::SecuritySettings>,
13613        {
13614            self.0.request.security_settings = v.map(|x| x.into());
13615            self
13616        }
13617    }
13618
13619    #[doc(hidden)]
13620    impl crate::RequestBuilder for CreateSecuritySettings {
13621        fn request_options(&mut self) -> &mut crate::RequestOptions {
13622            &mut self.0.options
13623        }
13624    }
13625
13626    /// The request builder for [SecuritySettingsService::get_security_settings][crate::client::SecuritySettingsService::get_security_settings] calls.
13627    ///
13628    /// # Example
13629    /// ```
13630    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::GetSecuritySettings;
13631    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13632    ///
13633    /// let builder = prepare_request_builder();
13634    /// let response = builder.send().await?;
13635    /// # Ok(()) }
13636    ///
13637    /// fn prepare_request_builder() -> GetSecuritySettings {
13638    ///   # panic!();
13639    ///   // ... details omitted ...
13640    /// }
13641    /// ```
13642    #[derive(Clone, Debug)]
13643    pub struct GetSecuritySettings(RequestBuilder<crate::model::GetSecuritySettingsRequest>);
13644
13645    impl GetSecuritySettings {
13646        pub(crate) fn new(
13647            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13648        ) -> Self {
13649            Self(RequestBuilder::new(stub))
13650        }
13651
13652        /// Sets the full request, replacing any prior values.
13653        pub fn with_request<V: Into<crate::model::GetSecuritySettingsRequest>>(
13654            mut self,
13655            v: V,
13656        ) -> Self {
13657            self.0.request = v.into();
13658            self
13659        }
13660
13661        /// Sets all the options, replacing any prior values.
13662        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13663            self.0.options = v.into();
13664            self
13665        }
13666
13667        /// Sends the request.
13668        pub async fn send(self) -> Result<crate::model::SecuritySettings> {
13669            (*self.0.stub)
13670                .get_security_settings(self.0.request, self.0.options)
13671                .await
13672                .map(crate::Response::into_body)
13673        }
13674
13675        /// Sets the value of [name][crate::model::GetSecuritySettingsRequest::name].
13676        ///
13677        /// This is a **required** field for requests.
13678        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13679            self.0.request.name = v.into();
13680            self
13681        }
13682    }
13683
13684    #[doc(hidden)]
13685    impl crate::RequestBuilder for GetSecuritySettings {
13686        fn request_options(&mut self) -> &mut crate::RequestOptions {
13687            &mut self.0.options
13688        }
13689    }
13690
13691    /// The request builder for [SecuritySettingsService::update_security_settings][crate::client::SecuritySettingsService::update_security_settings] calls.
13692    ///
13693    /// # Example
13694    /// ```
13695    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::UpdateSecuritySettings;
13696    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13697    ///
13698    /// let builder = prepare_request_builder();
13699    /// let response = builder.send().await?;
13700    /// # Ok(()) }
13701    ///
13702    /// fn prepare_request_builder() -> UpdateSecuritySettings {
13703    ///   # panic!();
13704    ///   // ... details omitted ...
13705    /// }
13706    /// ```
13707    #[derive(Clone, Debug)]
13708    pub struct UpdateSecuritySettings(RequestBuilder<crate::model::UpdateSecuritySettingsRequest>);
13709
13710    impl UpdateSecuritySettings {
13711        pub(crate) fn new(
13712            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13713        ) -> Self {
13714            Self(RequestBuilder::new(stub))
13715        }
13716
13717        /// Sets the full request, replacing any prior values.
13718        pub fn with_request<V: Into<crate::model::UpdateSecuritySettingsRequest>>(
13719            mut self,
13720            v: V,
13721        ) -> Self {
13722            self.0.request = v.into();
13723            self
13724        }
13725
13726        /// Sets all the options, replacing any prior values.
13727        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13728            self.0.options = v.into();
13729            self
13730        }
13731
13732        /// Sends the request.
13733        pub async fn send(self) -> Result<crate::model::SecuritySettings> {
13734            (*self.0.stub)
13735                .update_security_settings(self.0.request, self.0.options)
13736                .await
13737                .map(crate::Response::into_body)
13738        }
13739
13740        /// Sets the value of [security_settings][crate::model::UpdateSecuritySettingsRequest::security_settings].
13741        ///
13742        /// This is a **required** field for requests.
13743        pub fn set_security_settings<T>(mut self, v: T) -> Self
13744        where
13745            T: std::convert::Into<crate::model::SecuritySettings>,
13746        {
13747            self.0.request.security_settings = std::option::Option::Some(v.into());
13748            self
13749        }
13750
13751        /// Sets or clears the value of [security_settings][crate::model::UpdateSecuritySettingsRequest::security_settings].
13752        ///
13753        /// This is a **required** field for requests.
13754        pub fn set_or_clear_security_settings<T>(mut self, v: std::option::Option<T>) -> Self
13755        where
13756            T: std::convert::Into<crate::model::SecuritySettings>,
13757        {
13758            self.0.request.security_settings = v.map(|x| x.into());
13759            self
13760        }
13761
13762        /// Sets the value of [update_mask][crate::model::UpdateSecuritySettingsRequest::update_mask].
13763        ///
13764        /// This is a **required** field for requests.
13765        pub fn set_update_mask<T>(mut self, v: T) -> Self
13766        where
13767            T: std::convert::Into<wkt::FieldMask>,
13768        {
13769            self.0.request.update_mask = std::option::Option::Some(v.into());
13770            self
13771        }
13772
13773        /// Sets or clears the value of [update_mask][crate::model::UpdateSecuritySettingsRequest::update_mask].
13774        ///
13775        /// This is a **required** field for requests.
13776        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13777        where
13778            T: std::convert::Into<wkt::FieldMask>,
13779        {
13780            self.0.request.update_mask = v.map(|x| x.into());
13781            self
13782        }
13783    }
13784
13785    #[doc(hidden)]
13786    impl crate::RequestBuilder for UpdateSecuritySettings {
13787        fn request_options(&mut self) -> &mut crate::RequestOptions {
13788            &mut self.0.options
13789        }
13790    }
13791
13792    /// The request builder for [SecuritySettingsService::list_security_settings][crate::client::SecuritySettingsService::list_security_settings] calls.
13793    ///
13794    /// # Example
13795    /// ```
13796    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::ListSecuritySettings;
13797    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13798    /// use google_cloud_gax::paginator::ItemPaginator;
13799    ///
13800    /// let builder = prepare_request_builder();
13801    /// let mut items = builder.by_item();
13802    /// while let Some(result) = items.next().await {
13803    ///   let item = result?;
13804    /// }
13805    /// # Ok(()) }
13806    ///
13807    /// fn prepare_request_builder() -> ListSecuritySettings {
13808    ///   # panic!();
13809    ///   // ... details omitted ...
13810    /// }
13811    /// ```
13812    #[derive(Clone, Debug)]
13813    pub struct ListSecuritySettings(RequestBuilder<crate::model::ListSecuritySettingsRequest>);
13814
13815    impl ListSecuritySettings {
13816        pub(crate) fn new(
13817            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13818        ) -> Self {
13819            Self(RequestBuilder::new(stub))
13820        }
13821
13822        /// Sets the full request, replacing any prior values.
13823        pub fn with_request<V: Into<crate::model::ListSecuritySettingsRequest>>(
13824            mut self,
13825            v: V,
13826        ) -> Self {
13827            self.0.request = v.into();
13828            self
13829        }
13830
13831        /// Sets all the options, replacing any prior values.
13832        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13833            self.0.options = v.into();
13834            self
13835        }
13836
13837        /// Sends the request.
13838        pub async fn send(self) -> Result<crate::model::ListSecuritySettingsResponse> {
13839            (*self.0.stub)
13840                .list_security_settings(self.0.request, self.0.options)
13841                .await
13842                .map(crate::Response::into_body)
13843        }
13844
13845        /// Streams each page in the collection.
13846        pub fn by_page(
13847            self,
13848        ) -> impl google_cloud_gax::paginator::Paginator<
13849            crate::model::ListSecuritySettingsResponse,
13850            crate::Error,
13851        > {
13852            use std::clone::Clone;
13853            let token = self.0.request.page_token.clone();
13854            let execute = move |token: String| {
13855                let mut builder = self.clone();
13856                builder.0.request = builder.0.request.set_page_token(token);
13857                builder.send()
13858            };
13859            google_cloud_gax::paginator::internal::new_paginator(token, execute)
13860        }
13861
13862        /// Streams each item in the collection.
13863        pub fn by_item(
13864            self,
13865        ) -> impl google_cloud_gax::paginator::ItemPaginator<
13866            crate::model::ListSecuritySettingsResponse,
13867            crate::Error,
13868        > {
13869            use google_cloud_gax::paginator::Paginator;
13870            self.by_page().items()
13871        }
13872
13873        /// Sets the value of [parent][crate::model::ListSecuritySettingsRequest::parent].
13874        ///
13875        /// This is a **required** field for requests.
13876        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13877            self.0.request.parent = v.into();
13878            self
13879        }
13880
13881        /// Sets the value of [page_size][crate::model::ListSecuritySettingsRequest::page_size].
13882        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13883            self.0.request.page_size = v.into();
13884            self
13885        }
13886
13887        /// Sets the value of [page_token][crate::model::ListSecuritySettingsRequest::page_token].
13888        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13889            self.0.request.page_token = v.into();
13890            self
13891        }
13892    }
13893
13894    #[doc(hidden)]
13895    impl crate::RequestBuilder for ListSecuritySettings {
13896        fn request_options(&mut self) -> &mut crate::RequestOptions {
13897            &mut self.0.options
13898        }
13899    }
13900
13901    /// The request builder for [SecuritySettingsService::delete_security_settings][crate::client::SecuritySettingsService::delete_security_settings] calls.
13902    ///
13903    /// # Example
13904    /// ```
13905    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::DeleteSecuritySettings;
13906    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13907    ///
13908    /// let builder = prepare_request_builder();
13909    /// let response = builder.send().await?;
13910    /// # Ok(()) }
13911    ///
13912    /// fn prepare_request_builder() -> DeleteSecuritySettings {
13913    ///   # panic!();
13914    ///   // ... details omitted ...
13915    /// }
13916    /// ```
13917    #[derive(Clone, Debug)]
13918    pub struct DeleteSecuritySettings(RequestBuilder<crate::model::DeleteSecuritySettingsRequest>);
13919
13920    impl DeleteSecuritySettings {
13921        pub(crate) fn new(
13922            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13923        ) -> Self {
13924            Self(RequestBuilder::new(stub))
13925        }
13926
13927        /// Sets the full request, replacing any prior values.
13928        pub fn with_request<V: Into<crate::model::DeleteSecuritySettingsRequest>>(
13929            mut self,
13930            v: V,
13931        ) -> Self {
13932            self.0.request = v.into();
13933            self
13934        }
13935
13936        /// Sets all the options, replacing any prior values.
13937        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13938            self.0.options = v.into();
13939            self
13940        }
13941
13942        /// Sends the request.
13943        pub async fn send(self) -> Result<()> {
13944            (*self.0.stub)
13945                .delete_security_settings(self.0.request, self.0.options)
13946                .await
13947                .map(crate::Response::into_body)
13948        }
13949
13950        /// Sets the value of [name][crate::model::DeleteSecuritySettingsRequest::name].
13951        ///
13952        /// This is a **required** field for requests.
13953        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13954            self.0.request.name = v.into();
13955            self
13956        }
13957    }
13958
13959    #[doc(hidden)]
13960    impl crate::RequestBuilder for DeleteSecuritySettings {
13961        fn request_options(&mut self) -> &mut crate::RequestOptions {
13962            &mut self.0.options
13963        }
13964    }
13965
13966    /// The request builder for [SecuritySettingsService::list_locations][crate::client::SecuritySettingsService::list_locations] calls.
13967    ///
13968    /// # Example
13969    /// ```
13970    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::ListLocations;
13971    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
13972    /// use google_cloud_gax::paginator::ItemPaginator;
13973    ///
13974    /// let builder = prepare_request_builder();
13975    /// let mut items = builder.by_item();
13976    /// while let Some(result) = items.next().await {
13977    ///   let item = result?;
13978    /// }
13979    /// # Ok(()) }
13980    ///
13981    /// fn prepare_request_builder() -> ListLocations {
13982    ///   # panic!();
13983    ///   // ... details omitted ...
13984    /// }
13985    /// ```
13986    #[derive(Clone, Debug)]
13987    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13988
13989    impl ListLocations {
13990        pub(crate) fn new(
13991            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13992        ) -> Self {
13993            Self(RequestBuilder::new(stub))
13994        }
13995
13996        /// Sets the full request, replacing any prior values.
13997        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13998            mut self,
13999            v: V,
14000        ) -> Self {
14001            self.0.request = v.into();
14002            self
14003        }
14004
14005        /// Sets all the options, replacing any prior values.
14006        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14007            self.0.options = v.into();
14008            self
14009        }
14010
14011        /// Sends the request.
14012        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14013            (*self.0.stub)
14014                .list_locations(self.0.request, self.0.options)
14015                .await
14016                .map(crate::Response::into_body)
14017        }
14018
14019        /// Streams each page in the collection.
14020        pub fn by_page(
14021            self,
14022        ) -> impl google_cloud_gax::paginator::Paginator<
14023            google_cloud_location::model::ListLocationsResponse,
14024            crate::Error,
14025        > {
14026            use std::clone::Clone;
14027            let token = self.0.request.page_token.clone();
14028            let execute = move |token: String| {
14029                let mut builder = self.clone();
14030                builder.0.request = builder.0.request.set_page_token(token);
14031                builder.send()
14032            };
14033            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14034        }
14035
14036        /// Streams each item in the collection.
14037        pub fn by_item(
14038            self,
14039        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14040            google_cloud_location::model::ListLocationsResponse,
14041            crate::Error,
14042        > {
14043            use google_cloud_gax::paginator::Paginator;
14044            self.by_page().items()
14045        }
14046
14047        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
14048        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14049            self.0.request.name = v.into();
14050            self
14051        }
14052
14053        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
14054        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14055            self.0.request.filter = v.into();
14056            self
14057        }
14058
14059        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
14060        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14061            self.0.request.page_size = v.into();
14062            self
14063        }
14064
14065        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
14066        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14067            self.0.request.page_token = v.into();
14068            self
14069        }
14070    }
14071
14072    #[doc(hidden)]
14073    impl crate::RequestBuilder for ListLocations {
14074        fn request_options(&mut self) -> &mut crate::RequestOptions {
14075            &mut self.0.options
14076        }
14077    }
14078
14079    /// The request builder for [SecuritySettingsService::get_location][crate::client::SecuritySettingsService::get_location] calls.
14080    ///
14081    /// # Example
14082    /// ```
14083    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::GetLocation;
14084    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14085    ///
14086    /// let builder = prepare_request_builder();
14087    /// let response = builder.send().await?;
14088    /// # Ok(()) }
14089    ///
14090    /// fn prepare_request_builder() -> GetLocation {
14091    ///   # panic!();
14092    ///   // ... details omitted ...
14093    /// }
14094    /// ```
14095    #[derive(Clone, Debug)]
14096    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14097
14098    impl GetLocation {
14099        pub(crate) fn new(
14100            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14101        ) -> Self {
14102            Self(RequestBuilder::new(stub))
14103        }
14104
14105        /// Sets the full request, replacing any prior values.
14106        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14107            mut self,
14108            v: V,
14109        ) -> Self {
14110            self.0.request = v.into();
14111            self
14112        }
14113
14114        /// Sets all the options, replacing any prior values.
14115        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14116            self.0.options = v.into();
14117            self
14118        }
14119
14120        /// Sends the request.
14121        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14122            (*self.0.stub)
14123                .get_location(self.0.request, self.0.options)
14124                .await
14125                .map(crate::Response::into_body)
14126        }
14127
14128        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
14129        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14130            self.0.request.name = v.into();
14131            self
14132        }
14133    }
14134
14135    #[doc(hidden)]
14136    impl crate::RequestBuilder for GetLocation {
14137        fn request_options(&mut self) -> &mut crate::RequestOptions {
14138            &mut self.0.options
14139        }
14140    }
14141
14142    /// The request builder for [SecuritySettingsService::list_operations][crate::client::SecuritySettingsService::list_operations] calls.
14143    ///
14144    /// # Example
14145    /// ```
14146    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::ListOperations;
14147    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14148    /// use google_cloud_gax::paginator::ItemPaginator;
14149    ///
14150    /// let builder = prepare_request_builder();
14151    /// let mut items = builder.by_item();
14152    /// while let Some(result) = items.next().await {
14153    ///   let item = result?;
14154    /// }
14155    /// # Ok(()) }
14156    ///
14157    /// fn prepare_request_builder() -> ListOperations {
14158    ///   # panic!();
14159    ///   // ... details omitted ...
14160    /// }
14161    /// ```
14162    #[derive(Clone, Debug)]
14163    pub struct ListOperations(
14164        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14165    );
14166
14167    impl ListOperations {
14168        pub(crate) fn new(
14169            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14170        ) -> Self {
14171            Self(RequestBuilder::new(stub))
14172        }
14173
14174        /// Sets the full request, replacing any prior values.
14175        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14176            mut self,
14177            v: V,
14178        ) -> Self {
14179            self.0.request = v.into();
14180            self
14181        }
14182
14183        /// Sets all the options, replacing any prior values.
14184        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14185            self.0.options = v.into();
14186            self
14187        }
14188
14189        /// Sends the request.
14190        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14191            (*self.0.stub)
14192                .list_operations(self.0.request, self.0.options)
14193                .await
14194                .map(crate::Response::into_body)
14195        }
14196
14197        /// Streams each page in the collection.
14198        pub fn by_page(
14199            self,
14200        ) -> impl google_cloud_gax::paginator::Paginator<
14201            google_cloud_longrunning::model::ListOperationsResponse,
14202            crate::Error,
14203        > {
14204            use std::clone::Clone;
14205            let token = self.0.request.page_token.clone();
14206            let execute = move |token: String| {
14207                let mut builder = self.clone();
14208                builder.0.request = builder.0.request.set_page_token(token);
14209                builder.send()
14210            };
14211            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14212        }
14213
14214        /// Streams each item in the collection.
14215        pub fn by_item(
14216            self,
14217        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14218            google_cloud_longrunning::model::ListOperationsResponse,
14219            crate::Error,
14220        > {
14221            use google_cloud_gax::paginator::Paginator;
14222            self.by_page().items()
14223        }
14224
14225        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
14226        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14227            self.0.request.name = v.into();
14228            self
14229        }
14230
14231        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
14232        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14233            self.0.request.filter = v.into();
14234            self
14235        }
14236
14237        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
14238        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14239            self.0.request.page_size = v.into();
14240            self
14241        }
14242
14243        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
14244        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14245            self.0.request.page_token = v.into();
14246            self
14247        }
14248
14249        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
14250        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14251            self.0.request.return_partial_success = v.into();
14252            self
14253        }
14254    }
14255
14256    #[doc(hidden)]
14257    impl crate::RequestBuilder for ListOperations {
14258        fn request_options(&mut self) -> &mut crate::RequestOptions {
14259            &mut self.0.options
14260        }
14261    }
14262
14263    /// The request builder for [SecuritySettingsService::get_operation][crate::client::SecuritySettingsService::get_operation] calls.
14264    ///
14265    /// # Example
14266    /// ```
14267    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::GetOperation;
14268    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14269    ///
14270    /// let builder = prepare_request_builder();
14271    /// let response = builder.send().await?;
14272    /// # Ok(()) }
14273    ///
14274    /// fn prepare_request_builder() -> GetOperation {
14275    ///   # panic!();
14276    ///   // ... details omitted ...
14277    /// }
14278    /// ```
14279    #[derive(Clone, Debug)]
14280    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14281
14282    impl GetOperation {
14283        pub(crate) fn new(
14284            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14285        ) -> Self {
14286            Self(RequestBuilder::new(stub))
14287        }
14288
14289        /// Sets the full request, replacing any prior values.
14290        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14291            mut self,
14292            v: V,
14293        ) -> Self {
14294            self.0.request = v.into();
14295            self
14296        }
14297
14298        /// Sets all the options, replacing any prior values.
14299        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14300            self.0.options = v.into();
14301            self
14302        }
14303
14304        /// Sends the request.
14305        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14306            (*self.0.stub)
14307                .get_operation(self.0.request, self.0.options)
14308                .await
14309                .map(crate::Response::into_body)
14310        }
14311
14312        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
14313        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14314            self.0.request.name = v.into();
14315            self
14316        }
14317    }
14318
14319    #[doc(hidden)]
14320    impl crate::RequestBuilder for GetOperation {
14321        fn request_options(&mut self) -> &mut crate::RequestOptions {
14322            &mut self.0.options
14323        }
14324    }
14325
14326    /// The request builder for [SecuritySettingsService::cancel_operation][crate::client::SecuritySettingsService::cancel_operation] calls.
14327    ///
14328    /// # Example
14329    /// ```
14330    /// # use google_cloud_dialogflow_cx_v3::builder::security_settings_service::CancelOperation;
14331    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14332    ///
14333    /// let builder = prepare_request_builder();
14334    /// let response = builder.send().await?;
14335    /// # Ok(()) }
14336    ///
14337    /// fn prepare_request_builder() -> CancelOperation {
14338    ///   # panic!();
14339    ///   // ... details omitted ...
14340    /// }
14341    /// ```
14342    #[derive(Clone, Debug)]
14343    pub struct CancelOperation(
14344        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14345    );
14346
14347    impl CancelOperation {
14348        pub(crate) fn new(
14349            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14350        ) -> Self {
14351            Self(RequestBuilder::new(stub))
14352        }
14353
14354        /// Sets the full request, replacing any prior values.
14355        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14356            mut self,
14357            v: V,
14358        ) -> Self {
14359            self.0.request = v.into();
14360            self
14361        }
14362
14363        /// Sets all the options, replacing any prior values.
14364        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14365            self.0.options = v.into();
14366            self
14367        }
14368
14369        /// Sends the request.
14370        pub async fn send(self) -> Result<()> {
14371            (*self.0.stub)
14372                .cancel_operation(self.0.request, self.0.options)
14373                .await
14374                .map(crate::Response::into_body)
14375        }
14376
14377        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
14378        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14379            self.0.request.name = v.into();
14380            self
14381        }
14382    }
14383
14384    #[doc(hidden)]
14385    impl crate::RequestBuilder for CancelOperation {
14386        fn request_options(&mut self) -> &mut crate::RequestOptions {
14387            &mut self.0.options
14388        }
14389    }
14390}
14391
14392/// Request and client builders for [Sessions][crate::client::Sessions].
14393#[cfg(feature = "sessions")]
14394#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
14395pub mod sessions {
14396    use crate::Result;
14397
14398    /// A builder for [Sessions][crate::client::Sessions].
14399    ///
14400    /// ```
14401    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
14402    /// # use google_cloud_dialogflow_cx_v3::*;
14403    /// # use builder::sessions::ClientBuilder;
14404    /// # use client::Sessions;
14405    /// let builder : ClientBuilder = Sessions::builder();
14406    /// let client = builder
14407    ///     .with_endpoint("https://dialogflow.googleapis.com")
14408    ///     .build().await?;
14409    /// # Ok(()) }
14410    /// ```
14411    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14412
14413    pub(crate) mod client {
14414        use super::super::super::client::Sessions;
14415        pub struct Factory;
14416        impl crate::ClientFactory for Factory {
14417            type Client = Sessions;
14418            type Credentials = gaxi::options::Credentials;
14419            async fn build(
14420                self,
14421                config: gaxi::options::ClientConfig,
14422            ) -> crate::ClientBuilderResult<Self::Client> {
14423                Self::Client::new(config).await
14424            }
14425        }
14426    }
14427
14428    /// Common implementation for [crate::client::Sessions] request builders.
14429    #[derive(Clone, Debug)]
14430    pub(crate) struct RequestBuilder<R: std::default::Default> {
14431        stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
14432        request: R,
14433        options: crate::RequestOptions,
14434    }
14435
14436    impl<R> RequestBuilder<R>
14437    where
14438        R: std::default::Default,
14439    {
14440        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14441            Self {
14442                stub,
14443                request: R::default(),
14444                options: crate::RequestOptions::default(),
14445            }
14446        }
14447    }
14448
14449    /// The request builder for [Sessions::detect_intent][crate::client::Sessions::detect_intent] calls.
14450    ///
14451    /// # Example
14452    /// ```
14453    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::DetectIntent;
14454    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14455    ///
14456    /// let builder = prepare_request_builder();
14457    /// let response = builder.send().await?;
14458    /// # Ok(()) }
14459    ///
14460    /// fn prepare_request_builder() -> DetectIntent {
14461    ///   # panic!();
14462    ///   // ... details omitted ...
14463    /// }
14464    /// ```
14465    #[derive(Clone, Debug)]
14466    pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
14467
14468    impl DetectIntent {
14469        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14470            Self(RequestBuilder::new(stub))
14471        }
14472
14473        /// Sets the full request, replacing any prior values.
14474        pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
14475            self.0.request = v.into();
14476            self
14477        }
14478
14479        /// Sets all the options, replacing any prior values.
14480        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14481            self.0.options = v.into();
14482            self
14483        }
14484
14485        /// Sends the request.
14486        pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
14487            (*self.0.stub)
14488                .detect_intent(self.0.request, self.0.options)
14489                .await
14490                .map(crate::Response::into_body)
14491        }
14492
14493        /// Sets the value of [session][crate::model::DetectIntentRequest::session].
14494        ///
14495        /// This is a **required** field for requests.
14496        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
14497            self.0.request.session = v.into();
14498            self
14499        }
14500
14501        /// Sets the value of [query_params][crate::model::DetectIntentRequest::query_params].
14502        pub fn set_query_params<T>(mut self, v: T) -> Self
14503        where
14504            T: std::convert::Into<crate::model::QueryParameters>,
14505        {
14506            self.0.request.query_params = std::option::Option::Some(v.into());
14507            self
14508        }
14509
14510        /// Sets or clears the value of [query_params][crate::model::DetectIntentRequest::query_params].
14511        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
14512        where
14513            T: std::convert::Into<crate::model::QueryParameters>,
14514        {
14515            self.0.request.query_params = v.map(|x| x.into());
14516            self
14517        }
14518
14519        /// Sets the value of [query_input][crate::model::DetectIntentRequest::query_input].
14520        ///
14521        /// This is a **required** field for requests.
14522        pub fn set_query_input<T>(mut self, v: T) -> Self
14523        where
14524            T: std::convert::Into<crate::model::QueryInput>,
14525        {
14526            self.0.request.query_input = std::option::Option::Some(v.into());
14527            self
14528        }
14529
14530        /// Sets or clears the value of [query_input][crate::model::DetectIntentRequest::query_input].
14531        ///
14532        /// This is a **required** field for requests.
14533        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
14534        where
14535            T: std::convert::Into<crate::model::QueryInput>,
14536        {
14537            self.0.request.query_input = v.map(|x| x.into());
14538            self
14539        }
14540
14541        /// Sets the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
14542        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
14543        where
14544            T: std::convert::Into<crate::model::OutputAudioConfig>,
14545        {
14546            self.0.request.output_audio_config = std::option::Option::Some(v.into());
14547            self
14548        }
14549
14550        /// Sets or clears the value of [output_audio_config][crate::model::DetectIntentRequest::output_audio_config].
14551        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
14552        where
14553            T: std::convert::Into<crate::model::OutputAudioConfig>,
14554        {
14555            self.0.request.output_audio_config = v.map(|x| x.into());
14556            self
14557        }
14558
14559        /// Sets the value of [response_view][crate::model::DetectIntentRequest::response_view].
14560        pub fn set_response_view<T: Into<crate::model::DetectIntentResponseView>>(
14561            mut self,
14562            v: T,
14563        ) -> Self {
14564            self.0.request.response_view = v.into();
14565            self
14566        }
14567    }
14568
14569    #[doc(hidden)]
14570    impl crate::RequestBuilder for DetectIntent {
14571        fn request_options(&mut self) -> &mut crate::RequestOptions {
14572            &mut self.0.options
14573        }
14574    }
14575
14576    /// The request builder for [Sessions::match_intent][crate::client::Sessions::match_intent] calls.
14577    ///
14578    /// # Example
14579    /// ```
14580    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::MatchIntent;
14581    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14582    ///
14583    /// let builder = prepare_request_builder();
14584    /// let response = builder.send().await?;
14585    /// # Ok(()) }
14586    ///
14587    /// fn prepare_request_builder() -> MatchIntent {
14588    ///   # panic!();
14589    ///   // ... details omitted ...
14590    /// }
14591    /// ```
14592    #[derive(Clone, Debug)]
14593    pub struct MatchIntent(RequestBuilder<crate::model::MatchIntentRequest>);
14594
14595    impl MatchIntent {
14596        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14597            Self(RequestBuilder::new(stub))
14598        }
14599
14600        /// Sets the full request, replacing any prior values.
14601        pub fn with_request<V: Into<crate::model::MatchIntentRequest>>(mut self, v: V) -> Self {
14602            self.0.request = v.into();
14603            self
14604        }
14605
14606        /// Sets all the options, replacing any prior values.
14607        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14608            self.0.options = v.into();
14609            self
14610        }
14611
14612        /// Sends the request.
14613        pub async fn send(self) -> Result<crate::model::MatchIntentResponse> {
14614            (*self.0.stub)
14615                .match_intent(self.0.request, self.0.options)
14616                .await
14617                .map(crate::Response::into_body)
14618        }
14619
14620        /// Sets the value of [session][crate::model::MatchIntentRequest::session].
14621        ///
14622        /// This is a **required** field for requests.
14623        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
14624            self.0.request.session = v.into();
14625            self
14626        }
14627
14628        /// Sets the value of [query_params][crate::model::MatchIntentRequest::query_params].
14629        pub fn set_query_params<T>(mut self, v: T) -> Self
14630        where
14631            T: std::convert::Into<crate::model::QueryParameters>,
14632        {
14633            self.0.request.query_params = std::option::Option::Some(v.into());
14634            self
14635        }
14636
14637        /// Sets or clears the value of [query_params][crate::model::MatchIntentRequest::query_params].
14638        pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
14639        where
14640            T: std::convert::Into<crate::model::QueryParameters>,
14641        {
14642            self.0.request.query_params = v.map(|x| x.into());
14643            self
14644        }
14645
14646        /// Sets the value of [query_input][crate::model::MatchIntentRequest::query_input].
14647        ///
14648        /// This is a **required** field for requests.
14649        pub fn set_query_input<T>(mut self, v: T) -> Self
14650        where
14651            T: std::convert::Into<crate::model::QueryInput>,
14652        {
14653            self.0.request.query_input = std::option::Option::Some(v.into());
14654            self
14655        }
14656
14657        /// Sets or clears the value of [query_input][crate::model::MatchIntentRequest::query_input].
14658        ///
14659        /// This is a **required** field for requests.
14660        pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
14661        where
14662            T: std::convert::Into<crate::model::QueryInput>,
14663        {
14664            self.0.request.query_input = v.map(|x| x.into());
14665            self
14666        }
14667
14668        /// Sets the value of [persist_parameter_changes][crate::model::MatchIntentRequest::persist_parameter_changes].
14669        pub fn set_persist_parameter_changes<T: Into<bool>>(mut self, v: T) -> Self {
14670            self.0.request.persist_parameter_changes = v.into();
14671            self
14672        }
14673    }
14674
14675    #[doc(hidden)]
14676    impl crate::RequestBuilder for MatchIntent {
14677        fn request_options(&mut self) -> &mut crate::RequestOptions {
14678            &mut self.0.options
14679        }
14680    }
14681
14682    /// The request builder for [Sessions::fulfill_intent][crate::client::Sessions::fulfill_intent] calls.
14683    ///
14684    /// # Example
14685    /// ```
14686    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::FulfillIntent;
14687    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14688    ///
14689    /// let builder = prepare_request_builder();
14690    /// let response = builder.send().await?;
14691    /// # Ok(()) }
14692    ///
14693    /// fn prepare_request_builder() -> FulfillIntent {
14694    ///   # panic!();
14695    ///   // ... details omitted ...
14696    /// }
14697    /// ```
14698    #[derive(Clone, Debug)]
14699    pub struct FulfillIntent(RequestBuilder<crate::model::FulfillIntentRequest>);
14700
14701    impl FulfillIntent {
14702        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14703            Self(RequestBuilder::new(stub))
14704        }
14705
14706        /// Sets the full request, replacing any prior values.
14707        pub fn with_request<V: Into<crate::model::FulfillIntentRequest>>(mut self, v: V) -> Self {
14708            self.0.request = v.into();
14709            self
14710        }
14711
14712        /// Sets all the options, replacing any prior values.
14713        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14714            self.0.options = v.into();
14715            self
14716        }
14717
14718        /// Sends the request.
14719        pub async fn send(self) -> Result<crate::model::FulfillIntentResponse> {
14720            (*self.0.stub)
14721                .fulfill_intent(self.0.request, self.0.options)
14722                .await
14723                .map(crate::Response::into_body)
14724        }
14725
14726        /// Sets the value of [match_intent_request][crate::model::FulfillIntentRequest::match_intent_request].
14727        pub fn set_match_intent_request<T>(mut self, v: T) -> Self
14728        where
14729            T: std::convert::Into<crate::model::MatchIntentRequest>,
14730        {
14731            self.0.request.match_intent_request = std::option::Option::Some(v.into());
14732            self
14733        }
14734
14735        /// Sets or clears the value of [match_intent_request][crate::model::FulfillIntentRequest::match_intent_request].
14736        pub fn set_or_clear_match_intent_request<T>(mut self, v: std::option::Option<T>) -> Self
14737        where
14738            T: std::convert::Into<crate::model::MatchIntentRequest>,
14739        {
14740            self.0.request.match_intent_request = v.map(|x| x.into());
14741            self
14742        }
14743
14744        /// Sets the value of [r#match][crate::model::FulfillIntentRequest::match].
14745        pub fn set_match<T>(mut self, v: T) -> Self
14746        where
14747            T: std::convert::Into<crate::model::Match>,
14748        {
14749            self.0.request.r#match = std::option::Option::Some(v.into());
14750            self
14751        }
14752
14753        /// Sets or clears the value of [r#match][crate::model::FulfillIntentRequest::match].
14754        pub fn set_or_clear_match<T>(mut self, v: std::option::Option<T>) -> Self
14755        where
14756            T: std::convert::Into<crate::model::Match>,
14757        {
14758            self.0.request.r#match = v.map(|x| x.into());
14759            self
14760        }
14761
14762        /// Sets the value of [output_audio_config][crate::model::FulfillIntentRequest::output_audio_config].
14763        pub fn set_output_audio_config<T>(mut self, v: T) -> Self
14764        where
14765            T: std::convert::Into<crate::model::OutputAudioConfig>,
14766        {
14767            self.0.request.output_audio_config = std::option::Option::Some(v.into());
14768            self
14769        }
14770
14771        /// Sets or clears the value of [output_audio_config][crate::model::FulfillIntentRequest::output_audio_config].
14772        pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
14773        where
14774            T: std::convert::Into<crate::model::OutputAudioConfig>,
14775        {
14776            self.0.request.output_audio_config = v.map(|x| x.into());
14777            self
14778        }
14779    }
14780
14781    #[doc(hidden)]
14782    impl crate::RequestBuilder for FulfillIntent {
14783        fn request_options(&mut self) -> &mut crate::RequestOptions {
14784            &mut self.0.options
14785        }
14786    }
14787
14788    /// The request builder for [Sessions::submit_answer_feedback][crate::client::Sessions::submit_answer_feedback] calls.
14789    ///
14790    /// # Example
14791    /// ```
14792    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::SubmitAnswerFeedback;
14793    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14794    ///
14795    /// let builder = prepare_request_builder();
14796    /// let response = builder.send().await?;
14797    /// # Ok(()) }
14798    ///
14799    /// fn prepare_request_builder() -> SubmitAnswerFeedback {
14800    ///   # panic!();
14801    ///   // ... details omitted ...
14802    /// }
14803    /// ```
14804    #[derive(Clone, Debug)]
14805    pub struct SubmitAnswerFeedback(RequestBuilder<crate::model::SubmitAnswerFeedbackRequest>);
14806
14807    impl SubmitAnswerFeedback {
14808        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14809            Self(RequestBuilder::new(stub))
14810        }
14811
14812        /// Sets the full request, replacing any prior values.
14813        pub fn with_request<V: Into<crate::model::SubmitAnswerFeedbackRequest>>(
14814            mut self,
14815            v: V,
14816        ) -> Self {
14817            self.0.request = v.into();
14818            self
14819        }
14820
14821        /// Sets all the options, replacing any prior values.
14822        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14823            self.0.options = v.into();
14824            self
14825        }
14826
14827        /// Sends the request.
14828        pub async fn send(self) -> Result<crate::model::AnswerFeedback> {
14829            (*self.0.stub)
14830                .submit_answer_feedback(self.0.request, self.0.options)
14831                .await
14832                .map(crate::Response::into_body)
14833        }
14834
14835        /// Sets the value of [session][crate::model::SubmitAnswerFeedbackRequest::session].
14836        ///
14837        /// This is a **required** field for requests.
14838        pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
14839            self.0.request.session = v.into();
14840            self
14841        }
14842
14843        /// Sets the value of [response_id][crate::model::SubmitAnswerFeedbackRequest::response_id].
14844        ///
14845        /// This is a **required** field for requests.
14846        pub fn set_response_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14847            self.0.request.response_id = v.into();
14848            self
14849        }
14850
14851        /// Sets the value of [answer_feedback][crate::model::SubmitAnswerFeedbackRequest::answer_feedback].
14852        ///
14853        /// This is a **required** field for requests.
14854        pub fn set_answer_feedback<T>(mut self, v: T) -> Self
14855        where
14856            T: std::convert::Into<crate::model::AnswerFeedback>,
14857        {
14858            self.0.request.answer_feedback = std::option::Option::Some(v.into());
14859            self
14860        }
14861
14862        /// Sets or clears the value of [answer_feedback][crate::model::SubmitAnswerFeedbackRequest::answer_feedback].
14863        ///
14864        /// This is a **required** field for requests.
14865        pub fn set_or_clear_answer_feedback<T>(mut self, v: std::option::Option<T>) -> Self
14866        where
14867            T: std::convert::Into<crate::model::AnswerFeedback>,
14868        {
14869            self.0.request.answer_feedback = v.map(|x| x.into());
14870            self
14871        }
14872
14873        /// Sets the value of [update_mask][crate::model::SubmitAnswerFeedbackRequest::update_mask].
14874        pub fn set_update_mask<T>(mut self, v: T) -> Self
14875        where
14876            T: std::convert::Into<wkt::FieldMask>,
14877        {
14878            self.0.request.update_mask = std::option::Option::Some(v.into());
14879            self
14880        }
14881
14882        /// Sets or clears the value of [update_mask][crate::model::SubmitAnswerFeedbackRequest::update_mask].
14883        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14884        where
14885            T: std::convert::Into<wkt::FieldMask>,
14886        {
14887            self.0.request.update_mask = v.map(|x| x.into());
14888            self
14889        }
14890    }
14891
14892    #[doc(hidden)]
14893    impl crate::RequestBuilder for SubmitAnswerFeedback {
14894        fn request_options(&mut self) -> &mut crate::RequestOptions {
14895            &mut self.0.options
14896        }
14897    }
14898
14899    /// The request builder for [Sessions::list_locations][crate::client::Sessions::list_locations] calls.
14900    ///
14901    /// # Example
14902    /// ```
14903    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::ListLocations;
14904    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
14905    /// use google_cloud_gax::paginator::ItemPaginator;
14906    ///
14907    /// let builder = prepare_request_builder();
14908    /// let mut items = builder.by_item();
14909    /// while let Some(result) = items.next().await {
14910    ///   let item = result?;
14911    /// }
14912    /// # Ok(()) }
14913    ///
14914    /// fn prepare_request_builder() -> ListLocations {
14915    ///   # panic!();
14916    ///   // ... details omitted ...
14917    /// }
14918    /// ```
14919    #[derive(Clone, Debug)]
14920    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14921
14922    impl ListLocations {
14923        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14924            Self(RequestBuilder::new(stub))
14925        }
14926
14927        /// Sets the full request, replacing any prior values.
14928        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14929            mut self,
14930            v: V,
14931        ) -> Self {
14932            self.0.request = v.into();
14933            self
14934        }
14935
14936        /// Sets all the options, replacing any prior values.
14937        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14938            self.0.options = v.into();
14939            self
14940        }
14941
14942        /// Sends the request.
14943        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14944            (*self.0.stub)
14945                .list_locations(self.0.request, self.0.options)
14946                .await
14947                .map(crate::Response::into_body)
14948        }
14949
14950        /// Streams each page in the collection.
14951        pub fn by_page(
14952            self,
14953        ) -> impl google_cloud_gax::paginator::Paginator<
14954            google_cloud_location::model::ListLocationsResponse,
14955            crate::Error,
14956        > {
14957            use std::clone::Clone;
14958            let token = self.0.request.page_token.clone();
14959            let execute = move |token: String| {
14960                let mut builder = self.clone();
14961                builder.0.request = builder.0.request.set_page_token(token);
14962                builder.send()
14963            };
14964            google_cloud_gax::paginator::internal::new_paginator(token, execute)
14965        }
14966
14967        /// Streams each item in the collection.
14968        pub fn by_item(
14969            self,
14970        ) -> impl google_cloud_gax::paginator::ItemPaginator<
14971            google_cloud_location::model::ListLocationsResponse,
14972            crate::Error,
14973        > {
14974            use google_cloud_gax::paginator::Paginator;
14975            self.by_page().items()
14976        }
14977
14978        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
14979        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14980            self.0.request.name = v.into();
14981            self
14982        }
14983
14984        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
14985        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14986            self.0.request.filter = v.into();
14987            self
14988        }
14989
14990        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
14991        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14992            self.0.request.page_size = v.into();
14993            self
14994        }
14995
14996        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
14997        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14998            self.0.request.page_token = v.into();
14999            self
15000        }
15001    }
15002
15003    #[doc(hidden)]
15004    impl crate::RequestBuilder for ListLocations {
15005        fn request_options(&mut self) -> &mut crate::RequestOptions {
15006            &mut self.0.options
15007        }
15008    }
15009
15010    /// The request builder for [Sessions::get_location][crate::client::Sessions::get_location] calls.
15011    ///
15012    /// # Example
15013    /// ```
15014    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::GetLocation;
15015    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15016    ///
15017    /// let builder = prepare_request_builder();
15018    /// let response = builder.send().await?;
15019    /// # Ok(()) }
15020    ///
15021    /// fn prepare_request_builder() -> GetLocation {
15022    ///   # panic!();
15023    ///   // ... details omitted ...
15024    /// }
15025    /// ```
15026    #[derive(Clone, Debug)]
15027    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15028
15029    impl GetLocation {
15030        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15031            Self(RequestBuilder::new(stub))
15032        }
15033
15034        /// Sets the full request, replacing any prior values.
15035        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15036            mut self,
15037            v: V,
15038        ) -> Self {
15039            self.0.request = v.into();
15040            self
15041        }
15042
15043        /// Sets all the options, replacing any prior values.
15044        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15045            self.0.options = v.into();
15046            self
15047        }
15048
15049        /// Sends the request.
15050        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15051            (*self.0.stub)
15052                .get_location(self.0.request, self.0.options)
15053                .await
15054                .map(crate::Response::into_body)
15055        }
15056
15057        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
15058        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15059            self.0.request.name = v.into();
15060            self
15061        }
15062    }
15063
15064    #[doc(hidden)]
15065    impl crate::RequestBuilder for GetLocation {
15066        fn request_options(&mut self) -> &mut crate::RequestOptions {
15067            &mut self.0.options
15068        }
15069    }
15070
15071    /// The request builder for [Sessions::list_operations][crate::client::Sessions::list_operations] calls.
15072    ///
15073    /// # Example
15074    /// ```
15075    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::ListOperations;
15076    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15077    /// use google_cloud_gax::paginator::ItemPaginator;
15078    ///
15079    /// let builder = prepare_request_builder();
15080    /// let mut items = builder.by_item();
15081    /// while let Some(result) = items.next().await {
15082    ///   let item = result?;
15083    /// }
15084    /// # Ok(()) }
15085    ///
15086    /// fn prepare_request_builder() -> ListOperations {
15087    ///   # panic!();
15088    ///   // ... details omitted ...
15089    /// }
15090    /// ```
15091    #[derive(Clone, Debug)]
15092    pub struct ListOperations(
15093        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15094    );
15095
15096    impl ListOperations {
15097        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15098            Self(RequestBuilder::new(stub))
15099        }
15100
15101        /// Sets the full request, replacing any prior values.
15102        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15103            mut self,
15104            v: V,
15105        ) -> Self {
15106            self.0.request = v.into();
15107            self
15108        }
15109
15110        /// Sets all the options, replacing any prior values.
15111        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15112            self.0.options = v.into();
15113            self
15114        }
15115
15116        /// Sends the request.
15117        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15118            (*self.0.stub)
15119                .list_operations(self.0.request, self.0.options)
15120                .await
15121                .map(crate::Response::into_body)
15122        }
15123
15124        /// Streams each page in the collection.
15125        pub fn by_page(
15126            self,
15127        ) -> impl google_cloud_gax::paginator::Paginator<
15128            google_cloud_longrunning::model::ListOperationsResponse,
15129            crate::Error,
15130        > {
15131            use std::clone::Clone;
15132            let token = self.0.request.page_token.clone();
15133            let execute = move |token: String| {
15134                let mut builder = self.clone();
15135                builder.0.request = builder.0.request.set_page_token(token);
15136                builder.send()
15137            };
15138            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15139        }
15140
15141        /// Streams each item in the collection.
15142        pub fn by_item(
15143            self,
15144        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15145            google_cloud_longrunning::model::ListOperationsResponse,
15146            crate::Error,
15147        > {
15148            use google_cloud_gax::paginator::Paginator;
15149            self.by_page().items()
15150        }
15151
15152        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
15153        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15154            self.0.request.name = v.into();
15155            self
15156        }
15157
15158        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
15159        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15160            self.0.request.filter = v.into();
15161            self
15162        }
15163
15164        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
15165        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15166            self.0.request.page_size = v.into();
15167            self
15168        }
15169
15170        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
15171        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15172            self.0.request.page_token = v.into();
15173            self
15174        }
15175
15176        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
15177        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15178            self.0.request.return_partial_success = v.into();
15179            self
15180        }
15181    }
15182
15183    #[doc(hidden)]
15184    impl crate::RequestBuilder for ListOperations {
15185        fn request_options(&mut self) -> &mut crate::RequestOptions {
15186            &mut self.0.options
15187        }
15188    }
15189
15190    /// The request builder for [Sessions::get_operation][crate::client::Sessions::get_operation] calls.
15191    ///
15192    /// # Example
15193    /// ```
15194    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::GetOperation;
15195    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15196    ///
15197    /// let builder = prepare_request_builder();
15198    /// let response = builder.send().await?;
15199    /// # Ok(()) }
15200    ///
15201    /// fn prepare_request_builder() -> GetOperation {
15202    ///   # panic!();
15203    ///   // ... details omitted ...
15204    /// }
15205    /// ```
15206    #[derive(Clone, Debug)]
15207    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15208
15209    impl GetOperation {
15210        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15211            Self(RequestBuilder::new(stub))
15212        }
15213
15214        /// Sets the full request, replacing any prior values.
15215        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15216            mut self,
15217            v: V,
15218        ) -> Self {
15219            self.0.request = v.into();
15220            self
15221        }
15222
15223        /// Sets all the options, replacing any prior values.
15224        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15225            self.0.options = v.into();
15226            self
15227        }
15228
15229        /// Sends the request.
15230        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15231            (*self.0.stub)
15232                .get_operation(self.0.request, self.0.options)
15233                .await
15234                .map(crate::Response::into_body)
15235        }
15236
15237        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
15238        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15239            self.0.request.name = v.into();
15240            self
15241        }
15242    }
15243
15244    #[doc(hidden)]
15245    impl crate::RequestBuilder for GetOperation {
15246        fn request_options(&mut self) -> &mut crate::RequestOptions {
15247            &mut self.0.options
15248        }
15249    }
15250
15251    /// The request builder for [Sessions::cancel_operation][crate::client::Sessions::cancel_operation] calls.
15252    ///
15253    /// # Example
15254    /// ```
15255    /// # use google_cloud_dialogflow_cx_v3::builder::sessions::CancelOperation;
15256    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15257    ///
15258    /// let builder = prepare_request_builder();
15259    /// let response = builder.send().await?;
15260    /// # Ok(()) }
15261    ///
15262    /// fn prepare_request_builder() -> CancelOperation {
15263    ///   # panic!();
15264    ///   // ... details omitted ...
15265    /// }
15266    /// ```
15267    #[derive(Clone, Debug)]
15268    pub struct CancelOperation(
15269        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15270    );
15271
15272    impl CancelOperation {
15273        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15274            Self(RequestBuilder::new(stub))
15275        }
15276
15277        /// Sets the full request, replacing any prior values.
15278        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15279            mut self,
15280            v: V,
15281        ) -> Self {
15282            self.0.request = v.into();
15283            self
15284        }
15285
15286        /// Sets all the options, replacing any prior values.
15287        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15288            self.0.options = v.into();
15289            self
15290        }
15291
15292        /// Sends the request.
15293        pub async fn send(self) -> Result<()> {
15294            (*self.0.stub)
15295                .cancel_operation(self.0.request, self.0.options)
15296                .await
15297                .map(crate::Response::into_body)
15298        }
15299
15300        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
15301        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15302            self.0.request.name = v.into();
15303            self
15304        }
15305    }
15306
15307    #[doc(hidden)]
15308    impl crate::RequestBuilder for CancelOperation {
15309        fn request_options(&mut self) -> &mut crate::RequestOptions {
15310            &mut self.0.options
15311        }
15312    }
15313}
15314
15315/// Request and client builders for [SessionEntityTypes][crate::client::SessionEntityTypes].
15316#[cfg(feature = "session-entity-types")]
15317#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
15318pub mod session_entity_types {
15319    use crate::Result;
15320
15321    /// A builder for [SessionEntityTypes][crate::client::SessionEntityTypes].
15322    ///
15323    /// ```
15324    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
15325    /// # use google_cloud_dialogflow_cx_v3::*;
15326    /// # use builder::session_entity_types::ClientBuilder;
15327    /// # use client::SessionEntityTypes;
15328    /// let builder : ClientBuilder = SessionEntityTypes::builder();
15329    /// let client = builder
15330    ///     .with_endpoint("https://dialogflow.googleapis.com")
15331    ///     .build().await?;
15332    /// # Ok(()) }
15333    /// ```
15334    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15335
15336    pub(crate) mod client {
15337        use super::super::super::client::SessionEntityTypes;
15338        pub struct Factory;
15339        impl crate::ClientFactory for Factory {
15340            type Client = SessionEntityTypes;
15341            type Credentials = gaxi::options::Credentials;
15342            async fn build(
15343                self,
15344                config: gaxi::options::ClientConfig,
15345            ) -> crate::ClientBuilderResult<Self::Client> {
15346                Self::Client::new(config).await
15347            }
15348        }
15349    }
15350
15351    /// Common implementation for [crate::client::SessionEntityTypes] request builders.
15352    #[derive(Clone, Debug)]
15353    pub(crate) struct RequestBuilder<R: std::default::Default> {
15354        stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15355        request: R,
15356        options: crate::RequestOptions,
15357    }
15358
15359    impl<R> RequestBuilder<R>
15360    where
15361        R: std::default::Default,
15362    {
15363        pub(crate) fn new(
15364            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15365        ) -> Self {
15366            Self {
15367                stub,
15368                request: R::default(),
15369                options: crate::RequestOptions::default(),
15370            }
15371        }
15372    }
15373
15374    /// The request builder for [SessionEntityTypes::list_session_entity_types][crate::client::SessionEntityTypes::list_session_entity_types] calls.
15375    ///
15376    /// # Example
15377    /// ```
15378    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::ListSessionEntityTypes;
15379    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15380    /// use google_cloud_gax::paginator::ItemPaginator;
15381    ///
15382    /// let builder = prepare_request_builder();
15383    /// let mut items = builder.by_item();
15384    /// while let Some(result) = items.next().await {
15385    ///   let item = result?;
15386    /// }
15387    /// # Ok(()) }
15388    ///
15389    /// fn prepare_request_builder() -> ListSessionEntityTypes {
15390    ///   # panic!();
15391    ///   // ... details omitted ...
15392    /// }
15393    /// ```
15394    #[derive(Clone, Debug)]
15395    pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
15396
15397    impl ListSessionEntityTypes {
15398        pub(crate) fn new(
15399            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15400        ) -> Self {
15401            Self(RequestBuilder::new(stub))
15402        }
15403
15404        /// Sets the full request, replacing any prior values.
15405        pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
15406            mut self,
15407            v: V,
15408        ) -> Self {
15409            self.0.request = v.into();
15410            self
15411        }
15412
15413        /// Sets all the options, replacing any prior values.
15414        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15415            self.0.options = v.into();
15416            self
15417        }
15418
15419        /// Sends the request.
15420        pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
15421            (*self.0.stub)
15422                .list_session_entity_types(self.0.request, self.0.options)
15423                .await
15424                .map(crate::Response::into_body)
15425        }
15426
15427        /// Streams each page in the collection.
15428        pub fn by_page(
15429            self,
15430        ) -> impl google_cloud_gax::paginator::Paginator<
15431            crate::model::ListSessionEntityTypesResponse,
15432            crate::Error,
15433        > {
15434            use std::clone::Clone;
15435            let token = self.0.request.page_token.clone();
15436            let execute = move |token: String| {
15437                let mut builder = self.clone();
15438                builder.0.request = builder.0.request.set_page_token(token);
15439                builder.send()
15440            };
15441            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15442        }
15443
15444        /// Streams each item in the collection.
15445        pub fn by_item(
15446            self,
15447        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15448            crate::model::ListSessionEntityTypesResponse,
15449            crate::Error,
15450        > {
15451            use google_cloud_gax::paginator::Paginator;
15452            self.by_page().items()
15453        }
15454
15455        /// Sets the value of [parent][crate::model::ListSessionEntityTypesRequest::parent].
15456        ///
15457        /// This is a **required** field for requests.
15458        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15459            self.0.request.parent = v.into();
15460            self
15461        }
15462
15463        /// Sets the value of [page_size][crate::model::ListSessionEntityTypesRequest::page_size].
15464        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15465            self.0.request.page_size = v.into();
15466            self
15467        }
15468
15469        /// Sets the value of [page_token][crate::model::ListSessionEntityTypesRequest::page_token].
15470        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15471            self.0.request.page_token = v.into();
15472            self
15473        }
15474    }
15475
15476    #[doc(hidden)]
15477    impl crate::RequestBuilder for ListSessionEntityTypes {
15478        fn request_options(&mut self) -> &mut crate::RequestOptions {
15479            &mut self.0.options
15480        }
15481    }
15482
15483    /// The request builder for [SessionEntityTypes::get_session_entity_type][crate::client::SessionEntityTypes::get_session_entity_type] calls.
15484    ///
15485    /// # Example
15486    /// ```
15487    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::GetSessionEntityType;
15488    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15489    ///
15490    /// let builder = prepare_request_builder();
15491    /// let response = builder.send().await?;
15492    /// # Ok(()) }
15493    ///
15494    /// fn prepare_request_builder() -> GetSessionEntityType {
15495    ///   # panic!();
15496    ///   // ... details omitted ...
15497    /// }
15498    /// ```
15499    #[derive(Clone, Debug)]
15500    pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
15501
15502    impl GetSessionEntityType {
15503        pub(crate) fn new(
15504            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15505        ) -> Self {
15506            Self(RequestBuilder::new(stub))
15507        }
15508
15509        /// Sets the full request, replacing any prior values.
15510        pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
15511            mut self,
15512            v: V,
15513        ) -> Self {
15514            self.0.request = v.into();
15515            self
15516        }
15517
15518        /// Sets all the options, replacing any prior values.
15519        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15520            self.0.options = v.into();
15521            self
15522        }
15523
15524        /// Sends the request.
15525        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
15526            (*self.0.stub)
15527                .get_session_entity_type(self.0.request, self.0.options)
15528                .await
15529                .map(crate::Response::into_body)
15530        }
15531
15532        /// Sets the value of [name][crate::model::GetSessionEntityTypeRequest::name].
15533        ///
15534        /// This is a **required** field for requests.
15535        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15536            self.0.request.name = v.into();
15537            self
15538        }
15539    }
15540
15541    #[doc(hidden)]
15542    impl crate::RequestBuilder for GetSessionEntityType {
15543        fn request_options(&mut self) -> &mut crate::RequestOptions {
15544            &mut self.0.options
15545        }
15546    }
15547
15548    /// The request builder for [SessionEntityTypes::create_session_entity_type][crate::client::SessionEntityTypes::create_session_entity_type] calls.
15549    ///
15550    /// # Example
15551    /// ```
15552    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::CreateSessionEntityType;
15553    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15554    ///
15555    /// let builder = prepare_request_builder();
15556    /// let response = builder.send().await?;
15557    /// # Ok(()) }
15558    ///
15559    /// fn prepare_request_builder() -> CreateSessionEntityType {
15560    ///   # panic!();
15561    ///   // ... details omitted ...
15562    /// }
15563    /// ```
15564    #[derive(Clone, Debug)]
15565    pub struct CreateSessionEntityType(
15566        RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
15567    );
15568
15569    impl CreateSessionEntityType {
15570        pub(crate) fn new(
15571            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15572        ) -> Self {
15573            Self(RequestBuilder::new(stub))
15574        }
15575
15576        /// Sets the full request, replacing any prior values.
15577        pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
15578            mut self,
15579            v: V,
15580        ) -> Self {
15581            self.0.request = v.into();
15582            self
15583        }
15584
15585        /// Sets all the options, replacing any prior values.
15586        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15587            self.0.options = v.into();
15588            self
15589        }
15590
15591        /// Sends the request.
15592        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
15593            (*self.0.stub)
15594                .create_session_entity_type(self.0.request, self.0.options)
15595                .await
15596                .map(crate::Response::into_body)
15597        }
15598
15599        /// Sets the value of [parent][crate::model::CreateSessionEntityTypeRequest::parent].
15600        ///
15601        /// This is a **required** field for requests.
15602        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15603            self.0.request.parent = v.into();
15604            self
15605        }
15606
15607        /// Sets the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
15608        ///
15609        /// This is a **required** field for requests.
15610        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
15611        where
15612            T: std::convert::Into<crate::model::SessionEntityType>,
15613        {
15614            self.0.request.session_entity_type = std::option::Option::Some(v.into());
15615            self
15616        }
15617
15618        /// Sets or clears the value of [session_entity_type][crate::model::CreateSessionEntityTypeRequest::session_entity_type].
15619        ///
15620        /// This is a **required** field for requests.
15621        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
15622        where
15623            T: std::convert::Into<crate::model::SessionEntityType>,
15624        {
15625            self.0.request.session_entity_type = v.map(|x| x.into());
15626            self
15627        }
15628    }
15629
15630    #[doc(hidden)]
15631    impl crate::RequestBuilder for CreateSessionEntityType {
15632        fn request_options(&mut self) -> &mut crate::RequestOptions {
15633            &mut self.0.options
15634        }
15635    }
15636
15637    /// The request builder for [SessionEntityTypes::update_session_entity_type][crate::client::SessionEntityTypes::update_session_entity_type] calls.
15638    ///
15639    /// # Example
15640    /// ```
15641    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::UpdateSessionEntityType;
15642    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15643    ///
15644    /// let builder = prepare_request_builder();
15645    /// let response = builder.send().await?;
15646    /// # Ok(()) }
15647    ///
15648    /// fn prepare_request_builder() -> UpdateSessionEntityType {
15649    ///   # panic!();
15650    ///   // ... details omitted ...
15651    /// }
15652    /// ```
15653    #[derive(Clone, Debug)]
15654    pub struct UpdateSessionEntityType(
15655        RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
15656    );
15657
15658    impl UpdateSessionEntityType {
15659        pub(crate) fn new(
15660            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15661        ) -> Self {
15662            Self(RequestBuilder::new(stub))
15663        }
15664
15665        /// Sets the full request, replacing any prior values.
15666        pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
15667            mut self,
15668            v: V,
15669        ) -> Self {
15670            self.0.request = v.into();
15671            self
15672        }
15673
15674        /// Sets all the options, replacing any prior values.
15675        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15676            self.0.options = v.into();
15677            self
15678        }
15679
15680        /// Sends the request.
15681        pub async fn send(self) -> Result<crate::model::SessionEntityType> {
15682            (*self.0.stub)
15683                .update_session_entity_type(self.0.request, self.0.options)
15684                .await
15685                .map(crate::Response::into_body)
15686        }
15687
15688        /// Sets the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
15689        ///
15690        /// This is a **required** field for requests.
15691        pub fn set_session_entity_type<T>(mut self, v: T) -> Self
15692        where
15693            T: std::convert::Into<crate::model::SessionEntityType>,
15694        {
15695            self.0.request.session_entity_type = std::option::Option::Some(v.into());
15696            self
15697        }
15698
15699        /// Sets or clears the value of [session_entity_type][crate::model::UpdateSessionEntityTypeRequest::session_entity_type].
15700        ///
15701        /// This is a **required** field for requests.
15702        pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
15703        where
15704            T: std::convert::Into<crate::model::SessionEntityType>,
15705        {
15706            self.0.request.session_entity_type = v.map(|x| x.into());
15707            self
15708        }
15709
15710        /// Sets the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
15711        pub fn set_update_mask<T>(mut self, v: T) -> Self
15712        where
15713            T: std::convert::Into<wkt::FieldMask>,
15714        {
15715            self.0.request.update_mask = std::option::Option::Some(v.into());
15716            self
15717        }
15718
15719        /// Sets or clears the value of [update_mask][crate::model::UpdateSessionEntityTypeRequest::update_mask].
15720        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15721        where
15722            T: std::convert::Into<wkt::FieldMask>,
15723        {
15724            self.0.request.update_mask = v.map(|x| x.into());
15725            self
15726        }
15727    }
15728
15729    #[doc(hidden)]
15730    impl crate::RequestBuilder for UpdateSessionEntityType {
15731        fn request_options(&mut self) -> &mut crate::RequestOptions {
15732            &mut self.0.options
15733        }
15734    }
15735
15736    /// The request builder for [SessionEntityTypes::delete_session_entity_type][crate::client::SessionEntityTypes::delete_session_entity_type] calls.
15737    ///
15738    /// # Example
15739    /// ```
15740    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::DeleteSessionEntityType;
15741    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15742    ///
15743    /// let builder = prepare_request_builder();
15744    /// let response = builder.send().await?;
15745    /// # Ok(()) }
15746    ///
15747    /// fn prepare_request_builder() -> DeleteSessionEntityType {
15748    ///   # panic!();
15749    ///   // ... details omitted ...
15750    /// }
15751    /// ```
15752    #[derive(Clone, Debug)]
15753    pub struct DeleteSessionEntityType(
15754        RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
15755    );
15756
15757    impl DeleteSessionEntityType {
15758        pub(crate) fn new(
15759            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15760        ) -> Self {
15761            Self(RequestBuilder::new(stub))
15762        }
15763
15764        /// Sets the full request, replacing any prior values.
15765        pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
15766            mut self,
15767            v: V,
15768        ) -> Self {
15769            self.0.request = v.into();
15770            self
15771        }
15772
15773        /// Sets all the options, replacing any prior values.
15774        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15775            self.0.options = v.into();
15776            self
15777        }
15778
15779        /// Sends the request.
15780        pub async fn send(self) -> Result<()> {
15781            (*self.0.stub)
15782                .delete_session_entity_type(self.0.request, self.0.options)
15783                .await
15784                .map(crate::Response::into_body)
15785        }
15786
15787        /// Sets the value of [name][crate::model::DeleteSessionEntityTypeRequest::name].
15788        ///
15789        /// This is a **required** field for requests.
15790        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15791            self.0.request.name = v.into();
15792            self
15793        }
15794    }
15795
15796    #[doc(hidden)]
15797    impl crate::RequestBuilder for DeleteSessionEntityType {
15798        fn request_options(&mut self) -> &mut crate::RequestOptions {
15799            &mut self.0.options
15800        }
15801    }
15802
15803    /// The request builder for [SessionEntityTypes::list_locations][crate::client::SessionEntityTypes::list_locations] calls.
15804    ///
15805    /// # Example
15806    /// ```
15807    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::ListLocations;
15808    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15809    /// use google_cloud_gax::paginator::ItemPaginator;
15810    ///
15811    /// let builder = prepare_request_builder();
15812    /// let mut items = builder.by_item();
15813    /// while let Some(result) = items.next().await {
15814    ///   let item = result?;
15815    /// }
15816    /// # Ok(()) }
15817    ///
15818    /// fn prepare_request_builder() -> ListLocations {
15819    ///   # panic!();
15820    ///   // ... details omitted ...
15821    /// }
15822    /// ```
15823    #[derive(Clone, Debug)]
15824    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15825
15826    impl ListLocations {
15827        pub(crate) fn new(
15828            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15829        ) -> Self {
15830            Self(RequestBuilder::new(stub))
15831        }
15832
15833        /// Sets the full request, replacing any prior values.
15834        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15835            mut self,
15836            v: V,
15837        ) -> Self {
15838            self.0.request = v.into();
15839            self
15840        }
15841
15842        /// Sets all the options, replacing any prior values.
15843        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15844            self.0.options = v.into();
15845            self
15846        }
15847
15848        /// Sends the request.
15849        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15850            (*self.0.stub)
15851                .list_locations(self.0.request, self.0.options)
15852                .await
15853                .map(crate::Response::into_body)
15854        }
15855
15856        /// Streams each page in the collection.
15857        pub fn by_page(
15858            self,
15859        ) -> impl google_cloud_gax::paginator::Paginator<
15860            google_cloud_location::model::ListLocationsResponse,
15861            crate::Error,
15862        > {
15863            use std::clone::Clone;
15864            let token = self.0.request.page_token.clone();
15865            let execute = move |token: String| {
15866                let mut builder = self.clone();
15867                builder.0.request = builder.0.request.set_page_token(token);
15868                builder.send()
15869            };
15870            google_cloud_gax::paginator::internal::new_paginator(token, execute)
15871        }
15872
15873        /// Streams each item in the collection.
15874        pub fn by_item(
15875            self,
15876        ) -> impl google_cloud_gax::paginator::ItemPaginator<
15877            google_cloud_location::model::ListLocationsResponse,
15878            crate::Error,
15879        > {
15880            use google_cloud_gax::paginator::Paginator;
15881            self.by_page().items()
15882        }
15883
15884        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
15885        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15886            self.0.request.name = v.into();
15887            self
15888        }
15889
15890        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
15891        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15892            self.0.request.filter = v.into();
15893            self
15894        }
15895
15896        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
15897        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15898            self.0.request.page_size = v.into();
15899            self
15900        }
15901
15902        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
15903        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15904            self.0.request.page_token = v.into();
15905            self
15906        }
15907    }
15908
15909    #[doc(hidden)]
15910    impl crate::RequestBuilder for ListLocations {
15911        fn request_options(&mut self) -> &mut crate::RequestOptions {
15912            &mut self.0.options
15913        }
15914    }
15915
15916    /// The request builder for [SessionEntityTypes::get_location][crate::client::SessionEntityTypes::get_location] calls.
15917    ///
15918    /// # Example
15919    /// ```
15920    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::GetLocation;
15921    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15922    ///
15923    /// let builder = prepare_request_builder();
15924    /// let response = builder.send().await?;
15925    /// # Ok(()) }
15926    ///
15927    /// fn prepare_request_builder() -> GetLocation {
15928    ///   # panic!();
15929    ///   // ... details omitted ...
15930    /// }
15931    /// ```
15932    #[derive(Clone, Debug)]
15933    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15934
15935    impl GetLocation {
15936        pub(crate) fn new(
15937            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15938        ) -> Self {
15939            Self(RequestBuilder::new(stub))
15940        }
15941
15942        /// Sets the full request, replacing any prior values.
15943        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15944            mut self,
15945            v: V,
15946        ) -> Self {
15947            self.0.request = v.into();
15948            self
15949        }
15950
15951        /// Sets all the options, replacing any prior values.
15952        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15953            self.0.options = v.into();
15954            self
15955        }
15956
15957        /// Sends the request.
15958        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15959            (*self.0.stub)
15960                .get_location(self.0.request, self.0.options)
15961                .await
15962                .map(crate::Response::into_body)
15963        }
15964
15965        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
15966        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15967            self.0.request.name = v.into();
15968            self
15969        }
15970    }
15971
15972    #[doc(hidden)]
15973    impl crate::RequestBuilder for GetLocation {
15974        fn request_options(&mut self) -> &mut crate::RequestOptions {
15975            &mut self.0.options
15976        }
15977    }
15978
15979    /// The request builder for [SessionEntityTypes::list_operations][crate::client::SessionEntityTypes::list_operations] calls.
15980    ///
15981    /// # Example
15982    /// ```
15983    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::ListOperations;
15984    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
15985    /// use google_cloud_gax::paginator::ItemPaginator;
15986    ///
15987    /// let builder = prepare_request_builder();
15988    /// let mut items = builder.by_item();
15989    /// while let Some(result) = items.next().await {
15990    ///   let item = result?;
15991    /// }
15992    /// # Ok(()) }
15993    ///
15994    /// fn prepare_request_builder() -> ListOperations {
15995    ///   # panic!();
15996    ///   // ... details omitted ...
15997    /// }
15998    /// ```
15999    #[derive(Clone, Debug)]
16000    pub struct ListOperations(
16001        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16002    );
16003
16004    impl ListOperations {
16005        pub(crate) fn new(
16006            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
16007        ) -> Self {
16008            Self(RequestBuilder::new(stub))
16009        }
16010
16011        /// Sets the full request, replacing any prior values.
16012        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16013            mut self,
16014            v: V,
16015        ) -> Self {
16016            self.0.request = v.into();
16017            self
16018        }
16019
16020        /// Sets all the options, replacing any prior values.
16021        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16022            self.0.options = v.into();
16023            self
16024        }
16025
16026        /// Sends the request.
16027        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16028            (*self.0.stub)
16029                .list_operations(self.0.request, self.0.options)
16030                .await
16031                .map(crate::Response::into_body)
16032        }
16033
16034        /// Streams each page in the collection.
16035        pub fn by_page(
16036            self,
16037        ) -> impl google_cloud_gax::paginator::Paginator<
16038            google_cloud_longrunning::model::ListOperationsResponse,
16039            crate::Error,
16040        > {
16041            use std::clone::Clone;
16042            let token = self.0.request.page_token.clone();
16043            let execute = move |token: String| {
16044                let mut builder = self.clone();
16045                builder.0.request = builder.0.request.set_page_token(token);
16046                builder.send()
16047            };
16048            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16049        }
16050
16051        /// Streams each item in the collection.
16052        pub fn by_item(
16053            self,
16054        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16055            google_cloud_longrunning::model::ListOperationsResponse,
16056            crate::Error,
16057        > {
16058            use google_cloud_gax::paginator::Paginator;
16059            self.by_page().items()
16060        }
16061
16062        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
16063        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16064            self.0.request.name = v.into();
16065            self
16066        }
16067
16068        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
16069        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16070            self.0.request.filter = v.into();
16071            self
16072        }
16073
16074        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
16075        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16076            self.0.request.page_size = v.into();
16077            self
16078        }
16079
16080        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
16081        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16082            self.0.request.page_token = v.into();
16083            self
16084        }
16085
16086        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
16087        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16088            self.0.request.return_partial_success = v.into();
16089            self
16090        }
16091    }
16092
16093    #[doc(hidden)]
16094    impl crate::RequestBuilder for ListOperations {
16095        fn request_options(&mut self) -> &mut crate::RequestOptions {
16096            &mut self.0.options
16097        }
16098    }
16099
16100    /// The request builder for [SessionEntityTypes::get_operation][crate::client::SessionEntityTypes::get_operation] calls.
16101    ///
16102    /// # Example
16103    /// ```
16104    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::GetOperation;
16105    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16106    ///
16107    /// let builder = prepare_request_builder();
16108    /// let response = builder.send().await?;
16109    /// # Ok(()) }
16110    ///
16111    /// fn prepare_request_builder() -> GetOperation {
16112    ///   # panic!();
16113    ///   // ... details omitted ...
16114    /// }
16115    /// ```
16116    #[derive(Clone, Debug)]
16117    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
16118
16119    impl GetOperation {
16120        pub(crate) fn new(
16121            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
16122        ) -> Self {
16123            Self(RequestBuilder::new(stub))
16124        }
16125
16126        /// Sets the full request, replacing any prior values.
16127        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
16128            mut self,
16129            v: V,
16130        ) -> Self {
16131            self.0.request = v.into();
16132            self
16133        }
16134
16135        /// Sets all the options, replacing any prior values.
16136        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16137            self.0.options = v.into();
16138            self
16139        }
16140
16141        /// Sends the request.
16142        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16143            (*self.0.stub)
16144                .get_operation(self.0.request, self.0.options)
16145                .await
16146                .map(crate::Response::into_body)
16147        }
16148
16149        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
16150        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16151            self.0.request.name = v.into();
16152            self
16153        }
16154    }
16155
16156    #[doc(hidden)]
16157    impl crate::RequestBuilder for GetOperation {
16158        fn request_options(&mut self) -> &mut crate::RequestOptions {
16159            &mut self.0.options
16160        }
16161    }
16162
16163    /// The request builder for [SessionEntityTypes::cancel_operation][crate::client::SessionEntityTypes::cancel_operation] calls.
16164    ///
16165    /// # Example
16166    /// ```
16167    /// # use google_cloud_dialogflow_cx_v3::builder::session_entity_types::CancelOperation;
16168    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16169    ///
16170    /// let builder = prepare_request_builder();
16171    /// let response = builder.send().await?;
16172    /// # Ok(()) }
16173    ///
16174    /// fn prepare_request_builder() -> CancelOperation {
16175    ///   # panic!();
16176    ///   // ... details omitted ...
16177    /// }
16178    /// ```
16179    #[derive(Clone, Debug)]
16180    pub struct CancelOperation(
16181        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
16182    );
16183
16184    impl CancelOperation {
16185        pub(crate) fn new(
16186            stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
16187        ) -> Self {
16188            Self(RequestBuilder::new(stub))
16189        }
16190
16191        /// Sets the full request, replacing any prior values.
16192        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
16193            mut self,
16194            v: V,
16195        ) -> Self {
16196            self.0.request = v.into();
16197            self
16198        }
16199
16200        /// Sets all the options, replacing any prior values.
16201        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16202            self.0.options = v.into();
16203            self
16204        }
16205
16206        /// Sends the request.
16207        pub async fn send(self) -> Result<()> {
16208            (*self.0.stub)
16209                .cancel_operation(self.0.request, self.0.options)
16210                .await
16211                .map(crate::Response::into_body)
16212        }
16213
16214        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
16215        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16216            self.0.request.name = v.into();
16217            self
16218        }
16219    }
16220
16221    #[doc(hidden)]
16222    impl crate::RequestBuilder for CancelOperation {
16223        fn request_options(&mut self) -> &mut crate::RequestOptions {
16224            &mut self.0.options
16225        }
16226    }
16227}
16228
16229/// Request and client builders for [TestCases][crate::client::TestCases].
16230#[cfg(feature = "test-cases")]
16231#[cfg_attr(docsrs, doc(cfg(feature = "test-cases")))]
16232pub mod test_cases {
16233    use crate::Result;
16234
16235    /// A builder for [TestCases][crate::client::TestCases].
16236    ///
16237    /// ```
16238    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
16239    /// # use google_cloud_dialogflow_cx_v3::*;
16240    /// # use builder::test_cases::ClientBuilder;
16241    /// # use client::TestCases;
16242    /// let builder : ClientBuilder = TestCases::builder();
16243    /// let client = builder
16244    ///     .with_endpoint("https://dialogflow.googleapis.com")
16245    ///     .build().await?;
16246    /// # Ok(()) }
16247    /// ```
16248    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16249
16250    pub(crate) mod client {
16251        use super::super::super::client::TestCases;
16252        pub struct Factory;
16253        impl crate::ClientFactory for Factory {
16254            type Client = TestCases;
16255            type Credentials = gaxi::options::Credentials;
16256            async fn build(
16257                self,
16258                config: gaxi::options::ClientConfig,
16259            ) -> crate::ClientBuilderResult<Self::Client> {
16260                Self::Client::new(config).await
16261            }
16262        }
16263    }
16264
16265    /// Common implementation for [crate::client::TestCases] request builders.
16266    #[derive(Clone, Debug)]
16267    pub(crate) struct RequestBuilder<R: std::default::Default> {
16268        stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16269        request: R,
16270        options: crate::RequestOptions,
16271    }
16272
16273    impl<R> RequestBuilder<R>
16274    where
16275        R: std::default::Default,
16276    {
16277        pub(crate) fn new(
16278            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16279        ) -> Self {
16280            Self {
16281                stub,
16282                request: R::default(),
16283                options: crate::RequestOptions::default(),
16284            }
16285        }
16286    }
16287
16288    /// The request builder for [TestCases::list_test_cases][crate::client::TestCases::list_test_cases] calls.
16289    ///
16290    /// # Example
16291    /// ```
16292    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::ListTestCases;
16293    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16294    /// use google_cloud_gax::paginator::ItemPaginator;
16295    ///
16296    /// let builder = prepare_request_builder();
16297    /// let mut items = builder.by_item();
16298    /// while let Some(result) = items.next().await {
16299    ///   let item = result?;
16300    /// }
16301    /// # Ok(()) }
16302    ///
16303    /// fn prepare_request_builder() -> ListTestCases {
16304    ///   # panic!();
16305    ///   // ... details omitted ...
16306    /// }
16307    /// ```
16308    #[derive(Clone, Debug)]
16309    pub struct ListTestCases(RequestBuilder<crate::model::ListTestCasesRequest>);
16310
16311    impl ListTestCases {
16312        pub(crate) fn new(
16313            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16314        ) -> Self {
16315            Self(RequestBuilder::new(stub))
16316        }
16317
16318        /// Sets the full request, replacing any prior values.
16319        pub fn with_request<V: Into<crate::model::ListTestCasesRequest>>(mut self, v: V) -> Self {
16320            self.0.request = v.into();
16321            self
16322        }
16323
16324        /// Sets all the options, replacing any prior values.
16325        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16326            self.0.options = v.into();
16327            self
16328        }
16329
16330        /// Sends the request.
16331        pub async fn send(self) -> Result<crate::model::ListTestCasesResponse> {
16332            (*self.0.stub)
16333                .list_test_cases(self.0.request, self.0.options)
16334                .await
16335                .map(crate::Response::into_body)
16336        }
16337
16338        /// Streams each page in the collection.
16339        pub fn by_page(
16340            self,
16341        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTestCasesResponse, crate::Error>
16342        {
16343            use std::clone::Clone;
16344            let token = self.0.request.page_token.clone();
16345            let execute = move |token: String| {
16346                let mut builder = self.clone();
16347                builder.0.request = builder.0.request.set_page_token(token);
16348                builder.send()
16349            };
16350            google_cloud_gax::paginator::internal::new_paginator(token, execute)
16351        }
16352
16353        /// Streams each item in the collection.
16354        pub fn by_item(
16355            self,
16356        ) -> impl google_cloud_gax::paginator::ItemPaginator<
16357            crate::model::ListTestCasesResponse,
16358            crate::Error,
16359        > {
16360            use google_cloud_gax::paginator::Paginator;
16361            self.by_page().items()
16362        }
16363
16364        /// Sets the value of [parent][crate::model::ListTestCasesRequest::parent].
16365        ///
16366        /// This is a **required** field for requests.
16367        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16368            self.0.request.parent = v.into();
16369            self
16370        }
16371
16372        /// Sets the value of [page_size][crate::model::ListTestCasesRequest::page_size].
16373        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16374            self.0.request.page_size = v.into();
16375            self
16376        }
16377
16378        /// Sets the value of [page_token][crate::model::ListTestCasesRequest::page_token].
16379        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16380            self.0.request.page_token = v.into();
16381            self
16382        }
16383
16384        /// Sets the value of [view][crate::model::ListTestCasesRequest::view].
16385        pub fn set_view<T: Into<crate::model::list_test_cases_request::TestCaseView>>(
16386            mut self,
16387            v: T,
16388        ) -> Self {
16389            self.0.request.view = v.into();
16390            self
16391        }
16392    }
16393
16394    #[doc(hidden)]
16395    impl crate::RequestBuilder for ListTestCases {
16396        fn request_options(&mut self) -> &mut crate::RequestOptions {
16397            &mut self.0.options
16398        }
16399    }
16400
16401    /// The request builder for [TestCases::batch_delete_test_cases][crate::client::TestCases::batch_delete_test_cases] calls.
16402    ///
16403    /// # Example
16404    /// ```
16405    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::BatchDeleteTestCases;
16406    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16407    ///
16408    /// let builder = prepare_request_builder();
16409    /// let response = builder.send().await?;
16410    /// # Ok(()) }
16411    ///
16412    /// fn prepare_request_builder() -> BatchDeleteTestCases {
16413    ///   # panic!();
16414    ///   // ... details omitted ...
16415    /// }
16416    /// ```
16417    #[derive(Clone, Debug)]
16418    pub struct BatchDeleteTestCases(RequestBuilder<crate::model::BatchDeleteTestCasesRequest>);
16419
16420    impl BatchDeleteTestCases {
16421        pub(crate) fn new(
16422            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16423        ) -> Self {
16424            Self(RequestBuilder::new(stub))
16425        }
16426
16427        /// Sets the full request, replacing any prior values.
16428        pub fn with_request<V: Into<crate::model::BatchDeleteTestCasesRequest>>(
16429            mut self,
16430            v: V,
16431        ) -> Self {
16432            self.0.request = v.into();
16433            self
16434        }
16435
16436        /// Sets all the options, replacing any prior values.
16437        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16438            self.0.options = v.into();
16439            self
16440        }
16441
16442        /// Sends the request.
16443        pub async fn send(self) -> Result<()> {
16444            (*self.0.stub)
16445                .batch_delete_test_cases(self.0.request, self.0.options)
16446                .await
16447                .map(crate::Response::into_body)
16448        }
16449
16450        /// Sets the value of [parent][crate::model::BatchDeleteTestCasesRequest::parent].
16451        ///
16452        /// This is a **required** field for requests.
16453        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16454            self.0.request.parent = v.into();
16455            self
16456        }
16457
16458        /// Sets the value of [names][crate::model::BatchDeleteTestCasesRequest::names].
16459        ///
16460        /// This is a **required** field for requests.
16461        pub fn set_names<T, V>(mut self, v: T) -> Self
16462        where
16463            T: std::iter::IntoIterator<Item = V>,
16464            V: std::convert::Into<std::string::String>,
16465        {
16466            use std::iter::Iterator;
16467            self.0.request.names = v.into_iter().map(|i| i.into()).collect();
16468            self
16469        }
16470    }
16471
16472    #[doc(hidden)]
16473    impl crate::RequestBuilder for BatchDeleteTestCases {
16474        fn request_options(&mut self) -> &mut crate::RequestOptions {
16475            &mut self.0.options
16476        }
16477    }
16478
16479    /// The request builder for [TestCases::get_test_case][crate::client::TestCases::get_test_case] calls.
16480    ///
16481    /// # Example
16482    /// ```
16483    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::GetTestCase;
16484    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16485    ///
16486    /// let builder = prepare_request_builder();
16487    /// let response = builder.send().await?;
16488    /// # Ok(()) }
16489    ///
16490    /// fn prepare_request_builder() -> GetTestCase {
16491    ///   # panic!();
16492    ///   // ... details omitted ...
16493    /// }
16494    /// ```
16495    #[derive(Clone, Debug)]
16496    pub struct GetTestCase(RequestBuilder<crate::model::GetTestCaseRequest>);
16497
16498    impl GetTestCase {
16499        pub(crate) fn new(
16500            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16501        ) -> Self {
16502            Self(RequestBuilder::new(stub))
16503        }
16504
16505        /// Sets the full request, replacing any prior values.
16506        pub fn with_request<V: Into<crate::model::GetTestCaseRequest>>(mut self, v: V) -> Self {
16507            self.0.request = v.into();
16508            self
16509        }
16510
16511        /// Sets all the options, replacing any prior values.
16512        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16513            self.0.options = v.into();
16514            self
16515        }
16516
16517        /// Sends the request.
16518        pub async fn send(self) -> Result<crate::model::TestCase> {
16519            (*self.0.stub)
16520                .get_test_case(self.0.request, self.0.options)
16521                .await
16522                .map(crate::Response::into_body)
16523        }
16524
16525        /// Sets the value of [name][crate::model::GetTestCaseRequest::name].
16526        ///
16527        /// This is a **required** field for requests.
16528        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16529            self.0.request.name = v.into();
16530            self
16531        }
16532    }
16533
16534    #[doc(hidden)]
16535    impl crate::RequestBuilder for GetTestCase {
16536        fn request_options(&mut self) -> &mut crate::RequestOptions {
16537            &mut self.0.options
16538        }
16539    }
16540
16541    /// The request builder for [TestCases::create_test_case][crate::client::TestCases::create_test_case] calls.
16542    ///
16543    /// # Example
16544    /// ```
16545    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::CreateTestCase;
16546    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16547    ///
16548    /// let builder = prepare_request_builder();
16549    /// let response = builder.send().await?;
16550    /// # Ok(()) }
16551    ///
16552    /// fn prepare_request_builder() -> CreateTestCase {
16553    ///   # panic!();
16554    ///   // ... details omitted ...
16555    /// }
16556    /// ```
16557    #[derive(Clone, Debug)]
16558    pub struct CreateTestCase(RequestBuilder<crate::model::CreateTestCaseRequest>);
16559
16560    impl CreateTestCase {
16561        pub(crate) fn new(
16562            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16563        ) -> Self {
16564            Self(RequestBuilder::new(stub))
16565        }
16566
16567        /// Sets the full request, replacing any prior values.
16568        pub fn with_request<V: Into<crate::model::CreateTestCaseRequest>>(mut self, v: V) -> Self {
16569            self.0.request = v.into();
16570            self
16571        }
16572
16573        /// Sets all the options, replacing any prior values.
16574        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16575            self.0.options = v.into();
16576            self
16577        }
16578
16579        /// Sends the request.
16580        pub async fn send(self) -> Result<crate::model::TestCase> {
16581            (*self.0.stub)
16582                .create_test_case(self.0.request, self.0.options)
16583                .await
16584                .map(crate::Response::into_body)
16585        }
16586
16587        /// Sets the value of [parent][crate::model::CreateTestCaseRequest::parent].
16588        ///
16589        /// This is a **required** field for requests.
16590        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16591            self.0.request.parent = v.into();
16592            self
16593        }
16594
16595        /// Sets the value of [test_case][crate::model::CreateTestCaseRequest::test_case].
16596        ///
16597        /// This is a **required** field for requests.
16598        pub fn set_test_case<T>(mut self, v: T) -> Self
16599        where
16600            T: std::convert::Into<crate::model::TestCase>,
16601        {
16602            self.0.request.test_case = std::option::Option::Some(v.into());
16603            self
16604        }
16605
16606        /// Sets or clears the value of [test_case][crate::model::CreateTestCaseRequest::test_case].
16607        ///
16608        /// This is a **required** field for requests.
16609        pub fn set_or_clear_test_case<T>(mut self, v: std::option::Option<T>) -> Self
16610        where
16611            T: std::convert::Into<crate::model::TestCase>,
16612        {
16613            self.0.request.test_case = v.map(|x| x.into());
16614            self
16615        }
16616    }
16617
16618    #[doc(hidden)]
16619    impl crate::RequestBuilder for CreateTestCase {
16620        fn request_options(&mut self) -> &mut crate::RequestOptions {
16621            &mut self.0.options
16622        }
16623    }
16624
16625    /// The request builder for [TestCases::update_test_case][crate::client::TestCases::update_test_case] calls.
16626    ///
16627    /// # Example
16628    /// ```
16629    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::UpdateTestCase;
16630    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16631    ///
16632    /// let builder = prepare_request_builder();
16633    /// let response = builder.send().await?;
16634    /// # Ok(()) }
16635    ///
16636    /// fn prepare_request_builder() -> UpdateTestCase {
16637    ///   # panic!();
16638    ///   // ... details omitted ...
16639    /// }
16640    /// ```
16641    #[derive(Clone, Debug)]
16642    pub struct UpdateTestCase(RequestBuilder<crate::model::UpdateTestCaseRequest>);
16643
16644    impl UpdateTestCase {
16645        pub(crate) fn new(
16646            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16647        ) -> Self {
16648            Self(RequestBuilder::new(stub))
16649        }
16650
16651        /// Sets the full request, replacing any prior values.
16652        pub fn with_request<V: Into<crate::model::UpdateTestCaseRequest>>(mut self, v: V) -> Self {
16653            self.0.request = v.into();
16654            self
16655        }
16656
16657        /// Sets all the options, replacing any prior values.
16658        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16659            self.0.options = v.into();
16660            self
16661        }
16662
16663        /// Sends the request.
16664        pub async fn send(self) -> Result<crate::model::TestCase> {
16665            (*self.0.stub)
16666                .update_test_case(self.0.request, self.0.options)
16667                .await
16668                .map(crate::Response::into_body)
16669        }
16670
16671        /// Sets the value of [test_case][crate::model::UpdateTestCaseRequest::test_case].
16672        ///
16673        /// This is a **required** field for requests.
16674        pub fn set_test_case<T>(mut self, v: T) -> Self
16675        where
16676            T: std::convert::Into<crate::model::TestCase>,
16677        {
16678            self.0.request.test_case = std::option::Option::Some(v.into());
16679            self
16680        }
16681
16682        /// Sets or clears the value of [test_case][crate::model::UpdateTestCaseRequest::test_case].
16683        ///
16684        /// This is a **required** field for requests.
16685        pub fn set_or_clear_test_case<T>(mut self, v: std::option::Option<T>) -> Self
16686        where
16687            T: std::convert::Into<crate::model::TestCase>,
16688        {
16689            self.0.request.test_case = v.map(|x| x.into());
16690            self
16691        }
16692
16693        /// Sets the value of [update_mask][crate::model::UpdateTestCaseRequest::update_mask].
16694        ///
16695        /// This is a **required** field for requests.
16696        pub fn set_update_mask<T>(mut self, v: T) -> Self
16697        where
16698            T: std::convert::Into<wkt::FieldMask>,
16699        {
16700            self.0.request.update_mask = std::option::Option::Some(v.into());
16701            self
16702        }
16703
16704        /// Sets or clears the value of [update_mask][crate::model::UpdateTestCaseRequest::update_mask].
16705        ///
16706        /// This is a **required** field for requests.
16707        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16708        where
16709            T: std::convert::Into<wkt::FieldMask>,
16710        {
16711            self.0.request.update_mask = v.map(|x| x.into());
16712            self
16713        }
16714    }
16715
16716    #[doc(hidden)]
16717    impl crate::RequestBuilder for UpdateTestCase {
16718        fn request_options(&mut self) -> &mut crate::RequestOptions {
16719            &mut self.0.options
16720        }
16721    }
16722
16723    /// The request builder for [TestCases::run_test_case][crate::client::TestCases::run_test_case] calls.
16724    ///
16725    /// # Example
16726    /// ```
16727    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::RunTestCase;
16728    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16729    /// use google_cloud_lro::Poller;
16730    ///
16731    /// let builder = prepare_request_builder();
16732    /// let response = builder.poller().until_done().await?;
16733    /// # Ok(()) }
16734    ///
16735    /// fn prepare_request_builder() -> RunTestCase {
16736    ///   # panic!();
16737    ///   // ... details omitted ...
16738    /// }
16739    /// ```
16740    #[derive(Clone, Debug)]
16741    pub struct RunTestCase(RequestBuilder<crate::model::RunTestCaseRequest>);
16742
16743    impl RunTestCase {
16744        pub(crate) fn new(
16745            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16746        ) -> Self {
16747            Self(RequestBuilder::new(stub))
16748        }
16749
16750        /// Sets the full request, replacing any prior values.
16751        pub fn with_request<V: Into<crate::model::RunTestCaseRequest>>(mut self, v: V) -> Self {
16752            self.0.request = v.into();
16753            self
16754        }
16755
16756        /// Sets all the options, replacing any prior values.
16757        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16758            self.0.options = v.into();
16759            self
16760        }
16761
16762        /// Sends the request.
16763        ///
16764        /// # Long running operations
16765        ///
16766        /// This starts, but does not poll, a longrunning operation. More information
16767        /// on [run_test_case][crate::client::TestCases::run_test_case].
16768        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16769            (*self.0.stub)
16770                .run_test_case(self.0.request, self.0.options)
16771                .await
16772                .map(crate::Response::into_body)
16773        }
16774
16775        /// Creates a [Poller][google_cloud_lro::Poller] to work with `run_test_case`.
16776        pub fn poller(
16777            self,
16778        ) -> impl google_cloud_lro::Poller<
16779            crate::model::RunTestCaseResponse,
16780            crate::model::RunTestCaseMetadata,
16781        > {
16782            type Operation = google_cloud_lro::internal::Operation<
16783                crate::model::RunTestCaseResponse,
16784                crate::model::RunTestCaseMetadata,
16785            >;
16786            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16787            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16788
16789            let stub = self.0.stub.clone();
16790            let mut options = self.0.options.clone();
16791            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16792            let query = move |name| {
16793                let stub = stub.clone();
16794                let options = options.clone();
16795                async {
16796                    let op = GetOperation::new(stub)
16797                        .set_name(name)
16798                        .with_options(options)
16799                        .send()
16800                        .await?;
16801                    Ok(Operation::new(op))
16802                }
16803            };
16804
16805            let start = move || async {
16806                let op = self.send().await?;
16807                Ok(Operation::new(op))
16808            };
16809
16810            google_cloud_lro::internal::new_poller(
16811                polling_error_policy,
16812                polling_backoff_policy,
16813                start,
16814                query,
16815            )
16816        }
16817
16818        /// Sets the value of [name][crate::model::RunTestCaseRequest::name].
16819        ///
16820        /// This is a **required** field for requests.
16821        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16822            self.0.request.name = v.into();
16823            self
16824        }
16825
16826        /// Sets the value of [environment][crate::model::RunTestCaseRequest::environment].
16827        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
16828            self.0.request.environment = v.into();
16829            self
16830        }
16831    }
16832
16833    #[doc(hidden)]
16834    impl crate::RequestBuilder for RunTestCase {
16835        fn request_options(&mut self) -> &mut crate::RequestOptions {
16836            &mut self.0.options
16837        }
16838    }
16839
16840    /// The request builder for [TestCases::batch_run_test_cases][crate::client::TestCases::batch_run_test_cases] calls.
16841    ///
16842    /// # Example
16843    /// ```
16844    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::BatchRunTestCases;
16845    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16846    /// use google_cloud_lro::Poller;
16847    ///
16848    /// let builder = prepare_request_builder();
16849    /// let response = builder.poller().until_done().await?;
16850    /// # Ok(()) }
16851    ///
16852    /// fn prepare_request_builder() -> BatchRunTestCases {
16853    ///   # panic!();
16854    ///   // ... details omitted ...
16855    /// }
16856    /// ```
16857    #[derive(Clone, Debug)]
16858    pub struct BatchRunTestCases(RequestBuilder<crate::model::BatchRunTestCasesRequest>);
16859
16860    impl BatchRunTestCases {
16861        pub(crate) fn new(
16862            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16863        ) -> Self {
16864            Self(RequestBuilder::new(stub))
16865        }
16866
16867        /// Sets the full request, replacing any prior values.
16868        pub fn with_request<V: Into<crate::model::BatchRunTestCasesRequest>>(
16869            mut self,
16870            v: V,
16871        ) -> Self {
16872            self.0.request = v.into();
16873            self
16874        }
16875
16876        /// Sets all the options, replacing any prior values.
16877        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16878            self.0.options = v.into();
16879            self
16880        }
16881
16882        /// Sends the request.
16883        ///
16884        /// # Long running operations
16885        ///
16886        /// This starts, but does not poll, a longrunning operation. More information
16887        /// on [batch_run_test_cases][crate::client::TestCases::batch_run_test_cases].
16888        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16889            (*self.0.stub)
16890                .batch_run_test_cases(self.0.request, self.0.options)
16891                .await
16892                .map(crate::Response::into_body)
16893        }
16894
16895        /// Creates a [Poller][google_cloud_lro::Poller] to work with `batch_run_test_cases`.
16896        pub fn poller(
16897            self,
16898        ) -> impl google_cloud_lro::Poller<
16899            crate::model::BatchRunTestCasesResponse,
16900            crate::model::BatchRunTestCasesMetadata,
16901        > {
16902            type Operation = google_cloud_lro::internal::Operation<
16903                crate::model::BatchRunTestCasesResponse,
16904                crate::model::BatchRunTestCasesMetadata,
16905            >;
16906            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16907            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16908
16909            let stub = self.0.stub.clone();
16910            let mut options = self.0.options.clone();
16911            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16912            let query = move |name| {
16913                let stub = stub.clone();
16914                let options = options.clone();
16915                async {
16916                    let op = GetOperation::new(stub)
16917                        .set_name(name)
16918                        .with_options(options)
16919                        .send()
16920                        .await?;
16921                    Ok(Operation::new(op))
16922                }
16923            };
16924
16925            let start = move || async {
16926                let op = self.send().await?;
16927                Ok(Operation::new(op))
16928            };
16929
16930            google_cloud_lro::internal::new_poller(
16931                polling_error_policy,
16932                polling_backoff_policy,
16933                start,
16934                query,
16935            )
16936        }
16937
16938        /// Sets the value of [parent][crate::model::BatchRunTestCasesRequest::parent].
16939        ///
16940        /// This is a **required** field for requests.
16941        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16942            self.0.request.parent = v.into();
16943            self
16944        }
16945
16946        /// Sets the value of [environment][crate::model::BatchRunTestCasesRequest::environment].
16947        pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
16948            self.0.request.environment = v.into();
16949            self
16950        }
16951
16952        /// Sets the value of [test_cases][crate::model::BatchRunTestCasesRequest::test_cases].
16953        ///
16954        /// This is a **required** field for requests.
16955        pub fn set_test_cases<T, V>(mut self, v: T) -> Self
16956        where
16957            T: std::iter::IntoIterator<Item = V>,
16958            V: std::convert::Into<std::string::String>,
16959        {
16960            use std::iter::Iterator;
16961            self.0.request.test_cases = v.into_iter().map(|i| i.into()).collect();
16962            self
16963        }
16964    }
16965
16966    #[doc(hidden)]
16967    impl crate::RequestBuilder for BatchRunTestCases {
16968        fn request_options(&mut self) -> &mut crate::RequestOptions {
16969            &mut self.0.options
16970        }
16971    }
16972
16973    /// The request builder for [TestCases::calculate_coverage][crate::client::TestCases::calculate_coverage] calls.
16974    ///
16975    /// # Example
16976    /// ```
16977    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::CalculateCoverage;
16978    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
16979    ///
16980    /// let builder = prepare_request_builder();
16981    /// let response = builder.send().await?;
16982    /// # Ok(()) }
16983    ///
16984    /// fn prepare_request_builder() -> CalculateCoverage {
16985    ///   # panic!();
16986    ///   // ... details omitted ...
16987    /// }
16988    /// ```
16989    #[derive(Clone, Debug)]
16990    pub struct CalculateCoverage(RequestBuilder<crate::model::CalculateCoverageRequest>);
16991
16992    impl CalculateCoverage {
16993        pub(crate) fn new(
16994            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16995        ) -> Self {
16996            Self(RequestBuilder::new(stub))
16997        }
16998
16999        /// Sets the full request, replacing any prior values.
17000        pub fn with_request<V: Into<crate::model::CalculateCoverageRequest>>(
17001            mut self,
17002            v: V,
17003        ) -> Self {
17004            self.0.request = v.into();
17005            self
17006        }
17007
17008        /// Sets all the options, replacing any prior values.
17009        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17010            self.0.options = v.into();
17011            self
17012        }
17013
17014        /// Sends the request.
17015        pub async fn send(self) -> Result<crate::model::CalculateCoverageResponse> {
17016            (*self.0.stub)
17017                .calculate_coverage(self.0.request, self.0.options)
17018                .await
17019                .map(crate::Response::into_body)
17020        }
17021
17022        /// Sets the value of [agent][crate::model::CalculateCoverageRequest::agent].
17023        ///
17024        /// This is a **required** field for requests.
17025        pub fn set_agent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17026            self.0.request.agent = v.into();
17027            self
17028        }
17029
17030        /// Sets the value of [r#type][crate::model::CalculateCoverageRequest::type].
17031        ///
17032        /// This is a **required** field for requests.
17033        pub fn set_type<T: Into<crate::model::calculate_coverage_request::CoverageType>>(
17034            mut self,
17035            v: T,
17036        ) -> Self {
17037            self.0.request.r#type = v.into();
17038            self
17039        }
17040    }
17041
17042    #[doc(hidden)]
17043    impl crate::RequestBuilder for CalculateCoverage {
17044        fn request_options(&mut self) -> &mut crate::RequestOptions {
17045            &mut self.0.options
17046        }
17047    }
17048
17049    /// The request builder for [TestCases::import_test_cases][crate::client::TestCases::import_test_cases] calls.
17050    ///
17051    /// # Example
17052    /// ```
17053    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::ImportTestCases;
17054    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17055    /// use google_cloud_lro::Poller;
17056    ///
17057    /// let builder = prepare_request_builder();
17058    /// let response = builder.poller().until_done().await?;
17059    /// # Ok(()) }
17060    ///
17061    /// fn prepare_request_builder() -> ImportTestCases {
17062    ///   # panic!();
17063    ///   // ... details omitted ...
17064    /// }
17065    /// ```
17066    #[derive(Clone, Debug)]
17067    pub struct ImportTestCases(RequestBuilder<crate::model::ImportTestCasesRequest>);
17068
17069    impl ImportTestCases {
17070        pub(crate) fn new(
17071            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17072        ) -> Self {
17073            Self(RequestBuilder::new(stub))
17074        }
17075
17076        /// Sets the full request, replacing any prior values.
17077        pub fn with_request<V: Into<crate::model::ImportTestCasesRequest>>(mut self, v: V) -> Self {
17078            self.0.request = v.into();
17079            self
17080        }
17081
17082        /// Sets all the options, replacing any prior values.
17083        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17084            self.0.options = v.into();
17085            self
17086        }
17087
17088        /// Sends the request.
17089        ///
17090        /// # Long running operations
17091        ///
17092        /// This starts, but does not poll, a longrunning operation. More information
17093        /// on [import_test_cases][crate::client::TestCases::import_test_cases].
17094        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17095            (*self.0.stub)
17096                .import_test_cases(self.0.request, self.0.options)
17097                .await
17098                .map(crate::Response::into_body)
17099        }
17100
17101        /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_test_cases`.
17102        pub fn poller(
17103            self,
17104        ) -> impl google_cloud_lro::Poller<
17105            crate::model::ImportTestCasesResponse,
17106            crate::model::ImportTestCasesMetadata,
17107        > {
17108            type Operation = google_cloud_lro::internal::Operation<
17109                crate::model::ImportTestCasesResponse,
17110                crate::model::ImportTestCasesMetadata,
17111            >;
17112            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17113            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17114
17115            let stub = self.0.stub.clone();
17116            let mut options = self.0.options.clone();
17117            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17118            let query = move |name| {
17119                let stub = stub.clone();
17120                let options = options.clone();
17121                async {
17122                    let op = GetOperation::new(stub)
17123                        .set_name(name)
17124                        .with_options(options)
17125                        .send()
17126                        .await?;
17127                    Ok(Operation::new(op))
17128                }
17129            };
17130
17131            let start = move || async {
17132                let op = self.send().await?;
17133                Ok(Operation::new(op))
17134            };
17135
17136            google_cloud_lro::internal::new_poller(
17137                polling_error_policy,
17138                polling_backoff_policy,
17139                start,
17140                query,
17141            )
17142        }
17143
17144        /// Sets the value of [parent][crate::model::ImportTestCasesRequest::parent].
17145        ///
17146        /// This is a **required** field for requests.
17147        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17148            self.0.request.parent = v.into();
17149            self
17150        }
17151
17152        /// Sets the value of [source][crate::model::ImportTestCasesRequest::source].
17153        ///
17154        /// Note that all the setters affecting `source` are
17155        /// mutually exclusive.
17156        pub fn set_source<T: Into<Option<crate::model::import_test_cases_request::Source>>>(
17157            mut self,
17158            v: T,
17159        ) -> Self {
17160            self.0.request.source = v.into();
17161            self
17162        }
17163
17164        /// Sets the value of [source][crate::model::ImportTestCasesRequest::source]
17165        /// to hold a `GcsUri`.
17166        ///
17167        /// Note that all the setters affecting `source` are
17168        /// mutually exclusive.
17169        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17170            self.0.request = self.0.request.set_gcs_uri(v);
17171            self
17172        }
17173
17174        /// Sets the value of [source][crate::model::ImportTestCasesRequest::source]
17175        /// to hold a `Content`.
17176        ///
17177        /// Note that all the setters affecting `source` are
17178        /// mutually exclusive.
17179        pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
17180            self.0.request = self.0.request.set_content(v);
17181            self
17182        }
17183    }
17184
17185    #[doc(hidden)]
17186    impl crate::RequestBuilder for ImportTestCases {
17187        fn request_options(&mut self) -> &mut crate::RequestOptions {
17188            &mut self.0.options
17189        }
17190    }
17191
17192    /// The request builder for [TestCases::export_test_cases][crate::client::TestCases::export_test_cases] calls.
17193    ///
17194    /// # Example
17195    /// ```
17196    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::ExportTestCases;
17197    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17198    /// use google_cloud_lro::Poller;
17199    ///
17200    /// let builder = prepare_request_builder();
17201    /// let response = builder.poller().until_done().await?;
17202    /// # Ok(()) }
17203    ///
17204    /// fn prepare_request_builder() -> ExportTestCases {
17205    ///   # panic!();
17206    ///   // ... details omitted ...
17207    /// }
17208    /// ```
17209    #[derive(Clone, Debug)]
17210    pub struct ExportTestCases(RequestBuilder<crate::model::ExportTestCasesRequest>);
17211
17212    impl ExportTestCases {
17213        pub(crate) fn new(
17214            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17215        ) -> Self {
17216            Self(RequestBuilder::new(stub))
17217        }
17218
17219        /// Sets the full request, replacing any prior values.
17220        pub fn with_request<V: Into<crate::model::ExportTestCasesRequest>>(mut self, v: V) -> Self {
17221            self.0.request = v.into();
17222            self
17223        }
17224
17225        /// Sets all the options, replacing any prior values.
17226        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17227            self.0.options = v.into();
17228            self
17229        }
17230
17231        /// Sends the request.
17232        ///
17233        /// # Long running operations
17234        ///
17235        /// This starts, but does not poll, a longrunning operation. More information
17236        /// on [export_test_cases][crate::client::TestCases::export_test_cases].
17237        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17238            (*self.0.stub)
17239                .export_test_cases(self.0.request, self.0.options)
17240                .await
17241                .map(crate::Response::into_body)
17242        }
17243
17244        /// Creates a [Poller][google_cloud_lro::Poller] to work with `export_test_cases`.
17245        pub fn poller(
17246            self,
17247        ) -> impl google_cloud_lro::Poller<
17248            crate::model::ExportTestCasesResponse,
17249            crate::model::ExportTestCasesMetadata,
17250        > {
17251            type Operation = google_cloud_lro::internal::Operation<
17252                crate::model::ExportTestCasesResponse,
17253                crate::model::ExportTestCasesMetadata,
17254            >;
17255            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17256            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17257
17258            let stub = self.0.stub.clone();
17259            let mut options = self.0.options.clone();
17260            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17261            let query = move |name| {
17262                let stub = stub.clone();
17263                let options = options.clone();
17264                async {
17265                    let op = GetOperation::new(stub)
17266                        .set_name(name)
17267                        .with_options(options)
17268                        .send()
17269                        .await?;
17270                    Ok(Operation::new(op))
17271                }
17272            };
17273
17274            let start = move || async {
17275                let op = self.send().await?;
17276                Ok(Operation::new(op))
17277            };
17278
17279            google_cloud_lro::internal::new_poller(
17280                polling_error_policy,
17281                polling_backoff_policy,
17282                start,
17283                query,
17284            )
17285        }
17286
17287        /// Sets the value of [parent][crate::model::ExportTestCasesRequest::parent].
17288        ///
17289        /// This is a **required** field for requests.
17290        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17291            self.0.request.parent = v.into();
17292            self
17293        }
17294
17295        /// Sets the value of [data_format][crate::model::ExportTestCasesRequest::data_format].
17296        pub fn set_data_format<T: Into<crate::model::export_test_cases_request::DataFormat>>(
17297            mut self,
17298            v: T,
17299        ) -> Self {
17300            self.0.request.data_format = v.into();
17301            self
17302        }
17303
17304        /// Sets the value of [filter][crate::model::ExportTestCasesRequest::filter].
17305        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17306            self.0.request.filter = v.into();
17307            self
17308        }
17309
17310        /// Sets the value of [destination][crate::model::ExportTestCasesRequest::destination].
17311        ///
17312        /// Note that all the setters affecting `destination` are
17313        /// mutually exclusive.
17314        pub fn set_destination<
17315            T: Into<Option<crate::model::export_test_cases_request::Destination>>,
17316        >(
17317            mut self,
17318            v: T,
17319        ) -> Self {
17320            self.0.request.destination = v.into();
17321            self
17322        }
17323
17324        /// Sets the value of [destination][crate::model::ExportTestCasesRequest::destination]
17325        /// to hold a `GcsUri`.
17326        ///
17327        /// Note that all the setters affecting `destination` are
17328        /// mutually exclusive.
17329        pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17330            self.0.request = self.0.request.set_gcs_uri(v);
17331            self
17332        }
17333    }
17334
17335    #[doc(hidden)]
17336    impl crate::RequestBuilder for ExportTestCases {
17337        fn request_options(&mut self) -> &mut crate::RequestOptions {
17338            &mut self.0.options
17339        }
17340    }
17341
17342    /// The request builder for [TestCases::list_test_case_results][crate::client::TestCases::list_test_case_results] calls.
17343    ///
17344    /// # Example
17345    /// ```
17346    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::ListTestCaseResults;
17347    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17348    /// use google_cloud_gax::paginator::ItemPaginator;
17349    ///
17350    /// let builder = prepare_request_builder();
17351    /// let mut items = builder.by_item();
17352    /// while let Some(result) = items.next().await {
17353    ///   let item = result?;
17354    /// }
17355    /// # Ok(()) }
17356    ///
17357    /// fn prepare_request_builder() -> ListTestCaseResults {
17358    ///   # panic!();
17359    ///   // ... details omitted ...
17360    /// }
17361    /// ```
17362    #[derive(Clone, Debug)]
17363    pub struct ListTestCaseResults(RequestBuilder<crate::model::ListTestCaseResultsRequest>);
17364
17365    impl ListTestCaseResults {
17366        pub(crate) fn new(
17367            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17368        ) -> Self {
17369            Self(RequestBuilder::new(stub))
17370        }
17371
17372        /// Sets the full request, replacing any prior values.
17373        pub fn with_request<V: Into<crate::model::ListTestCaseResultsRequest>>(
17374            mut self,
17375            v: V,
17376        ) -> Self {
17377            self.0.request = v.into();
17378            self
17379        }
17380
17381        /// Sets all the options, replacing any prior values.
17382        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17383            self.0.options = v.into();
17384            self
17385        }
17386
17387        /// Sends the request.
17388        pub async fn send(self) -> Result<crate::model::ListTestCaseResultsResponse> {
17389            (*self.0.stub)
17390                .list_test_case_results(self.0.request, self.0.options)
17391                .await
17392                .map(crate::Response::into_body)
17393        }
17394
17395        /// Streams each page in the collection.
17396        pub fn by_page(
17397            self,
17398        ) -> impl google_cloud_gax::paginator::Paginator<
17399            crate::model::ListTestCaseResultsResponse,
17400            crate::Error,
17401        > {
17402            use std::clone::Clone;
17403            let token = self.0.request.page_token.clone();
17404            let execute = move |token: String| {
17405                let mut builder = self.clone();
17406                builder.0.request = builder.0.request.set_page_token(token);
17407                builder.send()
17408            };
17409            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17410        }
17411
17412        /// Streams each item in the collection.
17413        pub fn by_item(
17414            self,
17415        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17416            crate::model::ListTestCaseResultsResponse,
17417            crate::Error,
17418        > {
17419            use google_cloud_gax::paginator::Paginator;
17420            self.by_page().items()
17421        }
17422
17423        /// Sets the value of [parent][crate::model::ListTestCaseResultsRequest::parent].
17424        ///
17425        /// This is a **required** field for requests.
17426        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17427            self.0.request.parent = v.into();
17428            self
17429        }
17430
17431        /// Sets the value of [page_size][crate::model::ListTestCaseResultsRequest::page_size].
17432        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17433            self.0.request.page_size = v.into();
17434            self
17435        }
17436
17437        /// Sets the value of [page_token][crate::model::ListTestCaseResultsRequest::page_token].
17438        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17439            self.0.request.page_token = v.into();
17440            self
17441        }
17442
17443        /// Sets the value of [filter][crate::model::ListTestCaseResultsRequest::filter].
17444        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17445            self.0.request.filter = v.into();
17446            self
17447        }
17448    }
17449
17450    #[doc(hidden)]
17451    impl crate::RequestBuilder for ListTestCaseResults {
17452        fn request_options(&mut self) -> &mut crate::RequestOptions {
17453            &mut self.0.options
17454        }
17455    }
17456
17457    /// The request builder for [TestCases::get_test_case_result][crate::client::TestCases::get_test_case_result] calls.
17458    ///
17459    /// # Example
17460    /// ```
17461    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::GetTestCaseResult;
17462    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17463    ///
17464    /// let builder = prepare_request_builder();
17465    /// let response = builder.send().await?;
17466    /// # Ok(()) }
17467    ///
17468    /// fn prepare_request_builder() -> GetTestCaseResult {
17469    ///   # panic!();
17470    ///   // ... details omitted ...
17471    /// }
17472    /// ```
17473    #[derive(Clone, Debug)]
17474    pub struct GetTestCaseResult(RequestBuilder<crate::model::GetTestCaseResultRequest>);
17475
17476    impl GetTestCaseResult {
17477        pub(crate) fn new(
17478            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17479        ) -> Self {
17480            Self(RequestBuilder::new(stub))
17481        }
17482
17483        /// Sets the full request, replacing any prior values.
17484        pub fn with_request<V: Into<crate::model::GetTestCaseResultRequest>>(
17485            mut self,
17486            v: V,
17487        ) -> Self {
17488            self.0.request = v.into();
17489            self
17490        }
17491
17492        /// Sets all the options, replacing any prior values.
17493        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17494            self.0.options = v.into();
17495            self
17496        }
17497
17498        /// Sends the request.
17499        pub async fn send(self) -> Result<crate::model::TestCaseResult> {
17500            (*self.0.stub)
17501                .get_test_case_result(self.0.request, self.0.options)
17502                .await
17503                .map(crate::Response::into_body)
17504        }
17505
17506        /// Sets the value of [name][crate::model::GetTestCaseResultRequest::name].
17507        ///
17508        /// This is a **required** field for requests.
17509        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17510            self.0.request.name = v.into();
17511            self
17512        }
17513    }
17514
17515    #[doc(hidden)]
17516    impl crate::RequestBuilder for GetTestCaseResult {
17517        fn request_options(&mut self) -> &mut crate::RequestOptions {
17518            &mut self.0.options
17519        }
17520    }
17521
17522    /// The request builder for [TestCases::list_locations][crate::client::TestCases::list_locations] calls.
17523    ///
17524    /// # Example
17525    /// ```
17526    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::ListLocations;
17527    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17528    /// use google_cloud_gax::paginator::ItemPaginator;
17529    ///
17530    /// let builder = prepare_request_builder();
17531    /// let mut items = builder.by_item();
17532    /// while let Some(result) = items.next().await {
17533    ///   let item = result?;
17534    /// }
17535    /// # Ok(()) }
17536    ///
17537    /// fn prepare_request_builder() -> ListLocations {
17538    ///   # panic!();
17539    ///   // ... details omitted ...
17540    /// }
17541    /// ```
17542    #[derive(Clone, Debug)]
17543    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
17544
17545    impl ListLocations {
17546        pub(crate) fn new(
17547            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17548        ) -> Self {
17549            Self(RequestBuilder::new(stub))
17550        }
17551
17552        /// Sets the full request, replacing any prior values.
17553        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
17554            mut self,
17555            v: V,
17556        ) -> Self {
17557            self.0.request = v.into();
17558            self
17559        }
17560
17561        /// Sets all the options, replacing any prior values.
17562        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17563            self.0.options = v.into();
17564            self
17565        }
17566
17567        /// Sends the request.
17568        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
17569            (*self.0.stub)
17570                .list_locations(self.0.request, self.0.options)
17571                .await
17572                .map(crate::Response::into_body)
17573        }
17574
17575        /// Streams each page in the collection.
17576        pub fn by_page(
17577            self,
17578        ) -> impl google_cloud_gax::paginator::Paginator<
17579            google_cloud_location::model::ListLocationsResponse,
17580            crate::Error,
17581        > {
17582            use std::clone::Clone;
17583            let token = self.0.request.page_token.clone();
17584            let execute = move |token: String| {
17585                let mut builder = self.clone();
17586                builder.0.request = builder.0.request.set_page_token(token);
17587                builder.send()
17588            };
17589            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17590        }
17591
17592        /// Streams each item in the collection.
17593        pub fn by_item(
17594            self,
17595        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17596            google_cloud_location::model::ListLocationsResponse,
17597            crate::Error,
17598        > {
17599            use google_cloud_gax::paginator::Paginator;
17600            self.by_page().items()
17601        }
17602
17603        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
17604        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17605            self.0.request.name = v.into();
17606            self
17607        }
17608
17609        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
17610        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17611            self.0.request.filter = v.into();
17612            self
17613        }
17614
17615        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
17616        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17617            self.0.request.page_size = v.into();
17618            self
17619        }
17620
17621        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
17622        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17623            self.0.request.page_token = v.into();
17624            self
17625        }
17626    }
17627
17628    #[doc(hidden)]
17629    impl crate::RequestBuilder for ListLocations {
17630        fn request_options(&mut self) -> &mut crate::RequestOptions {
17631            &mut self.0.options
17632        }
17633    }
17634
17635    /// The request builder for [TestCases::get_location][crate::client::TestCases::get_location] calls.
17636    ///
17637    /// # Example
17638    /// ```
17639    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::GetLocation;
17640    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17641    ///
17642    /// let builder = prepare_request_builder();
17643    /// let response = builder.send().await?;
17644    /// # Ok(()) }
17645    ///
17646    /// fn prepare_request_builder() -> GetLocation {
17647    ///   # panic!();
17648    ///   // ... details omitted ...
17649    /// }
17650    /// ```
17651    #[derive(Clone, Debug)]
17652    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
17653
17654    impl GetLocation {
17655        pub(crate) fn new(
17656            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17657        ) -> Self {
17658            Self(RequestBuilder::new(stub))
17659        }
17660
17661        /// Sets the full request, replacing any prior values.
17662        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
17663            mut self,
17664            v: V,
17665        ) -> Self {
17666            self.0.request = v.into();
17667            self
17668        }
17669
17670        /// Sets all the options, replacing any prior values.
17671        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17672            self.0.options = v.into();
17673            self
17674        }
17675
17676        /// Sends the request.
17677        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
17678            (*self.0.stub)
17679                .get_location(self.0.request, self.0.options)
17680                .await
17681                .map(crate::Response::into_body)
17682        }
17683
17684        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
17685        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17686            self.0.request.name = v.into();
17687            self
17688        }
17689    }
17690
17691    #[doc(hidden)]
17692    impl crate::RequestBuilder for GetLocation {
17693        fn request_options(&mut self) -> &mut crate::RequestOptions {
17694            &mut self.0.options
17695        }
17696    }
17697
17698    /// The request builder for [TestCases::list_operations][crate::client::TestCases::list_operations] calls.
17699    ///
17700    /// # Example
17701    /// ```
17702    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::ListOperations;
17703    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17704    /// use google_cloud_gax::paginator::ItemPaginator;
17705    ///
17706    /// let builder = prepare_request_builder();
17707    /// let mut items = builder.by_item();
17708    /// while let Some(result) = items.next().await {
17709    ///   let item = result?;
17710    /// }
17711    /// # Ok(()) }
17712    ///
17713    /// fn prepare_request_builder() -> ListOperations {
17714    ///   # panic!();
17715    ///   // ... details omitted ...
17716    /// }
17717    /// ```
17718    #[derive(Clone, Debug)]
17719    pub struct ListOperations(
17720        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17721    );
17722
17723    impl ListOperations {
17724        pub(crate) fn new(
17725            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17726        ) -> Self {
17727            Self(RequestBuilder::new(stub))
17728        }
17729
17730        /// Sets the full request, replacing any prior values.
17731        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17732            mut self,
17733            v: V,
17734        ) -> Self {
17735            self.0.request = v.into();
17736            self
17737        }
17738
17739        /// Sets all the options, replacing any prior values.
17740        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17741            self.0.options = v.into();
17742            self
17743        }
17744
17745        /// Sends the request.
17746        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17747            (*self.0.stub)
17748                .list_operations(self.0.request, self.0.options)
17749                .await
17750                .map(crate::Response::into_body)
17751        }
17752
17753        /// Streams each page in the collection.
17754        pub fn by_page(
17755            self,
17756        ) -> impl google_cloud_gax::paginator::Paginator<
17757            google_cloud_longrunning::model::ListOperationsResponse,
17758            crate::Error,
17759        > {
17760            use std::clone::Clone;
17761            let token = self.0.request.page_token.clone();
17762            let execute = move |token: String| {
17763                let mut builder = self.clone();
17764                builder.0.request = builder.0.request.set_page_token(token);
17765                builder.send()
17766            };
17767            google_cloud_gax::paginator::internal::new_paginator(token, execute)
17768        }
17769
17770        /// Streams each item in the collection.
17771        pub fn by_item(
17772            self,
17773        ) -> impl google_cloud_gax::paginator::ItemPaginator<
17774            google_cloud_longrunning::model::ListOperationsResponse,
17775            crate::Error,
17776        > {
17777            use google_cloud_gax::paginator::Paginator;
17778            self.by_page().items()
17779        }
17780
17781        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
17782        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17783            self.0.request.name = v.into();
17784            self
17785        }
17786
17787        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
17788        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17789            self.0.request.filter = v.into();
17790            self
17791        }
17792
17793        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
17794        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17795            self.0.request.page_size = v.into();
17796            self
17797        }
17798
17799        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
17800        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17801            self.0.request.page_token = v.into();
17802            self
17803        }
17804
17805        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
17806        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17807            self.0.request.return_partial_success = v.into();
17808            self
17809        }
17810    }
17811
17812    #[doc(hidden)]
17813    impl crate::RequestBuilder for ListOperations {
17814        fn request_options(&mut self) -> &mut crate::RequestOptions {
17815            &mut self.0.options
17816        }
17817    }
17818
17819    /// The request builder for [TestCases::get_operation][crate::client::TestCases::get_operation] calls.
17820    ///
17821    /// # Example
17822    /// ```
17823    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::GetOperation;
17824    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17825    ///
17826    /// let builder = prepare_request_builder();
17827    /// let response = builder.send().await?;
17828    /// # Ok(()) }
17829    ///
17830    /// fn prepare_request_builder() -> GetOperation {
17831    ///   # panic!();
17832    ///   // ... details omitted ...
17833    /// }
17834    /// ```
17835    #[derive(Clone, Debug)]
17836    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17837
17838    impl GetOperation {
17839        pub(crate) fn new(
17840            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17841        ) -> Self {
17842            Self(RequestBuilder::new(stub))
17843        }
17844
17845        /// Sets the full request, replacing any prior values.
17846        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17847            mut self,
17848            v: V,
17849        ) -> Self {
17850            self.0.request = v.into();
17851            self
17852        }
17853
17854        /// Sets all the options, replacing any prior values.
17855        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17856            self.0.options = v.into();
17857            self
17858        }
17859
17860        /// Sends the request.
17861        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17862            (*self.0.stub)
17863                .get_operation(self.0.request, self.0.options)
17864                .await
17865                .map(crate::Response::into_body)
17866        }
17867
17868        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
17869        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17870            self.0.request.name = v.into();
17871            self
17872        }
17873    }
17874
17875    #[doc(hidden)]
17876    impl crate::RequestBuilder for GetOperation {
17877        fn request_options(&mut self) -> &mut crate::RequestOptions {
17878            &mut self.0.options
17879        }
17880    }
17881
17882    /// The request builder for [TestCases::cancel_operation][crate::client::TestCases::cancel_operation] calls.
17883    ///
17884    /// # Example
17885    /// ```
17886    /// # use google_cloud_dialogflow_cx_v3::builder::test_cases::CancelOperation;
17887    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
17888    ///
17889    /// let builder = prepare_request_builder();
17890    /// let response = builder.send().await?;
17891    /// # Ok(()) }
17892    ///
17893    /// fn prepare_request_builder() -> CancelOperation {
17894    ///   # panic!();
17895    ///   // ... details omitted ...
17896    /// }
17897    /// ```
17898    #[derive(Clone, Debug)]
17899    pub struct CancelOperation(
17900        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17901    );
17902
17903    impl CancelOperation {
17904        pub(crate) fn new(
17905            stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17906        ) -> Self {
17907            Self(RequestBuilder::new(stub))
17908        }
17909
17910        /// Sets the full request, replacing any prior values.
17911        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17912            mut self,
17913            v: V,
17914        ) -> Self {
17915            self.0.request = v.into();
17916            self
17917        }
17918
17919        /// Sets all the options, replacing any prior values.
17920        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17921            self.0.options = v.into();
17922            self
17923        }
17924
17925        /// Sends the request.
17926        pub async fn send(self) -> Result<()> {
17927            (*self.0.stub)
17928                .cancel_operation(self.0.request, self.0.options)
17929                .await
17930                .map(crate::Response::into_body)
17931        }
17932
17933        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
17934        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17935            self.0.request.name = v.into();
17936            self
17937        }
17938    }
17939
17940    #[doc(hidden)]
17941    impl crate::RequestBuilder for CancelOperation {
17942        fn request_options(&mut self) -> &mut crate::RequestOptions {
17943            &mut self.0.options
17944        }
17945    }
17946}
17947
17948/// Request and client builders for [Tools][crate::client::Tools].
17949#[cfg(feature = "tools")]
17950#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
17951pub mod tools {
17952    use crate::Result;
17953
17954    /// A builder for [Tools][crate::client::Tools].
17955    ///
17956    /// ```
17957    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
17958    /// # use google_cloud_dialogflow_cx_v3::*;
17959    /// # use builder::tools::ClientBuilder;
17960    /// # use client::Tools;
17961    /// let builder : ClientBuilder = Tools::builder();
17962    /// let client = builder
17963    ///     .with_endpoint("https://dialogflow.googleapis.com")
17964    ///     .build().await?;
17965    /// # Ok(()) }
17966    /// ```
17967    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17968
17969    pub(crate) mod client {
17970        use super::super::super::client::Tools;
17971        pub struct Factory;
17972        impl crate::ClientFactory for Factory {
17973            type Client = Tools;
17974            type Credentials = gaxi::options::Credentials;
17975            async fn build(
17976                self,
17977                config: gaxi::options::ClientConfig,
17978            ) -> crate::ClientBuilderResult<Self::Client> {
17979                Self::Client::new(config).await
17980            }
17981        }
17982    }
17983
17984    /// Common implementation for [crate::client::Tools] request builders.
17985    #[derive(Clone, Debug)]
17986    pub(crate) struct RequestBuilder<R: std::default::Default> {
17987        stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
17988        request: R,
17989        options: crate::RequestOptions,
17990    }
17991
17992    impl<R> RequestBuilder<R>
17993    where
17994        R: std::default::Default,
17995    {
17996        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
17997            Self {
17998                stub,
17999                request: R::default(),
18000                options: crate::RequestOptions::default(),
18001            }
18002        }
18003    }
18004
18005    /// The request builder for [Tools::create_tool][crate::client::Tools::create_tool] calls.
18006    ///
18007    /// # Example
18008    /// ```
18009    /// # use google_cloud_dialogflow_cx_v3::builder::tools::CreateTool;
18010    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18011    ///
18012    /// let builder = prepare_request_builder();
18013    /// let response = builder.send().await?;
18014    /// # Ok(()) }
18015    ///
18016    /// fn prepare_request_builder() -> CreateTool {
18017    ///   # panic!();
18018    ///   // ... details omitted ...
18019    /// }
18020    /// ```
18021    #[derive(Clone, Debug)]
18022    pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
18023
18024    impl CreateTool {
18025        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18026            Self(RequestBuilder::new(stub))
18027        }
18028
18029        /// Sets the full request, replacing any prior values.
18030        pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
18031            self.0.request = v.into();
18032            self
18033        }
18034
18035        /// Sets all the options, replacing any prior values.
18036        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18037            self.0.options = v.into();
18038            self
18039        }
18040
18041        /// Sends the request.
18042        pub async fn send(self) -> Result<crate::model::Tool> {
18043            (*self.0.stub)
18044                .create_tool(self.0.request, self.0.options)
18045                .await
18046                .map(crate::Response::into_body)
18047        }
18048
18049        /// Sets the value of [parent][crate::model::CreateToolRequest::parent].
18050        ///
18051        /// This is a **required** field for requests.
18052        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18053            self.0.request.parent = v.into();
18054            self
18055        }
18056
18057        /// Sets the value of [tool][crate::model::CreateToolRequest::tool].
18058        ///
18059        /// This is a **required** field for requests.
18060        pub fn set_tool<T>(mut self, v: T) -> Self
18061        where
18062            T: std::convert::Into<crate::model::Tool>,
18063        {
18064            self.0.request.tool = std::option::Option::Some(v.into());
18065            self
18066        }
18067
18068        /// Sets or clears the value of [tool][crate::model::CreateToolRequest::tool].
18069        ///
18070        /// This is a **required** field for requests.
18071        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
18072        where
18073            T: std::convert::Into<crate::model::Tool>,
18074        {
18075            self.0.request.tool = v.map(|x| x.into());
18076            self
18077        }
18078    }
18079
18080    #[doc(hidden)]
18081    impl crate::RequestBuilder for CreateTool {
18082        fn request_options(&mut self) -> &mut crate::RequestOptions {
18083            &mut self.0.options
18084        }
18085    }
18086
18087    /// The request builder for [Tools::list_tools][crate::client::Tools::list_tools] calls.
18088    ///
18089    /// # Example
18090    /// ```
18091    /// # use google_cloud_dialogflow_cx_v3::builder::tools::ListTools;
18092    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18093    /// use google_cloud_gax::paginator::ItemPaginator;
18094    ///
18095    /// let builder = prepare_request_builder();
18096    /// let mut items = builder.by_item();
18097    /// while let Some(result) = items.next().await {
18098    ///   let item = result?;
18099    /// }
18100    /// # Ok(()) }
18101    ///
18102    /// fn prepare_request_builder() -> ListTools {
18103    ///   # panic!();
18104    ///   // ... details omitted ...
18105    /// }
18106    /// ```
18107    #[derive(Clone, Debug)]
18108    pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
18109
18110    impl ListTools {
18111        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18112            Self(RequestBuilder::new(stub))
18113        }
18114
18115        /// Sets the full request, replacing any prior values.
18116        pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
18117            self.0.request = v.into();
18118            self
18119        }
18120
18121        /// Sets all the options, replacing any prior values.
18122        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18123            self.0.options = v.into();
18124            self
18125        }
18126
18127        /// Sends the request.
18128        pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
18129            (*self.0.stub)
18130                .list_tools(self.0.request, self.0.options)
18131                .await
18132                .map(crate::Response::into_body)
18133        }
18134
18135        /// Streams each page in the collection.
18136        pub fn by_page(
18137            self,
18138        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
18139        {
18140            use std::clone::Clone;
18141            let token = self.0.request.page_token.clone();
18142            let execute = move |token: String| {
18143                let mut builder = self.clone();
18144                builder.0.request = builder.0.request.set_page_token(token);
18145                builder.send()
18146            };
18147            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18148        }
18149
18150        /// Streams each item in the collection.
18151        pub fn by_item(
18152            self,
18153        ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
18154        {
18155            use google_cloud_gax::paginator::Paginator;
18156            self.by_page().items()
18157        }
18158
18159        /// Sets the value of [parent][crate::model::ListToolsRequest::parent].
18160        ///
18161        /// This is a **required** field for requests.
18162        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18163            self.0.request.parent = v.into();
18164            self
18165        }
18166
18167        /// Sets the value of [page_size][crate::model::ListToolsRequest::page_size].
18168        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18169            self.0.request.page_size = v.into();
18170            self
18171        }
18172
18173        /// Sets the value of [page_token][crate::model::ListToolsRequest::page_token].
18174        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18175            self.0.request.page_token = v.into();
18176            self
18177        }
18178    }
18179
18180    #[doc(hidden)]
18181    impl crate::RequestBuilder for ListTools {
18182        fn request_options(&mut self) -> &mut crate::RequestOptions {
18183            &mut self.0.options
18184        }
18185    }
18186
18187    /// The request builder for [Tools::get_tool][crate::client::Tools::get_tool] calls.
18188    ///
18189    /// # Example
18190    /// ```
18191    /// # use google_cloud_dialogflow_cx_v3::builder::tools::GetTool;
18192    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18193    ///
18194    /// let builder = prepare_request_builder();
18195    /// let response = builder.send().await?;
18196    /// # Ok(()) }
18197    ///
18198    /// fn prepare_request_builder() -> GetTool {
18199    ///   # panic!();
18200    ///   // ... details omitted ...
18201    /// }
18202    /// ```
18203    #[derive(Clone, Debug)]
18204    pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
18205
18206    impl GetTool {
18207        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18208            Self(RequestBuilder::new(stub))
18209        }
18210
18211        /// Sets the full request, replacing any prior values.
18212        pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
18213            self.0.request = v.into();
18214            self
18215        }
18216
18217        /// Sets all the options, replacing any prior values.
18218        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18219            self.0.options = v.into();
18220            self
18221        }
18222
18223        /// Sends the request.
18224        pub async fn send(self) -> Result<crate::model::Tool> {
18225            (*self.0.stub)
18226                .get_tool(self.0.request, self.0.options)
18227                .await
18228                .map(crate::Response::into_body)
18229        }
18230
18231        /// Sets the value of [name][crate::model::GetToolRequest::name].
18232        ///
18233        /// This is a **required** field for requests.
18234        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18235            self.0.request.name = v.into();
18236            self
18237        }
18238    }
18239
18240    #[doc(hidden)]
18241    impl crate::RequestBuilder for GetTool {
18242        fn request_options(&mut self) -> &mut crate::RequestOptions {
18243            &mut self.0.options
18244        }
18245    }
18246
18247    /// The request builder for [Tools::update_tool][crate::client::Tools::update_tool] calls.
18248    ///
18249    /// # Example
18250    /// ```
18251    /// # use google_cloud_dialogflow_cx_v3::builder::tools::UpdateTool;
18252    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18253    ///
18254    /// let builder = prepare_request_builder();
18255    /// let response = builder.send().await?;
18256    /// # Ok(()) }
18257    ///
18258    /// fn prepare_request_builder() -> UpdateTool {
18259    ///   # panic!();
18260    ///   // ... details omitted ...
18261    /// }
18262    /// ```
18263    #[derive(Clone, Debug)]
18264    pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
18265
18266    impl UpdateTool {
18267        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18268            Self(RequestBuilder::new(stub))
18269        }
18270
18271        /// Sets the full request, replacing any prior values.
18272        pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
18273            self.0.request = v.into();
18274            self
18275        }
18276
18277        /// Sets all the options, replacing any prior values.
18278        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18279            self.0.options = v.into();
18280            self
18281        }
18282
18283        /// Sends the request.
18284        pub async fn send(self) -> Result<crate::model::Tool> {
18285            (*self.0.stub)
18286                .update_tool(self.0.request, self.0.options)
18287                .await
18288                .map(crate::Response::into_body)
18289        }
18290
18291        /// Sets the value of [tool][crate::model::UpdateToolRequest::tool].
18292        ///
18293        /// This is a **required** field for requests.
18294        pub fn set_tool<T>(mut self, v: T) -> Self
18295        where
18296            T: std::convert::Into<crate::model::Tool>,
18297        {
18298            self.0.request.tool = std::option::Option::Some(v.into());
18299            self
18300        }
18301
18302        /// Sets or clears the value of [tool][crate::model::UpdateToolRequest::tool].
18303        ///
18304        /// This is a **required** field for requests.
18305        pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
18306        where
18307            T: std::convert::Into<crate::model::Tool>,
18308        {
18309            self.0.request.tool = v.map(|x| x.into());
18310            self
18311        }
18312
18313        /// Sets the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
18314        pub fn set_update_mask<T>(mut self, v: T) -> Self
18315        where
18316            T: std::convert::Into<wkt::FieldMask>,
18317        {
18318            self.0.request.update_mask = std::option::Option::Some(v.into());
18319            self
18320        }
18321
18322        /// Sets or clears the value of [update_mask][crate::model::UpdateToolRequest::update_mask].
18323        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18324        where
18325            T: std::convert::Into<wkt::FieldMask>,
18326        {
18327            self.0.request.update_mask = v.map(|x| x.into());
18328            self
18329        }
18330    }
18331
18332    #[doc(hidden)]
18333    impl crate::RequestBuilder for UpdateTool {
18334        fn request_options(&mut self) -> &mut crate::RequestOptions {
18335            &mut self.0.options
18336        }
18337    }
18338
18339    /// The request builder for [Tools::delete_tool][crate::client::Tools::delete_tool] calls.
18340    ///
18341    /// # Example
18342    /// ```
18343    /// # use google_cloud_dialogflow_cx_v3::builder::tools::DeleteTool;
18344    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18345    ///
18346    /// let builder = prepare_request_builder();
18347    /// let response = builder.send().await?;
18348    /// # Ok(()) }
18349    ///
18350    /// fn prepare_request_builder() -> DeleteTool {
18351    ///   # panic!();
18352    ///   // ... details omitted ...
18353    /// }
18354    /// ```
18355    #[derive(Clone, Debug)]
18356    pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
18357
18358    impl DeleteTool {
18359        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18360            Self(RequestBuilder::new(stub))
18361        }
18362
18363        /// Sets the full request, replacing any prior values.
18364        pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
18365            self.0.request = v.into();
18366            self
18367        }
18368
18369        /// Sets all the options, replacing any prior values.
18370        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18371            self.0.options = v.into();
18372            self
18373        }
18374
18375        /// Sends the request.
18376        pub async fn send(self) -> Result<()> {
18377            (*self.0.stub)
18378                .delete_tool(self.0.request, self.0.options)
18379                .await
18380                .map(crate::Response::into_body)
18381        }
18382
18383        /// Sets the value of [name][crate::model::DeleteToolRequest::name].
18384        ///
18385        /// This is a **required** field for requests.
18386        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18387            self.0.request.name = v.into();
18388            self
18389        }
18390
18391        /// Sets the value of [force][crate::model::DeleteToolRequest::force].
18392        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18393            self.0.request.force = v.into();
18394            self
18395        }
18396    }
18397
18398    #[doc(hidden)]
18399    impl crate::RequestBuilder for DeleteTool {
18400        fn request_options(&mut self) -> &mut crate::RequestOptions {
18401            &mut self.0.options
18402        }
18403    }
18404
18405    /// The request builder for [Tools::list_tool_versions][crate::client::Tools::list_tool_versions] calls.
18406    ///
18407    /// # Example
18408    /// ```
18409    /// # use google_cloud_dialogflow_cx_v3::builder::tools::ListToolVersions;
18410    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18411    /// use google_cloud_gax::paginator::ItemPaginator;
18412    ///
18413    /// let builder = prepare_request_builder();
18414    /// let mut items = builder.by_item();
18415    /// while let Some(result) = items.next().await {
18416    ///   let item = result?;
18417    /// }
18418    /// # Ok(()) }
18419    ///
18420    /// fn prepare_request_builder() -> ListToolVersions {
18421    ///   # panic!();
18422    ///   // ... details omitted ...
18423    /// }
18424    /// ```
18425    #[derive(Clone, Debug)]
18426    pub struct ListToolVersions(RequestBuilder<crate::model::ListToolVersionsRequest>);
18427
18428    impl ListToolVersions {
18429        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18430            Self(RequestBuilder::new(stub))
18431        }
18432
18433        /// Sets the full request, replacing any prior values.
18434        pub fn with_request<V: Into<crate::model::ListToolVersionsRequest>>(
18435            mut self,
18436            v: V,
18437        ) -> Self {
18438            self.0.request = v.into();
18439            self
18440        }
18441
18442        /// Sets all the options, replacing any prior values.
18443        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18444            self.0.options = v.into();
18445            self
18446        }
18447
18448        /// Sends the request.
18449        pub async fn send(self) -> Result<crate::model::ListToolVersionsResponse> {
18450            (*self.0.stub)
18451                .list_tool_versions(self.0.request, self.0.options)
18452                .await
18453                .map(crate::Response::into_body)
18454        }
18455
18456        /// Streams each page in the collection.
18457        pub fn by_page(
18458            self,
18459        ) -> impl google_cloud_gax::paginator::Paginator<
18460            crate::model::ListToolVersionsResponse,
18461            crate::Error,
18462        > {
18463            use std::clone::Clone;
18464            let token = self.0.request.page_token.clone();
18465            let execute = move |token: String| {
18466                let mut builder = self.clone();
18467                builder.0.request = builder.0.request.set_page_token(token);
18468                builder.send()
18469            };
18470            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18471        }
18472
18473        /// Streams each item in the collection.
18474        pub fn by_item(
18475            self,
18476        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18477            crate::model::ListToolVersionsResponse,
18478            crate::Error,
18479        > {
18480            use google_cloud_gax::paginator::Paginator;
18481            self.by_page().items()
18482        }
18483
18484        /// Sets the value of [parent][crate::model::ListToolVersionsRequest::parent].
18485        ///
18486        /// This is a **required** field for requests.
18487        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18488            self.0.request.parent = v.into();
18489            self
18490        }
18491
18492        /// Sets the value of [page_size][crate::model::ListToolVersionsRequest::page_size].
18493        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18494            self.0.request.page_size = v.into();
18495            self
18496        }
18497
18498        /// Sets the value of [page_token][crate::model::ListToolVersionsRequest::page_token].
18499        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18500            self.0.request.page_token = v.into();
18501            self
18502        }
18503    }
18504
18505    #[doc(hidden)]
18506    impl crate::RequestBuilder for ListToolVersions {
18507        fn request_options(&mut self) -> &mut crate::RequestOptions {
18508            &mut self.0.options
18509        }
18510    }
18511
18512    /// The request builder for [Tools::create_tool_version][crate::client::Tools::create_tool_version] calls.
18513    ///
18514    /// # Example
18515    /// ```
18516    /// # use google_cloud_dialogflow_cx_v3::builder::tools::CreateToolVersion;
18517    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18518    ///
18519    /// let builder = prepare_request_builder();
18520    /// let response = builder.send().await?;
18521    /// # Ok(()) }
18522    ///
18523    /// fn prepare_request_builder() -> CreateToolVersion {
18524    ///   # panic!();
18525    ///   // ... details omitted ...
18526    /// }
18527    /// ```
18528    #[derive(Clone, Debug)]
18529    pub struct CreateToolVersion(RequestBuilder<crate::model::CreateToolVersionRequest>);
18530
18531    impl CreateToolVersion {
18532        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18533            Self(RequestBuilder::new(stub))
18534        }
18535
18536        /// Sets the full request, replacing any prior values.
18537        pub fn with_request<V: Into<crate::model::CreateToolVersionRequest>>(
18538            mut self,
18539            v: V,
18540        ) -> Self {
18541            self.0.request = v.into();
18542            self
18543        }
18544
18545        /// Sets all the options, replacing any prior values.
18546        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18547            self.0.options = v.into();
18548            self
18549        }
18550
18551        /// Sends the request.
18552        pub async fn send(self) -> Result<crate::model::ToolVersion> {
18553            (*self.0.stub)
18554                .create_tool_version(self.0.request, self.0.options)
18555                .await
18556                .map(crate::Response::into_body)
18557        }
18558
18559        /// Sets the value of [parent][crate::model::CreateToolVersionRequest::parent].
18560        ///
18561        /// This is a **required** field for requests.
18562        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18563            self.0.request.parent = v.into();
18564            self
18565        }
18566
18567        /// Sets the value of [tool_version][crate::model::CreateToolVersionRequest::tool_version].
18568        ///
18569        /// This is a **required** field for requests.
18570        pub fn set_tool_version<T>(mut self, v: T) -> Self
18571        where
18572            T: std::convert::Into<crate::model::ToolVersion>,
18573        {
18574            self.0.request.tool_version = std::option::Option::Some(v.into());
18575            self
18576        }
18577
18578        /// Sets or clears the value of [tool_version][crate::model::CreateToolVersionRequest::tool_version].
18579        ///
18580        /// This is a **required** field for requests.
18581        pub fn set_or_clear_tool_version<T>(mut self, v: std::option::Option<T>) -> Self
18582        where
18583            T: std::convert::Into<crate::model::ToolVersion>,
18584        {
18585            self.0.request.tool_version = v.map(|x| x.into());
18586            self
18587        }
18588    }
18589
18590    #[doc(hidden)]
18591    impl crate::RequestBuilder for CreateToolVersion {
18592        fn request_options(&mut self) -> &mut crate::RequestOptions {
18593            &mut self.0.options
18594        }
18595    }
18596
18597    /// The request builder for [Tools::get_tool_version][crate::client::Tools::get_tool_version] calls.
18598    ///
18599    /// # Example
18600    /// ```
18601    /// # use google_cloud_dialogflow_cx_v3::builder::tools::GetToolVersion;
18602    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18603    ///
18604    /// let builder = prepare_request_builder();
18605    /// let response = builder.send().await?;
18606    /// # Ok(()) }
18607    ///
18608    /// fn prepare_request_builder() -> GetToolVersion {
18609    ///   # panic!();
18610    ///   // ... details omitted ...
18611    /// }
18612    /// ```
18613    #[derive(Clone, Debug)]
18614    pub struct GetToolVersion(RequestBuilder<crate::model::GetToolVersionRequest>);
18615
18616    impl GetToolVersion {
18617        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18618            Self(RequestBuilder::new(stub))
18619        }
18620
18621        /// Sets the full request, replacing any prior values.
18622        pub fn with_request<V: Into<crate::model::GetToolVersionRequest>>(mut self, v: V) -> Self {
18623            self.0.request = v.into();
18624            self
18625        }
18626
18627        /// Sets all the options, replacing any prior values.
18628        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18629            self.0.options = v.into();
18630            self
18631        }
18632
18633        /// Sends the request.
18634        pub async fn send(self) -> Result<crate::model::ToolVersion> {
18635            (*self.0.stub)
18636                .get_tool_version(self.0.request, self.0.options)
18637                .await
18638                .map(crate::Response::into_body)
18639        }
18640
18641        /// Sets the value of [name][crate::model::GetToolVersionRequest::name].
18642        ///
18643        /// This is a **required** field for requests.
18644        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18645            self.0.request.name = v.into();
18646            self
18647        }
18648    }
18649
18650    #[doc(hidden)]
18651    impl crate::RequestBuilder for GetToolVersion {
18652        fn request_options(&mut self) -> &mut crate::RequestOptions {
18653            &mut self.0.options
18654        }
18655    }
18656
18657    /// The request builder for [Tools::delete_tool_version][crate::client::Tools::delete_tool_version] calls.
18658    ///
18659    /// # Example
18660    /// ```
18661    /// # use google_cloud_dialogflow_cx_v3::builder::tools::DeleteToolVersion;
18662    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18663    ///
18664    /// let builder = prepare_request_builder();
18665    /// let response = builder.send().await?;
18666    /// # Ok(()) }
18667    ///
18668    /// fn prepare_request_builder() -> DeleteToolVersion {
18669    ///   # panic!();
18670    ///   // ... details omitted ...
18671    /// }
18672    /// ```
18673    #[derive(Clone, Debug)]
18674    pub struct DeleteToolVersion(RequestBuilder<crate::model::DeleteToolVersionRequest>);
18675
18676    impl DeleteToolVersion {
18677        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18678            Self(RequestBuilder::new(stub))
18679        }
18680
18681        /// Sets the full request, replacing any prior values.
18682        pub fn with_request<V: Into<crate::model::DeleteToolVersionRequest>>(
18683            mut self,
18684            v: V,
18685        ) -> Self {
18686            self.0.request = v.into();
18687            self
18688        }
18689
18690        /// Sets all the options, replacing any prior values.
18691        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18692            self.0.options = v.into();
18693            self
18694        }
18695
18696        /// Sends the request.
18697        pub async fn send(self) -> Result<()> {
18698            (*self.0.stub)
18699                .delete_tool_version(self.0.request, self.0.options)
18700                .await
18701                .map(crate::Response::into_body)
18702        }
18703
18704        /// Sets the value of [name][crate::model::DeleteToolVersionRequest::name].
18705        ///
18706        /// This is a **required** field for requests.
18707        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18708            self.0.request.name = v.into();
18709            self
18710        }
18711
18712        /// Sets the value of [force][crate::model::DeleteToolVersionRequest::force].
18713        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18714            self.0.request.force = v.into();
18715            self
18716        }
18717    }
18718
18719    #[doc(hidden)]
18720    impl crate::RequestBuilder for DeleteToolVersion {
18721        fn request_options(&mut self) -> &mut crate::RequestOptions {
18722            &mut self.0.options
18723        }
18724    }
18725
18726    /// The request builder for [Tools::restore_tool_version][crate::client::Tools::restore_tool_version] calls.
18727    ///
18728    /// # Example
18729    /// ```
18730    /// # use google_cloud_dialogflow_cx_v3::builder::tools::RestoreToolVersion;
18731    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18732    ///
18733    /// let builder = prepare_request_builder();
18734    /// let response = builder.send().await?;
18735    /// # Ok(()) }
18736    ///
18737    /// fn prepare_request_builder() -> RestoreToolVersion {
18738    ///   # panic!();
18739    ///   // ... details omitted ...
18740    /// }
18741    /// ```
18742    #[derive(Clone, Debug)]
18743    pub struct RestoreToolVersion(RequestBuilder<crate::model::RestoreToolVersionRequest>);
18744
18745    impl RestoreToolVersion {
18746        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18747            Self(RequestBuilder::new(stub))
18748        }
18749
18750        /// Sets the full request, replacing any prior values.
18751        pub fn with_request<V: Into<crate::model::RestoreToolVersionRequest>>(
18752            mut self,
18753            v: V,
18754        ) -> Self {
18755            self.0.request = v.into();
18756            self
18757        }
18758
18759        /// Sets all the options, replacing any prior values.
18760        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18761            self.0.options = v.into();
18762            self
18763        }
18764
18765        /// Sends the request.
18766        pub async fn send(self) -> Result<crate::model::RestoreToolVersionResponse> {
18767            (*self.0.stub)
18768                .restore_tool_version(self.0.request, self.0.options)
18769                .await
18770                .map(crate::Response::into_body)
18771        }
18772
18773        /// Sets the value of [name][crate::model::RestoreToolVersionRequest::name].
18774        ///
18775        /// This is a **required** field for requests.
18776        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18777            self.0.request.name = v.into();
18778            self
18779        }
18780    }
18781
18782    #[doc(hidden)]
18783    impl crate::RequestBuilder for RestoreToolVersion {
18784        fn request_options(&mut self) -> &mut crate::RequestOptions {
18785            &mut self.0.options
18786        }
18787    }
18788
18789    /// The request builder for [Tools::list_locations][crate::client::Tools::list_locations] calls.
18790    ///
18791    /// # Example
18792    /// ```
18793    /// # use google_cloud_dialogflow_cx_v3::builder::tools::ListLocations;
18794    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18795    /// use google_cloud_gax::paginator::ItemPaginator;
18796    ///
18797    /// let builder = prepare_request_builder();
18798    /// let mut items = builder.by_item();
18799    /// while let Some(result) = items.next().await {
18800    ///   let item = result?;
18801    /// }
18802    /// # Ok(()) }
18803    ///
18804    /// fn prepare_request_builder() -> ListLocations {
18805    ///   # panic!();
18806    ///   // ... details omitted ...
18807    /// }
18808    /// ```
18809    #[derive(Clone, Debug)]
18810    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18811
18812    impl ListLocations {
18813        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18814            Self(RequestBuilder::new(stub))
18815        }
18816
18817        /// Sets the full request, replacing any prior values.
18818        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18819            mut self,
18820            v: V,
18821        ) -> Self {
18822            self.0.request = v.into();
18823            self
18824        }
18825
18826        /// Sets all the options, replacing any prior values.
18827        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18828            self.0.options = v.into();
18829            self
18830        }
18831
18832        /// Sends the request.
18833        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18834            (*self.0.stub)
18835                .list_locations(self.0.request, self.0.options)
18836                .await
18837                .map(crate::Response::into_body)
18838        }
18839
18840        /// Streams each page in the collection.
18841        pub fn by_page(
18842            self,
18843        ) -> impl google_cloud_gax::paginator::Paginator<
18844            google_cloud_location::model::ListLocationsResponse,
18845            crate::Error,
18846        > {
18847            use std::clone::Clone;
18848            let token = self.0.request.page_token.clone();
18849            let execute = move |token: String| {
18850                let mut builder = self.clone();
18851                builder.0.request = builder.0.request.set_page_token(token);
18852                builder.send()
18853            };
18854            google_cloud_gax::paginator::internal::new_paginator(token, execute)
18855        }
18856
18857        /// Streams each item in the collection.
18858        pub fn by_item(
18859            self,
18860        ) -> impl google_cloud_gax::paginator::ItemPaginator<
18861            google_cloud_location::model::ListLocationsResponse,
18862            crate::Error,
18863        > {
18864            use google_cloud_gax::paginator::Paginator;
18865            self.by_page().items()
18866        }
18867
18868        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
18869        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18870            self.0.request.name = v.into();
18871            self
18872        }
18873
18874        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
18875        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18876            self.0.request.filter = v.into();
18877            self
18878        }
18879
18880        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
18881        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18882            self.0.request.page_size = v.into();
18883            self
18884        }
18885
18886        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
18887        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18888            self.0.request.page_token = v.into();
18889            self
18890        }
18891    }
18892
18893    #[doc(hidden)]
18894    impl crate::RequestBuilder for ListLocations {
18895        fn request_options(&mut self) -> &mut crate::RequestOptions {
18896            &mut self.0.options
18897        }
18898    }
18899
18900    /// The request builder for [Tools::get_location][crate::client::Tools::get_location] calls.
18901    ///
18902    /// # Example
18903    /// ```
18904    /// # use google_cloud_dialogflow_cx_v3::builder::tools::GetLocation;
18905    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18906    ///
18907    /// let builder = prepare_request_builder();
18908    /// let response = builder.send().await?;
18909    /// # Ok(()) }
18910    ///
18911    /// fn prepare_request_builder() -> GetLocation {
18912    ///   # panic!();
18913    ///   // ... details omitted ...
18914    /// }
18915    /// ```
18916    #[derive(Clone, Debug)]
18917    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
18918
18919    impl GetLocation {
18920        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18921            Self(RequestBuilder::new(stub))
18922        }
18923
18924        /// Sets the full request, replacing any prior values.
18925        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
18926            mut self,
18927            v: V,
18928        ) -> Self {
18929            self.0.request = v.into();
18930            self
18931        }
18932
18933        /// Sets all the options, replacing any prior values.
18934        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18935            self.0.options = v.into();
18936            self
18937        }
18938
18939        /// Sends the request.
18940        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
18941            (*self.0.stub)
18942                .get_location(self.0.request, self.0.options)
18943                .await
18944                .map(crate::Response::into_body)
18945        }
18946
18947        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
18948        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18949            self.0.request.name = v.into();
18950            self
18951        }
18952    }
18953
18954    #[doc(hidden)]
18955    impl crate::RequestBuilder for GetLocation {
18956        fn request_options(&mut self) -> &mut crate::RequestOptions {
18957            &mut self.0.options
18958        }
18959    }
18960
18961    /// The request builder for [Tools::list_operations][crate::client::Tools::list_operations] calls.
18962    ///
18963    /// # Example
18964    /// ```
18965    /// # use google_cloud_dialogflow_cx_v3::builder::tools::ListOperations;
18966    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
18967    /// use google_cloud_gax::paginator::ItemPaginator;
18968    ///
18969    /// let builder = prepare_request_builder();
18970    /// let mut items = builder.by_item();
18971    /// while let Some(result) = items.next().await {
18972    ///   let item = result?;
18973    /// }
18974    /// # Ok(()) }
18975    ///
18976    /// fn prepare_request_builder() -> ListOperations {
18977    ///   # panic!();
18978    ///   // ... details omitted ...
18979    /// }
18980    /// ```
18981    #[derive(Clone, Debug)]
18982    pub struct ListOperations(
18983        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
18984    );
18985
18986    impl ListOperations {
18987        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18988            Self(RequestBuilder::new(stub))
18989        }
18990
18991        /// Sets the full request, replacing any prior values.
18992        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
18993            mut self,
18994            v: V,
18995        ) -> Self {
18996            self.0.request = v.into();
18997            self
18998        }
18999
19000        /// Sets all the options, replacing any prior values.
19001        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19002            self.0.options = v.into();
19003            self
19004        }
19005
19006        /// Sends the request.
19007        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19008            (*self.0.stub)
19009                .list_operations(self.0.request, self.0.options)
19010                .await
19011                .map(crate::Response::into_body)
19012        }
19013
19014        /// Streams each page in the collection.
19015        pub fn by_page(
19016            self,
19017        ) -> impl google_cloud_gax::paginator::Paginator<
19018            google_cloud_longrunning::model::ListOperationsResponse,
19019            crate::Error,
19020        > {
19021            use std::clone::Clone;
19022            let token = self.0.request.page_token.clone();
19023            let execute = move |token: String| {
19024                let mut builder = self.clone();
19025                builder.0.request = builder.0.request.set_page_token(token);
19026                builder.send()
19027            };
19028            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19029        }
19030
19031        /// Streams each item in the collection.
19032        pub fn by_item(
19033            self,
19034        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19035            google_cloud_longrunning::model::ListOperationsResponse,
19036            crate::Error,
19037        > {
19038            use google_cloud_gax::paginator::Paginator;
19039            self.by_page().items()
19040        }
19041
19042        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19043        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19044            self.0.request.name = v.into();
19045            self
19046        }
19047
19048        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19049        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19050            self.0.request.filter = v.into();
19051            self
19052        }
19053
19054        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19055        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19056            self.0.request.page_size = v.into();
19057            self
19058        }
19059
19060        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
19061        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19062            self.0.request.page_token = v.into();
19063            self
19064        }
19065
19066        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
19067        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19068            self.0.request.return_partial_success = v.into();
19069            self
19070        }
19071    }
19072
19073    #[doc(hidden)]
19074    impl crate::RequestBuilder for ListOperations {
19075        fn request_options(&mut self) -> &mut crate::RequestOptions {
19076            &mut self.0.options
19077        }
19078    }
19079
19080    /// The request builder for [Tools::get_operation][crate::client::Tools::get_operation] calls.
19081    ///
19082    /// # Example
19083    /// ```
19084    /// # use google_cloud_dialogflow_cx_v3::builder::tools::GetOperation;
19085    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19086    ///
19087    /// let builder = prepare_request_builder();
19088    /// let response = builder.send().await?;
19089    /// # Ok(()) }
19090    ///
19091    /// fn prepare_request_builder() -> GetOperation {
19092    ///   # panic!();
19093    ///   // ... details omitted ...
19094    /// }
19095    /// ```
19096    #[derive(Clone, Debug)]
19097    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19098
19099    impl GetOperation {
19100        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
19101            Self(RequestBuilder::new(stub))
19102        }
19103
19104        /// Sets the full request, replacing any prior values.
19105        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19106            mut self,
19107            v: V,
19108        ) -> Self {
19109            self.0.request = v.into();
19110            self
19111        }
19112
19113        /// Sets all the options, replacing any prior values.
19114        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19115            self.0.options = v.into();
19116            self
19117        }
19118
19119        /// Sends the request.
19120        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19121            (*self.0.stub)
19122                .get_operation(self.0.request, self.0.options)
19123                .await
19124                .map(crate::Response::into_body)
19125        }
19126
19127        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
19128        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19129            self.0.request.name = v.into();
19130            self
19131        }
19132    }
19133
19134    #[doc(hidden)]
19135    impl crate::RequestBuilder for GetOperation {
19136        fn request_options(&mut self) -> &mut crate::RequestOptions {
19137            &mut self.0.options
19138        }
19139    }
19140
19141    /// The request builder for [Tools::cancel_operation][crate::client::Tools::cancel_operation] calls.
19142    ///
19143    /// # Example
19144    /// ```
19145    /// # use google_cloud_dialogflow_cx_v3::builder::tools::CancelOperation;
19146    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19147    ///
19148    /// let builder = prepare_request_builder();
19149    /// let response = builder.send().await?;
19150    /// # Ok(()) }
19151    ///
19152    /// fn prepare_request_builder() -> CancelOperation {
19153    ///   # panic!();
19154    ///   // ... details omitted ...
19155    /// }
19156    /// ```
19157    #[derive(Clone, Debug)]
19158    pub struct CancelOperation(
19159        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19160    );
19161
19162    impl CancelOperation {
19163        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
19164            Self(RequestBuilder::new(stub))
19165        }
19166
19167        /// Sets the full request, replacing any prior values.
19168        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19169            mut self,
19170            v: V,
19171        ) -> Self {
19172            self.0.request = v.into();
19173            self
19174        }
19175
19176        /// Sets all the options, replacing any prior values.
19177        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19178            self.0.options = v.into();
19179            self
19180        }
19181
19182        /// Sends the request.
19183        pub async fn send(self) -> Result<()> {
19184            (*self.0.stub)
19185                .cancel_operation(self.0.request, self.0.options)
19186                .await
19187                .map(crate::Response::into_body)
19188        }
19189
19190        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
19191        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19192            self.0.request.name = v.into();
19193            self
19194        }
19195    }
19196
19197    #[doc(hidden)]
19198    impl crate::RequestBuilder for CancelOperation {
19199        fn request_options(&mut self) -> &mut crate::RequestOptions {
19200            &mut self.0.options
19201        }
19202    }
19203}
19204
19205/// Request and client builders for [TransitionRouteGroups][crate::client::TransitionRouteGroups].
19206#[cfg(feature = "transition-route-groups")]
19207#[cfg_attr(docsrs, doc(cfg(feature = "transition-route-groups")))]
19208pub mod transition_route_groups {
19209    use crate::Result;
19210
19211    /// A builder for [TransitionRouteGroups][crate::client::TransitionRouteGroups].
19212    ///
19213    /// ```
19214    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
19215    /// # use google_cloud_dialogflow_cx_v3::*;
19216    /// # use builder::transition_route_groups::ClientBuilder;
19217    /// # use client::TransitionRouteGroups;
19218    /// let builder : ClientBuilder = TransitionRouteGroups::builder();
19219    /// let client = builder
19220    ///     .with_endpoint("https://dialogflow.googleapis.com")
19221    ///     .build().await?;
19222    /// # Ok(()) }
19223    /// ```
19224    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19225
19226    pub(crate) mod client {
19227        use super::super::super::client::TransitionRouteGroups;
19228        pub struct Factory;
19229        impl crate::ClientFactory for Factory {
19230            type Client = TransitionRouteGroups;
19231            type Credentials = gaxi::options::Credentials;
19232            async fn build(
19233                self,
19234                config: gaxi::options::ClientConfig,
19235            ) -> crate::ClientBuilderResult<Self::Client> {
19236                Self::Client::new(config).await
19237            }
19238        }
19239    }
19240
19241    /// Common implementation for [crate::client::TransitionRouteGroups] request builders.
19242    #[derive(Clone, Debug)]
19243    pub(crate) struct RequestBuilder<R: std::default::Default> {
19244        stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19245        request: R,
19246        options: crate::RequestOptions,
19247    }
19248
19249    impl<R> RequestBuilder<R>
19250    where
19251        R: std::default::Default,
19252    {
19253        pub(crate) fn new(
19254            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19255        ) -> Self {
19256            Self {
19257                stub,
19258                request: R::default(),
19259                options: crate::RequestOptions::default(),
19260            }
19261        }
19262    }
19263
19264    /// The request builder for [TransitionRouteGroups::list_transition_route_groups][crate::client::TransitionRouteGroups::list_transition_route_groups] calls.
19265    ///
19266    /// # Example
19267    /// ```
19268    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::ListTransitionRouteGroups;
19269    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19270    /// use google_cloud_gax::paginator::ItemPaginator;
19271    ///
19272    /// let builder = prepare_request_builder();
19273    /// let mut items = builder.by_item();
19274    /// while let Some(result) = items.next().await {
19275    ///   let item = result?;
19276    /// }
19277    /// # Ok(()) }
19278    ///
19279    /// fn prepare_request_builder() -> ListTransitionRouteGroups {
19280    ///   # panic!();
19281    ///   // ... details omitted ...
19282    /// }
19283    /// ```
19284    #[derive(Clone, Debug)]
19285    pub struct ListTransitionRouteGroups(
19286        RequestBuilder<crate::model::ListTransitionRouteGroupsRequest>,
19287    );
19288
19289    impl ListTransitionRouteGroups {
19290        pub(crate) fn new(
19291            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19292        ) -> Self {
19293            Self(RequestBuilder::new(stub))
19294        }
19295
19296        /// Sets the full request, replacing any prior values.
19297        pub fn with_request<V: Into<crate::model::ListTransitionRouteGroupsRequest>>(
19298            mut self,
19299            v: V,
19300        ) -> Self {
19301            self.0.request = v.into();
19302            self
19303        }
19304
19305        /// Sets all the options, replacing any prior values.
19306        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19307            self.0.options = v.into();
19308            self
19309        }
19310
19311        /// Sends the request.
19312        pub async fn send(self) -> Result<crate::model::ListTransitionRouteGroupsResponse> {
19313            (*self.0.stub)
19314                .list_transition_route_groups(self.0.request, self.0.options)
19315                .await
19316                .map(crate::Response::into_body)
19317        }
19318
19319        /// Streams each page in the collection.
19320        pub fn by_page(
19321            self,
19322        ) -> impl google_cloud_gax::paginator::Paginator<
19323            crate::model::ListTransitionRouteGroupsResponse,
19324            crate::Error,
19325        > {
19326            use std::clone::Clone;
19327            let token = self.0.request.page_token.clone();
19328            let execute = move |token: String| {
19329                let mut builder = self.clone();
19330                builder.0.request = builder.0.request.set_page_token(token);
19331                builder.send()
19332            };
19333            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19334        }
19335
19336        /// Streams each item in the collection.
19337        pub fn by_item(
19338            self,
19339        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19340            crate::model::ListTransitionRouteGroupsResponse,
19341            crate::Error,
19342        > {
19343            use google_cloud_gax::paginator::Paginator;
19344            self.by_page().items()
19345        }
19346
19347        /// Sets the value of [parent][crate::model::ListTransitionRouteGroupsRequest::parent].
19348        ///
19349        /// This is a **required** field for requests.
19350        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19351            self.0.request.parent = v.into();
19352            self
19353        }
19354
19355        /// Sets the value of [page_size][crate::model::ListTransitionRouteGroupsRequest::page_size].
19356        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19357            self.0.request.page_size = v.into();
19358            self
19359        }
19360
19361        /// Sets the value of [page_token][crate::model::ListTransitionRouteGroupsRequest::page_token].
19362        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19363            self.0.request.page_token = v.into();
19364            self
19365        }
19366
19367        /// Sets the value of [language_code][crate::model::ListTransitionRouteGroupsRequest::language_code].
19368        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19369            self.0.request.language_code = v.into();
19370            self
19371        }
19372    }
19373
19374    #[doc(hidden)]
19375    impl crate::RequestBuilder for ListTransitionRouteGroups {
19376        fn request_options(&mut self) -> &mut crate::RequestOptions {
19377            &mut self.0.options
19378        }
19379    }
19380
19381    /// The request builder for [TransitionRouteGroups::get_transition_route_group][crate::client::TransitionRouteGroups::get_transition_route_group] calls.
19382    ///
19383    /// # Example
19384    /// ```
19385    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::GetTransitionRouteGroup;
19386    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19387    ///
19388    /// let builder = prepare_request_builder();
19389    /// let response = builder.send().await?;
19390    /// # Ok(()) }
19391    ///
19392    /// fn prepare_request_builder() -> GetTransitionRouteGroup {
19393    ///   # panic!();
19394    ///   // ... details omitted ...
19395    /// }
19396    /// ```
19397    #[derive(Clone, Debug)]
19398    pub struct GetTransitionRouteGroup(
19399        RequestBuilder<crate::model::GetTransitionRouteGroupRequest>,
19400    );
19401
19402    impl GetTransitionRouteGroup {
19403        pub(crate) fn new(
19404            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19405        ) -> Self {
19406            Self(RequestBuilder::new(stub))
19407        }
19408
19409        /// Sets the full request, replacing any prior values.
19410        pub fn with_request<V: Into<crate::model::GetTransitionRouteGroupRequest>>(
19411            mut self,
19412            v: V,
19413        ) -> Self {
19414            self.0.request = v.into();
19415            self
19416        }
19417
19418        /// Sets all the options, replacing any prior values.
19419        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19420            self.0.options = v.into();
19421            self
19422        }
19423
19424        /// Sends the request.
19425        pub async fn send(self) -> Result<crate::model::TransitionRouteGroup> {
19426            (*self.0.stub)
19427                .get_transition_route_group(self.0.request, self.0.options)
19428                .await
19429                .map(crate::Response::into_body)
19430        }
19431
19432        /// Sets the value of [name][crate::model::GetTransitionRouteGroupRequest::name].
19433        ///
19434        /// This is a **required** field for requests.
19435        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19436            self.0.request.name = v.into();
19437            self
19438        }
19439
19440        /// Sets the value of [language_code][crate::model::GetTransitionRouteGroupRequest::language_code].
19441        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19442            self.0.request.language_code = v.into();
19443            self
19444        }
19445    }
19446
19447    #[doc(hidden)]
19448    impl crate::RequestBuilder for GetTransitionRouteGroup {
19449        fn request_options(&mut self) -> &mut crate::RequestOptions {
19450            &mut self.0.options
19451        }
19452    }
19453
19454    /// The request builder for [TransitionRouteGroups::create_transition_route_group][crate::client::TransitionRouteGroups::create_transition_route_group] calls.
19455    ///
19456    /// # Example
19457    /// ```
19458    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::CreateTransitionRouteGroup;
19459    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19460    ///
19461    /// let builder = prepare_request_builder();
19462    /// let response = builder.send().await?;
19463    /// # Ok(()) }
19464    ///
19465    /// fn prepare_request_builder() -> CreateTransitionRouteGroup {
19466    ///   # panic!();
19467    ///   // ... details omitted ...
19468    /// }
19469    /// ```
19470    #[derive(Clone, Debug)]
19471    pub struct CreateTransitionRouteGroup(
19472        RequestBuilder<crate::model::CreateTransitionRouteGroupRequest>,
19473    );
19474
19475    impl CreateTransitionRouteGroup {
19476        pub(crate) fn new(
19477            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19478        ) -> Self {
19479            Self(RequestBuilder::new(stub))
19480        }
19481
19482        /// Sets the full request, replacing any prior values.
19483        pub fn with_request<V: Into<crate::model::CreateTransitionRouteGroupRequest>>(
19484            mut self,
19485            v: V,
19486        ) -> Self {
19487            self.0.request = v.into();
19488            self
19489        }
19490
19491        /// Sets all the options, replacing any prior values.
19492        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19493            self.0.options = v.into();
19494            self
19495        }
19496
19497        /// Sends the request.
19498        pub async fn send(self) -> Result<crate::model::TransitionRouteGroup> {
19499            (*self.0.stub)
19500                .create_transition_route_group(self.0.request, self.0.options)
19501                .await
19502                .map(crate::Response::into_body)
19503        }
19504
19505        /// Sets the value of [parent][crate::model::CreateTransitionRouteGroupRequest::parent].
19506        ///
19507        /// This is a **required** field for requests.
19508        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19509            self.0.request.parent = v.into();
19510            self
19511        }
19512
19513        /// Sets the value of [transition_route_group][crate::model::CreateTransitionRouteGroupRequest::transition_route_group].
19514        ///
19515        /// This is a **required** field for requests.
19516        pub fn set_transition_route_group<T>(mut self, v: T) -> Self
19517        where
19518            T: std::convert::Into<crate::model::TransitionRouteGroup>,
19519        {
19520            self.0.request.transition_route_group = std::option::Option::Some(v.into());
19521            self
19522        }
19523
19524        /// Sets or clears the value of [transition_route_group][crate::model::CreateTransitionRouteGroupRequest::transition_route_group].
19525        ///
19526        /// This is a **required** field for requests.
19527        pub fn set_or_clear_transition_route_group<T>(mut self, v: std::option::Option<T>) -> Self
19528        where
19529            T: std::convert::Into<crate::model::TransitionRouteGroup>,
19530        {
19531            self.0.request.transition_route_group = v.map(|x| x.into());
19532            self
19533        }
19534
19535        /// Sets the value of [language_code][crate::model::CreateTransitionRouteGroupRequest::language_code].
19536        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19537            self.0.request.language_code = v.into();
19538            self
19539        }
19540    }
19541
19542    #[doc(hidden)]
19543    impl crate::RequestBuilder for CreateTransitionRouteGroup {
19544        fn request_options(&mut self) -> &mut crate::RequestOptions {
19545            &mut self.0.options
19546        }
19547    }
19548
19549    /// The request builder for [TransitionRouteGroups::update_transition_route_group][crate::client::TransitionRouteGroups::update_transition_route_group] calls.
19550    ///
19551    /// # Example
19552    /// ```
19553    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::UpdateTransitionRouteGroup;
19554    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19555    ///
19556    /// let builder = prepare_request_builder();
19557    /// let response = builder.send().await?;
19558    /// # Ok(()) }
19559    ///
19560    /// fn prepare_request_builder() -> UpdateTransitionRouteGroup {
19561    ///   # panic!();
19562    ///   // ... details omitted ...
19563    /// }
19564    /// ```
19565    #[derive(Clone, Debug)]
19566    pub struct UpdateTransitionRouteGroup(
19567        RequestBuilder<crate::model::UpdateTransitionRouteGroupRequest>,
19568    );
19569
19570    impl UpdateTransitionRouteGroup {
19571        pub(crate) fn new(
19572            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19573        ) -> Self {
19574            Self(RequestBuilder::new(stub))
19575        }
19576
19577        /// Sets the full request, replacing any prior values.
19578        pub fn with_request<V: Into<crate::model::UpdateTransitionRouteGroupRequest>>(
19579            mut self,
19580            v: V,
19581        ) -> Self {
19582            self.0.request = v.into();
19583            self
19584        }
19585
19586        /// Sets all the options, replacing any prior values.
19587        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19588            self.0.options = v.into();
19589            self
19590        }
19591
19592        /// Sends the request.
19593        pub async fn send(self) -> Result<crate::model::TransitionRouteGroup> {
19594            (*self.0.stub)
19595                .update_transition_route_group(self.0.request, self.0.options)
19596                .await
19597                .map(crate::Response::into_body)
19598        }
19599
19600        /// Sets the value of [transition_route_group][crate::model::UpdateTransitionRouteGroupRequest::transition_route_group].
19601        ///
19602        /// This is a **required** field for requests.
19603        pub fn set_transition_route_group<T>(mut self, v: T) -> Self
19604        where
19605            T: std::convert::Into<crate::model::TransitionRouteGroup>,
19606        {
19607            self.0.request.transition_route_group = std::option::Option::Some(v.into());
19608            self
19609        }
19610
19611        /// Sets or clears the value of [transition_route_group][crate::model::UpdateTransitionRouteGroupRequest::transition_route_group].
19612        ///
19613        /// This is a **required** field for requests.
19614        pub fn set_or_clear_transition_route_group<T>(mut self, v: std::option::Option<T>) -> Self
19615        where
19616            T: std::convert::Into<crate::model::TransitionRouteGroup>,
19617        {
19618            self.0.request.transition_route_group = v.map(|x| x.into());
19619            self
19620        }
19621
19622        /// Sets the value of [update_mask][crate::model::UpdateTransitionRouteGroupRequest::update_mask].
19623        pub fn set_update_mask<T>(mut self, v: T) -> Self
19624        where
19625            T: std::convert::Into<wkt::FieldMask>,
19626        {
19627            self.0.request.update_mask = std::option::Option::Some(v.into());
19628            self
19629        }
19630
19631        /// Sets or clears the value of [update_mask][crate::model::UpdateTransitionRouteGroupRequest::update_mask].
19632        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19633        where
19634            T: std::convert::Into<wkt::FieldMask>,
19635        {
19636            self.0.request.update_mask = v.map(|x| x.into());
19637            self
19638        }
19639
19640        /// Sets the value of [language_code][crate::model::UpdateTransitionRouteGroupRequest::language_code].
19641        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19642            self.0.request.language_code = v.into();
19643            self
19644        }
19645    }
19646
19647    #[doc(hidden)]
19648    impl crate::RequestBuilder for UpdateTransitionRouteGroup {
19649        fn request_options(&mut self) -> &mut crate::RequestOptions {
19650            &mut self.0.options
19651        }
19652    }
19653
19654    /// The request builder for [TransitionRouteGroups::delete_transition_route_group][crate::client::TransitionRouteGroups::delete_transition_route_group] calls.
19655    ///
19656    /// # Example
19657    /// ```
19658    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::DeleteTransitionRouteGroup;
19659    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19660    ///
19661    /// let builder = prepare_request_builder();
19662    /// let response = builder.send().await?;
19663    /// # Ok(()) }
19664    ///
19665    /// fn prepare_request_builder() -> DeleteTransitionRouteGroup {
19666    ///   # panic!();
19667    ///   // ... details omitted ...
19668    /// }
19669    /// ```
19670    #[derive(Clone, Debug)]
19671    pub struct DeleteTransitionRouteGroup(
19672        RequestBuilder<crate::model::DeleteTransitionRouteGroupRequest>,
19673    );
19674
19675    impl DeleteTransitionRouteGroup {
19676        pub(crate) fn new(
19677            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19678        ) -> Self {
19679            Self(RequestBuilder::new(stub))
19680        }
19681
19682        /// Sets the full request, replacing any prior values.
19683        pub fn with_request<V: Into<crate::model::DeleteTransitionRouteGroupRequest>>(
19684            mut self,
19685            v: V,
19686        ) -> Self {
19687            self.0.request = v.into();
19688            self
19689        }
19690
19691        /// Sets all the options, replacing any prior values.
19692        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19693            self.0.options = v.into();
19694            self
19695        }
19696
19697        /// Sends the request.
19698        pub async fn send(self) -> Result<()> {
19699            (*self.0.stub)
19700                .delete_transition_route_group(self.0.request, self.0.options)
19701                .await
19702                .map(crate::Response::into_body)
19703        }
19704
19705        /// Sets the value of [name][crate::model::DeleteTransitionRouteGroupRequest::name].
19706        ///
19707        /// This is a **required** field for requests.
19708        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19709            self.0.request.name = v.into();
19710            self
19711        }
19712
19713        /// Sets the value of [force][crate::model::DeleteTransitionRouteGroupRequest::force].
19714        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
19715            self.0.request.force = v.into();
19716            self
19717        }
19718    }
19719
19720    #[doc(hidden)]
19721    impl crate::RequestBuilder for DeleteTransitionRouteGroup {
19722        fn request_options(&mut self) -> &mut crate::RequestOptions {
19723            &mut self.0.options
19724        }
19725    }
19726
19727    /// The request builder for [TransitionRouteGroups::list_locations][crate::client::TransitionRouteGroups::list_locations] calls.
19728    ///
19729    /// # Example
19730    /// ```
19731    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::ListLocations;
19732    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19733    /// use google_cloud_gax::paginator::ItemPaginator;
19734    ///
19735    /// let builder = prepare_request_builder();
19736    /// let mut items = builder.by_item();
19737    /// while let Some(result) = items.next().await {
19738    ///   let item = result?;
19739    /// }
19740    /// # Ok(()) }
19741    ///
19742    /// fn prepare_request_builder() -> ListLocations {
19743    ///   # panic!();
19744    ///   // ... details omitted ...
19745    /// }
19746    /// ```
19747    #[derive(Clone, Debug)]
19748    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19749
19750    impl ListLocations {
19751        pub(crate) fn new(
19752            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19753        ) -> Self {
19754            Self(RequestBuilder::new(stub))
19755        }
19756
19757        /// Sets the full request, replacing any prior values.
19758        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19759            mut self,
19760            v: V,
19761        ) -> Self {
19762            self.0.request = v.into();
19763            self
19764        }
19765
19766        /// Sets all the options, replacing any prior values.
19767        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19768            self.0.options = v.into();
19769            self
19770        }
19771
19772        /// Sends the request.
19773        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19774            (*self.0.stub)
19775                .list_locations(self.0.request, self.0.options)
19776                .await
19777                .map(crate::Response::into_body)
19778        }
19779
19780        /// Streams each page in the collection.
19781        pub fn by_page(
19782            self,
19783        ) -> impl google_cloud_gax::paginator::Paginator<
19784            google_cloud_location::model::ListLocationsResponse,
19785            crate::Error,
19786        > {
19787            use std::clone::Clone;
19788            let token = self.0.request.page_token.clone();
19789            let execute = move |token: String| {
19790                let mut builder = self.clone();
19791                builder.0.request = builder.0.request.set_page_token(token);
19792                builder.send()
19793            };
19794            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19795        }
19796
19797        /// Streams each item in the collection.
19798        pub fn by_item(
19799            self,
19800        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19801            google_cloud_location::model::ListLocationsResponse,
19802            crate::Error,
19803        > {
19804            use google_cloud_gax::paginator::Paginator;
19805            self.by_page().items()
19806        }
19807
19808        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
19809        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19810            self.0.request.name = v.into();
19811            self
19812        }
19813
19814        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
19815        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19816            self.0.request.filter = v.into();
19817            self
19818        }
19819
19820        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
19821        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19822            self.0.request.page_size = v.into();
19823            self
19824        }
19825
19826        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
19827        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19828            self.0.request.page_token = v.into();
19829            self
19830        }
19831    }
19832
19833    #[doc(hidden)]
19834    impl crate::RequestBuilder for ListLocations {
19835        fn request_options(&mut self) -> &mut crate::RequestOptions {
19836            &mut self.0.options
19837        }
19838    }
19839
19840    /// The request builder for [TransitionRouteGroups::get_location][crate::client::TransitionRouteGroups::get_location] calls.
19841    ///
19842    /// # Example
19843    /// ```
19844    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::GetLocation;
19845    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19846    ///
19847    /// let builder = prepare_request_builder();
19848    /// let response = builder.send().await?;
19849    /// # Ok(()) }
19850    ///
19851    /// fn prepare_request_builder() -> GetLocation {
19852    ///   # panic!();
19853    ///   // ... details omitted ...
19854    /// }
19855    /// ```
19856    #[derive(Clone, Debug)]
19857    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19858
19859    impl GetLocation {
19860        pub(crate) fn new(
19861            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19862        ) -> Self {
19863            Self(RequestBuilder::new(stub))
19864        }
19865
19866        /// Sets the full request, replacing any prior values.
19867        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19868            mut self,
19869            v: V,
19870        ) -> Self {
19871            self.0.request = v.into();
19872            self
19873        }
19874
19875        /// Sets all the options, replacing any prior values.
19876        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19877            self.0.options = v.into();
19878            self
19879        }
19880
19881        /// Sends the request.
19882        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19883            (*self.0.stub)
19884                .get_location(self.0.request, self.0.options)
19885                .await
19886                .map(crate::Response::into_body)
19887        }
19888
19889        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
19890        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19891            self.0.request.name = v.into();
19892            self
19893        }
19894    }
19895
19896    #[doc(hidden)]
19897    impl crate::RequestBuilder for GetLocation {
19898        fn request_options(&mut self) -> &mut crate::RequestOptions {
19899            &mut self.0.options
19900        }
19901    }
19902
19903    /// The request builder for [TransitionRouteGroups::list_operations][crate::client::TransitionRouteGroups::list_operations] calls.
19904    ///
19905    /// # Example
19906    /// ```
19907    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::ListOperations;
19908    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
19909    /// use google_cloud_gax::paginator::ItemPaginator;
19910    ///
19911    /// let builder = prepare_request_builder();
19912    /// let mut items = builder.by_item();
19913    /// while let Some(result) = items.next().await {
19914    ///   let item = result?;
19915    /// }
19916    /// # Ok(()) }
19917    ///
19918    /// fn prepare_request_builder() -> ListOperations {
19919    ///   # panic!();
19920    ///   // ... details omitted ...
19921    /// }
19922    /// ```
19923    #[derive(Clone, Debug)]
19924    pub struct ListOperations(
19925        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19926    );
19927
19928    impl ListOperations {
19929        pub(crate) fn new(
19930            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19931        ) -> Self {
19932            Self(RequestBuilder::new(stub))
19933        }
19934
19935        /// Sets the full request, replacing any prior values.
19936        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19937            mut self,
19938            v: V,
19939        ) -> Self {
19940            self.0.request = v.into();
19941            self
19942        }
19943
19944        /// Sets all the options, replacing any prior values.
19945        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19946            self.0.options = v.into();
19947            self
19948        }
19949
19950        /// Sends the request.
19951        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19952            (*self.0.stub)
19953                .list_operations(self.0.request, self.0.options)
19954                .await
19955                .map(crate::Response::into_body)
19956        }
19957
19958        /// Streams each page in the collection.
19959        pub fn by_page(
19960            self,
19961        ) -> impl google_cloud_gax::paginator::Paginator<
19962            google_cloud_longrunning::model::ListOperationsResponse,
19963            crate::Error,
19964        > {
19965            use std::clone::Clone;
19966            let token = self.0.request.page_token.clone();
19967            let execute = move |token: String| {
19968                let mut builder = self.clone();
19969                builder.0.request = builder.0.request.set_page_token(token);
19970                builder.send()
19971            };
19972            google_cloud_gax::paginator::internal::new_paginator(token, execute)
19973        }
19974
19975        /// Streams each item in the collection.
19976        pub fn by_item(
19977            self,
19978        ) -> impl google_cloud_gax::paginator::ItemPaginator<
19979            google_cloud_longrunning::model::ListOperationsResponse,
19980            crate::Error,
19981        > {
19982            use google_cloud_gax::paginator::Paginator;
19983            self.by_page().items()
19984        }
19985
19986        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
19987        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19988            self.0.request.name = v.into();
19989            self
19990        }
19991
19992        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
19993        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19994            self.0.request.filter = v.into();
19995            self
19996        }
19997
19998        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
19999        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20000            self.0.request.page_size = v.into();
20001            self
20002        }
20003
20004        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
20005        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20006            self.0.request.page_token = v.into();
20007            self
20008        }
20009
20010        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
20011        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20012            self.0.request.return_partial_success = v.into();
20013            self
20014        }
20015    }
20016
20017    #[doc(hidden)]
20018    impl crate::RequestBuilder for ListOperations {
20019        fn request_options(&mut self) -> &mut crate::RequestOptions {
20020            &mut self.0.options
20021        }
20022    }
20023
20024    /// The request builder for [TransitionRouteGroups::get_operation][crate::client::TransitionRouteGroups::get_operation] calls.
20025    ///
20026    /// # Example
20027    /// ```
20028    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::GetOperation;
20029    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20030    ///
20031    /// let builder = prepare_request_builder();
20032    /// let response = builder.send().await?;
20033    /// # Ok(()) }
20034    ///
20035    /// fn prepare_request_builder() -> GetOperation {
20036    ///   # panic!();
20037    ///   // ... details omitted ...
20038    /// }
20039    /// ```
20040    #[derive(Clone, Debug)]
20041    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20042
20043    impl GetOperation {
20044        pub(crate) fn new(
20045            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
20046        ) -> Self {
20047            Self(RequestBuilder::new(stub))
20048        }
20049
20050        /// Sets the full request, replacing any prior values.
20051        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20052            mut self,
20053            v: V,
20054        ) -> Self {
20055            self.0.request = v.into();
20056            self
20057        }
20058
20059        /// Sets all the options, replacing any prior values.
20060        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20061            self.0.options = v.into();
20062            self
20063        }
20064
20065        /// Sends the request.
20066        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20067            (*self.0.stub)
20068                .get_operation(self.0.request, self.0.options)
20069                .await
20070                .map(crate::Response::into_body)
20071        }
20072
20073        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
20074        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20075            self.0.request.name = v.into();
20076            self
20077        }
20078    }
20079
20080    #[doc(hidden)]
20081    impl crate::RequestBuilder for GetOperation {
20082        fn request_options(&mut self) -> &mut crate::RequestOptions {
20083            &mut self.0.options
20084        }
20085    }
20086
20087    /// The request builder for [TransitionRouteGroups::cancel_operation][crate::client::TransitionRouteGroups::cancel_operation] calls.
20088    ///
20089    /// # Example
20090    /// ```
20091    /// # use google_cloud_dialogflow_cx_v3::builder::transition_route_groups::CancelOperation;
20092    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20093    ///
20094    /// let builder = prepare_request_builder();
20095    /// let response = builder.send().await?;
20096    /// # Ok(()) }
20097    ///
20098    /// fn prepare_request_builder() -> CancelOperation {
20099    ///   # panic!();
20100    ///   // ... details omitted ...
20101    /// }
20102    /// ```
20103    #[derive(Clone, Debug)]
20104    pub struct CancelOperation(
20105        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20106    );
20107
20108    impl CancelOperation {
20109        pub(crate) fn new(
20110            stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
20111        ) -> Self {
20112            Self(RequestBuilder::new(stub))
20113        }
20114
20115        /// Sets the full request, replacing any prior values.
20116        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20117            mut self,
20118            v: V,
20119        ) -> Self {
20120            self.0.request = v.into();
20121            self
20122        }
20123
20124        /// Sets all the options, replacing any prior values.
20125        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20126            self.0.options = v.into();
20127            self
20128        }
20129
20130        /// Sends the request.
20131        pub async fn send(self) -> Result<()> {
20132            (*self.0.stub)
20133                .cancel_operation(self.0.request, self.0.options)
20134                .await
20135                .map(crate::Response::into_body)
20136        }
20137
20138        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
20139        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20140            self.0.request.name = v.into();
20141            self
20142        }
20143    }
20144
20145    #[doc(hidden)]
20146    impl crate::RequestBuilder for CancelOperation {
20147        fn request_options(&mut self) -> &mut crate::RequestOptions {
20148            &mut self.0.options
20149        }
20150    }
20151}
20152
20153/// Request and client builders for [Versions][crate::client::Versions].
20154#[cfg(feature = "versions")]
20155#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
20156pub mod versions {
20157    use crate::Result;
20158
20159    /// A builder for [Versions][crate::client::Versions].
20160    ///
20161    /// ```
20162    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
20163    /// # use google_cloud_dialogflow_cx_v3::*;
20164    /// # use builder::versions::ClientBuilder;
20165    /// # use client::Versions;
20166    /// let builder : ClientBuilder = Versions::builder();
20167    /// let client = builder
20168    ///     .with_endpoint("https://dialogflow.googleapis.com")
20169    ///     .build().await?;
20170    /// # Ok(()) }
20171    /// ```
20172    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20173
20174    pub(crate) mod client {
20175        use super::super::super::client::Versions;
20176        pub struct Factory;
20177        impl crate::ClientFactory for Factory {
20178            type Client = Versions;
20179            type Credentials = gaxi::options::Credentials;
20180            async fn build(
20181                self,
20182                config: gaxi::options::ClientConfig,
20183            ) -> crate::ClientBuilderResult<Self::Client> {
20184                Self::Client::new(config).await
20185            }
20186        }
20187    }
20188
20189    /// Common implementation for [crate::client::Versions] request builders.
20190    #[derive(Clone, Debug)]
20191    pub(crate) struct RequestBuilder<R: std::default::Default> {
20192        stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
20193        request: R,
20194        options: crate::RequestOptions,
20195    }
20196
20197    impl<R> RequestBuilder<R>
20198    where
20199        R: std::default::Default,
20200    {
20201        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20202            Self {
20203                stub,
20204                request: R::default(),
20205                options: crate::RequestOptions::default(),
20206            }
20207        }
20208    }
20209
20210    /// The request builder for [Versions::list_versions][crate::client::Versions::list_versions] calls.
20211    ///
20212    /// # Example
20213    /// ```
20214    /// # use google_cloud_dialogflow_cx_v3::builder::versions::ListVersions;
20215    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20216    /// use google_cloud_gax::paginator::ItemPaginator;
20217    ///
20218    /// let builder = prepare_request_builder();
20219    /// let mut items = builder.by_item();
20220    /// while let Some(result) = items.next().await {
20221    ///   let item = result?;
20222    /// }
20223    /// # Ok(()) }
20224    ///
20225    /// fn prepare_request_builder() -> ListVersions {
20226    ///   # panic!();
20227    ///   // ... details omitted ...
20228    /// }
20229    /// ```
20230    #[derive(Clone, Debug)]
20231    pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
20232
20233    impl ListVersions {
20234        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20235            Self(RequestBuilder::new(stub))
20236        }
20237
20238        /// Sets the full request, replacing any prior values.
20239        pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
20240            self.0.request = v.into();
20241            self
20242        }
20243
20244        /// Sets all the options, replacing any prior values.
20245        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20246            self.0.options = v.into();
20247            self
20248        }
20249
20250        /// Sends the request.
20251        pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
20252            (*self.0.stub)
20253                .list_versions(self.0.request, self.0.options)
20254                .await
20255                .map(crate::Response::into_body)
20256        }
20257
20258        /// Streams each page in the collection.
20259        pub fn by_page(
20260            self,
20261        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
20262        {
20263            use std::clone::Clone;
20264            let token = self.0.request.page_token.clone();
20265            let execute = move |token: String| {
20266                let mut builder = self.clone();
20267                builder.0.request = builder.0.request.set_page_token(token);
20268                builder.send()
20269            };
20270            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20271        }
20272
20273        /// Streams each item in the collection.
20274        pub fn by_item(
20275            self,
20276        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20277            crate::model::ListVersionsResponse,
20278            crate::Error,
20279        > {
20280            use google_cloud_gax::paginator::Paginator;
20281            self.by_page().items()
20282        }
20283
20284        /// Sets the value of [parent][crate::model::ListVersionsRequest::parent].
20285        ///
20286        /// This is a **required** field for requests.
20287        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20288            self.0.request.parent = v.into();
20289            self
20290        }
20291
20292        /// Sets the value of [page_size][crate::model::ListVersionsRequest::page_size].
20293        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20294            self.0.request.page_size = v.into();
20295            self
20296        }
20297
20298        /// Sets the value of [page_token][crate::model::ListVersionsRequest::page_token].
20299        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20300            self.0.request.page_token = v.into();
20301            self
20302        }
20303    }
20304
20305    #[doc(hidden)]
20306    impl crate::RequestBuilder for ListVersions {
20307        fn request_options(&mut self) -> &mut crate::RequestOptions {
20308            &mut self.0.options
20309        }
20310    }
20311
20312    /// The request builder for [Versions::get_version][crate::client::Versions::get_version] calls.
20313    ///
20314    /// # Example
20315    /// ```
20316    /// # use google_cloud_dialogflow_cx_v3::builder::versions::GetVersion;
20317    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20318    ///
20319    /// let builder = prepare_request_builder();
20320    /// let response = builder.send().await?;
20321    /// # Ok(()) }
20322    ///
20323    /// fn prepare_request_builder() -> GetVersion {
20324    ///   # panic!();
20325    ///   // ... details omitted ...
20326    /// }
20327    /// ```
20328    #[derive(Clone, Debug)]
20329    pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
20330
20331    impl GetVersion {
20332        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20333            Self(RequestBuilder::new(stub))
20334        }
20335
20336        /// Sets the full request, replacing any prior values.
20337        pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
20338            self.0.request = v.into();
20339            self
20340        }
20341
20342        /// Sets all the options, replacing any prior values.
20343        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20344            self.0.options = v.into();
20345            self
20346        }
20347
20348        /// Sends the request.
20349        pub async fn send(self) -> Result<crate::model::Version> {
20350            (*self.0.stub)
20351                .get_version(self.0.request, self.0.options)
20352                .await
20353                .map(crate::Response::into_body)
20354        }
20355
20356        /// Sets the value of [name][crate::model::GetVersionRequest::name].
20357        ///
20358        /// This is a **required** field for requests.
20359        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20360            self.0.request.name = v.into();
20361            self
20362        }
20363    }
20364
20365    #[doc(hidden)]
20366    impl crate::RequestBuilder for GetVersion {
20367        fn request_options(&mut self) -> &mut crate::RequestOptions {
20368            &mut self.0.options
20369        }
20370    }
20371
20372    /// The request builder for [Versions::create_version][crate::client::Versions::create_version] calls.
20373    ///
20374    /// # Example
20375    /// ```
20376    /// # use google_cloud_dialogflow_cx_v3::builder::versions::CreateVersion;
20377    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20378    /// use google_cloud_lro::Poller;
20379    ///
20380    /// let builder = prepare_request_builder();
20381    /// let response = builder.poller().until_done().await?;
20382    /// # Ok(()) }
20383    ///
20384    /// fn prepare_request_builder() -> CreateVersion {
20385    ///   # panic!();
20386    ///   // ... details omitted ...
20387    /// }
20388    /// ```
20389    #[derive(Clone, Debug)]
20390    pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
20391
20392    impl CreateVersion {
20393        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20394            Self(RequestBuilder::new(stub))
20395        }
20396
20397        /// Sets the full request, replacing any prior values.
20398        pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
20399            self.0.request = v.into();
20400            self
20401        }
20402
20403        /// Sets all the options, replacing any prior values.
20404        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20405            self.0.options = v.into();
20406            self
20407        }
20408
20409        /// Sends the request.
20410        ///
20411        /// # Long running operations
20412        ///
20413        /// This starts, but does not poll, a longrunning operation. More information
20414        /// on [create_version][crate::client::Versions::create_version].
20415        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20416            (*self.0.stub)
20417                .create_version(self.0.request, self.0.options)
20418                .await
20419                .map(crate::Response::into_body)
20420        }
20421
20422        /// Creates a [Poller][google_cloud_lro::Poller] to work with `create_version`.
20423        pub fn poller(
20424            self,
20425        ) -> impl google_cloud_lro::Poller<
20426            crate::model::Version,
20427            crate::model::CreateVersionOperationMetadata,
20428        > {
20429            type Operation = google_cloud_lro::internal::Operation<
20430                crate::model::Version,
20431                crate::model::CreateVersionOperationMetadata,
20432            >;
20433            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20434            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20435
20436            let stub = self.0.stub.clone();
20437            let mut options = self.0.options.clone();
20438            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20439            let query = move |name| {
20440                let stub = stub.clone();
20441                let options = options.clone();
20442                async {
20443                    let op = GetOperation::new(stub)
20444                        .set_name(name)
20445                        .with_options(options)
20446                        .send()
20447                        .await?;
20448                    Ok(Operation::new(op))
20449                }
20450            };
20451
20452            let start = move || async {
20453                let op = self.send().await?;
20454                Ok(Operation::new(op))
20455            };
20456
20457            google_cloud_lro::internal::new_poller(
20458                polling_error_policy,
20459                polling_backoff_policy,
20460                start,
20461                query,
20462            )
20463        }
20464
20465        /// Sets the value of [parent][crate::model::CreateVersionRequest::parent].
20466        ///
20467        /// This is a **required** field for requests.
20468        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20469            self.0.request.parent = v.into();
20470            self
20471        }
20472
20473        /// Sets the value of [version][crate::model::CreateVersionRequest::version].
20474        ///
20475        /// This is a **required** field for requests.
20476        pub fn set_version<T>(mut self, v: T) -> Self
20477        where
20478            T: std::convert::Into<crate::model::Version>,
20479        {
20480            self.0.request.version = std::option::Option::Some(v.into());
20481            self
20482        }
20483
20484        /// Sets or clears the value of [version][crate::model::CreateVersionRequest::version].
20485        ///
20486        /// This is a **required** field for requests.
20487        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
20488        where
20489            T: std::convert::Into<crate::model::Version>,
20490        {
20491            self.0.request.version = v.map(|x| x.into());
20492            self
20493        }
20494    }
20495
20496    #[doc(hidden)]
20497    impl crate::RequestBuilder for CreateVersion {
20498        fn request_options(&mut self) -> &mut crate::RequestOptions {
20499            &mut self.0.options
20500        }
20501    }
20502
20503    /// The request builder for [Versions::update_version][crate::client::Versions::update_version] calls.
20504    ///
20505    /// # Example
20506    /// ```
20507    /// # use google_cloud_dialogflow_cx_v3::builder::versions::UpdateVersion;
20508    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20509    ///
20510    /// let builder = prepare_request_builder();
20511    /// let response = builder.send().await?;
20512    /// # Ok(()) }
20513    ///
20514    /// fn prepare_request_builder() -> UpdateVersion {
20515    ///   # panic!();
20516    ///   // ... details omitted ...
20517    /// }
20518    /// ```
20519    #[derive(Clone, Debug)]
20520    pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
20521
20522    impl UpdateVersion {
20523        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20524            Self(RequestBuilder::new(stub))
20525        }
20526
20527        /// Sets the full request, replacing any prior values.
20528        pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
20529            self.0.request = v.into();
20530            self
20531        }
20532
20533        /// Sets all the options, replacing any prior values.
20534        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20535            self.0.options = v.into();
20536            self
20537        }
20538
20539        /// Sends the request.
20540        pub async fn send(self) -> Result<crate::model::Version> {
20541            (*self.0.stub)
20542                .update_version(self.0.request, self.0.options)
20543                .await
20544                .map(crate::Response::into_body)
20545        }
20546
20547        /// Sets the value of [version][crate::model::UpdateVersionRequest::version].
20548        ///
20549        /// This is a **required** field for requests.
20550        pub fn set_version<T>(mut self, v: T) -> Self
20551        where
20552            T: std::convert::Into<crate::model::Version>,
20553        {
20554            self.0.request.version = std::option::Option::Some(v.into());
20555            self
20556        }
20557
20558        /// Sets or clears the value of [version][crate::model::UpdateVersionRequest::version].
20559        ///
20560        /// This is a **required** field for requests.
20561        pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
20562        where
20563            T: std::convert::Into<crate::model::Version>,
20564        {
20565            self.0.request.version = v.map(|x| x.into());
20566            self
20567        }
20568
20569        /// Sets the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
20570        ///
20571        /// This is a **required** field for requests.
20572        pub fn set_update_mask<T>(mut self, v: T) -> Self
20573        where
20574            T: std::convert::Into<wkt::FieldMask>,
20575        {
20576            self.0.request.update_mask = std::option::Option::Some(v.into());
20577            self
20578        }
20579
20580        /// Sets or clears the value of [update_mask][crate::model::UpdateVersionRequest::update_mask].
20581        ///
20582        /// This is a **required** field for requests.
20583        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20584        where
20585            T: std::convert::Into<wkt::FieldMask>,
20586        {
20587            self.0.request.update_mask = v.map(|x| x.into());
20588            self
20589        }
20590    }
20591
20592    #[doc(hidden)]
20593    impl crate::RequestBuilder for UpdateVersion {
20594        fn request_options(&mut self) -> &mut crate::RequestOptions {
20595            &mut self.0.options
20596        }
20597    }
20598
20599    /// The request builder for [Versions::delete_version][crate::client::Versions::delete_version] calls.
20600    ///
20601    /// # Example
20602    /// ```
20603    /// # use google_cloud_dialogflow_cx_v3::builder::versions::DeleteVersion;
20604    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20605    ///
20606    /// let builder = prepare_request_builder();
20607    /// let response = builder.send().await?;
20608    /// # Ok(()) }
20609    ///
20610    /// fn prepare_request_builder() -> DeleteVersion {
20611    ///   # panic!();
20612    ///   // ... details omitted ...
20613    /// }
20614    /// ```
20615    #[derive(Clone, Debug)]
20616    pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
20617
20618    impl DeleteVersion {
20619        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20620            Self(RequestBuilder::new(stub))
20621        }
20622
20623        /// Sets the full request, replacing any prior values.
20624        pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
20625            self.0.request = v.into();
20626            self
20627        }
20628
20629        /// Sets all the options, replacing any prior values.
20630        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20631            self.0.options = v.into();
20632            self
20633        }
20634
20635        /// Sends the request.
20636        pub async fn send(self) -> Result<()> {
20637            (*self.0.stub)
20638                .delete_version(self.0.request, self.0.options)
20639                .await
20640                .map(crate::Response::into_body)
20641        }
20642
20643        /// Sets the value of [name][crate::model::DeleteVersionRequest::name].
20644        ///
20645        /// This is a **required** field for requests.
20646        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20647            self.0.request.name = v.into();
20648            self
20649        }
20650    }
20651
20652    #[doc(hidden)]
20653    impl crate::RequestBuilder for DeleteVersion {
20654        fn request_options(&mut self) -> &mut crate::RequestOptions {
20655            &mut self.0.options
20656        }
20657    }
20658
20659    /// The request builder for [Versions::load_version][crate::client::Versions::load_version] calls.
20660    ///
20661    /// # Example
20662    /// ```
20663    /// # use google_cloud_dialogflow_cx_v3::builder::versions::LoadVersion;
20664    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20665    /// use google_cloud_lro::Poller;
20666    ///
20667    /// let builder = prepare_request_builder();
20668    /// let response = builder.poller().until_done().await?;
20669    /// # Ok(()) }
20670    ///
20671    /// fn prepare_request_builder() -> LoadVersion {
20672    ///   # panic!();
20673    ///   // ... details omitted ...
20674    /// }
20675    /// ```
20676    #[derive(Clone, Debug)]
20677    pub struct LoadVersion(RequestBuilder<crate::model::LoadVersionRequest>);
20678
20679    impl LoadVersion {
20680        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20681            Self(RequestBuilder::new(stub))
20682        }
20683
20684        /// Sets the full request, replacing any prior values.
20685        pub fn with_request<V: Into<crate::model::LoadVersionRequest>>(mut self, v: V) -> Self {
20686            self.0.request = v.into();
20687            self
20688        }
20689
20690        /// Sets all the options, replacing any prior values.
20691        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20692            self.0.options = v.into();
20693            self
20694        }
20695
20696        /// Sends the request.
20697        ///
20698        /// # Long running operations
20699        ///
20700        /// This starts, but does not poll, a longrunning operation. More information
20701        /// on [load_version][crate::client::Versions::load_version].
20702        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20703            (*self.0.stub)
20704                .load_version(self.0.request, self.0.options)
20705                .await
20706                .map(crate::Response::into_body)
20707        }
20708
20709        /// Creates a [Poller][google_cloud_lro::Poller] to work with `load_version`.
20710        pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
20711            type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
20712            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20713            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20714
20715            let stub = self.0.stub.clone();
20716            let mut options = self.0.options.clone();
20717            options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20718            let query = move |name| {
20719                let stub = stub.clone();
20720                let options = options.clone();
20721                async {
20722                    let op = GetOperation::new(stub)
20723                        .set_name(name)
20724                        .with_options(options)
20725                        .send()
20726                        .await?;
20727                    Ok(Operation::new(op))
20728                }
20729            };
20730
20731            let start = move || async {
20732                let op = self.send().await?;
20733                Ok(Operation::new(op))
20734            };
20735
20736            google_cloud_lro::internal::new_unit_response_poller(
20737                polling_error_policy,
20738                polling_backoff_policy,
20739                start,
20740                query,
20741            )
20742        }
20743
20744        /// Sets the value of [name][crate::model::LoadVersionRequest::name].
20745        ///
20746        /// This is a **required** field for requests.
20747        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20748            self.0.request.name = v.into();
20749            self
20750        }
20751
20752        /// Sets the value of [allow_override_agent_resources][crate::model::LoadVersionRequest::allow_override_agent_resources].
20753        pub fn set_allow_override_agent_resources<T: Into<bool>>(mut self, v: T) -> Self {
20754            self.0.request.allow_override_agent_resources = v.into();
20755            self
20756        }
20757    }
20758
20759    #[doc(hidden)]
20760    impl crate::RequestBuilder for LoadVersion {
20761        fn request_options(&mut self) -> &mut crate::RequestOptions {
20762            &mut self.0.options
20763        }
20764    }
20765
20766    /// The request builder for [Versions::compare_versions][crate::client::Versions::compare_versions] calls.
20767    ///
20768    /// # Example
20769    /// ```
20770    /// # use google_cloud_dialogflow_cx_v3::builder::versions::CompareVersions;
20771    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20772    ///
20773    /// let builder = prepare_request_builder();
20774    /// let response = builder.send().await?;
20775    /// # Ok(()) }
20776    ///
20777    /// fn prepare_request_builder() -> CompareVersions {
20778    ///   # panic!();
20779    ///   // ... details omitted ...
20780    /// }
20781    /// ```
20782    #[derive(Clone, Debug)]
20783    pub struct CompareVersions(RequestBuilder<crate::model::CompareVersionsRequest>);
20784
20785    impl CompareVersions {
20786        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20787            Self(RequestBuilder::new(stub))
20788        }
20789
20790        /// Sets the full request, replacing any prior values.
20791        pub fn with_request<V: Into<crate::model::CompareVersionsRequest>>(mut self, v: V) -> Self {
20792            self.0.request = v.into();
20793            self
20794        }
20795
20796        /// Sets all the options, replacing any prior values.
20797        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20798            self.0.options = v.into();
20799            self
20800        }
20801
20802        /// Sends the request.
20803        pub async fn send(self) -> Result<crate::model::CompareVersionsResponse> {
20804            (*self.0.stub)
20805                .compare_versions(self.0.request, self.0.options)
20806                .await
20807                .map(crate::Response::into_body)
20808        }
20809
20810        /// Sets the value of [base_version][crate::model::CompareVersionsRequest::base_version].
20811        ///
20812        /// This is a **required** field for requests.
20813        pub fn set_base_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
20814            self.0.request.base_version = v.into();
20815            self
20816        }
20817
20818        /// Sets the value of [target_version][crate::model::CompareVersionsRequest::target_version].
20819        ///
20820        /// This is a **required** field for requests.
20821        pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
20822            self.0.request.target_version = v.into();
20823            self
20824        }
20825
20826        /// Sets the value of [language_code][crate::model::CompareVersionsRequest::language_code].
20827        pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
20828            self.0.request.language_code = v.into();
20829            self
20830        }
20831    }
20832
20833    #[doc(hidden)]
20834    impl crate::RequestBuilder for CompareVersions {
20835        fn request_options(&mut self) -> &mut crate::RequestOptions {
20836            &mut self.0.options
20837        }
20838    }
20839
20840    /// The request builder for [Versions::list_locations][crate::client::Versions::list_locations] calls.
20841    ///
20842    /// # Example
20843    /// ```
20844    /// # use google_cloud_dialogflow_cx_v3::builder::versions::ListLocations;
20845    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20846    /// use google_cloud_gax::paginator::ItemPaginator;
20847    ///
20848    /// let builder = prepare_request_builder();
20849    /// let mut items = builder.by_item();
20850    /// while let Some(result) = items.next().await {
20851    ///   let item = result?;
20852    /// }
20853    /// # Ok(()) }
20854    ///
20855    /// fn prepare_request_builder() -> ListLocations {
20856    ///   # panic!();
20857    ///   // ... details omitted ...
20858    /// }
20859    /// ```
20860    #[derive(Clone, Debug)]
20861    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20862
20863    impl ListLocations {
20864        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20865            Self(RequestBuilder::new(stub))
20866        }
20867
20868        /// Sets the full request, replacing any prior values.
20869        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20870            mut self,
20871            v: V,
20872        ) -> Self {
20873            self.0.request = v.into();
20874            self
20875        }
20876
20877        /// Sets all the options, replacing any prior values.
20878        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20879            self.0.options = v.into();
20880            self
20881        }
20882
20883        /// Sends the request.
20884        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20885            (*self.0.stub)
20886                .list_locations(self.0.request, self.0.options)
20887                .await
20888                .map(crate::Response::into_body)
20889        }
20890
20891        /// Streams each page in the collection.
20892        pub fn by_page(
20893            self,
20894        ) -> impl google_cloud_gax::paginator::Paginator<
20895            google_cloud_location::model::ListLocationsResponse,
20896            crate::Error,
20897        > {
20898            use std::clone::Clone;
20899            let token = self.0.request.page_token.clone();
20900            let execute = move |token: String| {
20901                let mut builder = self.clone();
20902                builder.0.request = builder.0.request.set_page_token(token);
20903                builder.send()
20904            };
20905            google_cloud_gax::paginator::internal::new_paginator(token, execute)
20906        }
20907
20908        /// Streams each item in the collection.
20909        pub fn by_item(
20910            self,
20911        ) -> impl google_cloud_gax::paginator::ItemPaginator<
20912            google_cloud_location::model::ListLocationsResponse,
20913            crate::Error,
20914        > {
20915            use google_cloud_gax::paginator::Paginator;
20916            self.by_page().items()
20917        }
20918
20919        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
20920        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20921            self.0.request.name = v.into();
20922            self
20923        }
20924
20925        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
20926        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20927            self.0.request.filter = v.into();
20928            self
20929        }
20930
20931        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
20932        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20933            self.0.request.page_size = v.into();
20934            self
20935        }
20936
20937        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
20938        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20939            self.0.request.page_token = v.into();
20940            self
20941        }
20942    }
20943
20944    #[doc(hidden)]
20945    impl crate::RequestBuilder for ListLocations {
20946        fn request_options(&mut self) -> &mut crate::RequestOptions {
20947            &mut self.0.options
20948        }
20949    }
20950
20951    /// The request builder for [Versions::get_location][crate::client::Versions::get_location] calls.
20952    ///
20953    /// # Example
20954    /// ```
20955    /// # use google_cloud_dialogflow_cx_v3::builder::versions::GetLocation;
20956    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
20957    ///
20958    /// let builder = prepare_request_builder();
20959    /// let response = builder.send().await?;
20960    /// # Ok(()) }
20961    ///
20962    /// fn prepare_request_builder() -> GetLocation {
20963    ///   # panic!();
20964    ///   // ... details omitted ...
20965    /// }
20966    /// ```
20967    #[derive(Clone, Debug)]
20968    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20969
20970    impl GetLocation {
20971        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20972            Self(RequestBuilder::new(stub))
20973        }
20974
20975        /// Sets the full request, replacing any prior values.
20976        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20977            mut self,
20978            v: V,
20979        ) -> Self {
20980            self.0.request = v.into();
20981            self
20982        }
20983
20984        /// Sets all the options, replacing any prior values.
20985        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20986            self.0.options = v.into();
20987            self
20988        }
20989
20990        /// Sends the request.
20991        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20992            (*self.0.stub)
20993                .get_location(self.0.request, self.0.options)
20994                .await
20995                .map(crate::Response::into_body)
20996        }
20997
20998        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
20999        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21000            self.0.request.name = v.into();
21001            self
21002        }
21003    }
21004
21005    #[doc(hidden)]
21006    impl crate::RequestBuilder for GetLocation {
21007        fn request_options(&mut self) -> &mut crate::RequestOptions {
21008            &mut self.0.options
21009        }
21010    }
21011
21012    /// The request builder for [Versions::list_operations][crate::client::Versions::list_operations] calls.
21013    ///
21014    /// # Example
21015    /// ```
21016    /// # use google_cloud_dialogflow_cx_v3::builder::versions::ListOperations;
21017    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21018    /// use google_cloud_gax::paginator::ItemPaginator;
21019    ///
21020    /// let builder = prepare_request_builder();
21021    /// let mut items = builder.by_item();
21022    /// while let Some(result) = items.next().await {
21023    ///   let item = result?;
21024    /// }
21025    /// # Ok(()) }
21026    ///
21027    /// fn prepare_request_builder() -> ListOperations {
21028    ///   # panic!();
21029    ///   // ... details omitted ...
21030    /// }
21031    /// ```
21032    #[derive(Clone, Debug)]
21033    pub struct ListOperations(
21034        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21035    );
21036
21037    impl ListOperations {
21038        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
21039            Self(RequestBuilder::new(stub))
21040        }
21041
21042        /// Sets the full request, replacing any prior values.
21043        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21044            mut self,
21045            v: V,
21046        ) -> Self {
21047            self.0.request = v.into();
21048            self
21049        }
21050
21051        /// Sets all the options, replacing any prior values.
21052        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21053            self.0.options = v.into();
21054            self
21055        }
21056
21057        /// Sends the request.
21058        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21059            (*self.0.stub)
21060                .list_operations(self.0.request, self.0.options)
21061                .await
21062                .map(crate::Response::into_body)
21063        }
21064
21065        /// Streams each page in the collection.
21066        pub fn by_page(
21067            self,
21068        ) -> impl google_cloud_gax::paginator::Paginator<
21069            google_cloud_longrunning::model::ListOperationsResponse,
21070            crate::Error,
21071        > {
21072            use std::clone::Clone;
21073            let token = self.0.request.page_token.clone();
21074            let execute = move |token: String| {
21075                let mut builder = self.clone();
21076                builder.0.request = builder.0.request.set_page_token(token);
21077                builder.send()
21078            };
21079            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21080        }
21081
21082        /// Streams each item in the collection.
21083        pub fn by_item(
21084            self,
21085        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21086            google_cloud_longrunning::model::ListOperationsResponse,
21087            crate::Error,
21088        > {
21089            use google_cloud_gax::paginator::Paginator;
21090            self.by_page().items()
21091        }
21092
21093        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21094        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21095            self.0.request.name = v.into();
21096            self
21097        }
21098
21099        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21100        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21101            self.0.request.filter = v.into();
21102            self
21103        }
21104
21105        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21106        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21107            self.0.request.page_size = v.into();
21108            self
21109        }
21110
21111        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21112        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21113            self.0.request.page_token = v.into();
21114            self
21115        }
21116
21117        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21118        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21119            self.0.request.return_partial_success = v.into();
21120            self
21121        }
21122    }
21123
21124    #[doc(hidden)]
21125    impl crate::RequestBuilder for ListOperations {
21126        fn request_options(&mut self) -> &mut crate::RequestOptions {
21127            &mut self.0.options
21128        }
21129    }
21130
21131    /// The request builder for [Versions::get_operation][crate::client::Versions::get_operation] calls.
21132    ///
21133    /// # Example
21134    /// ```
21135    /// # use google_cloud_dialogflow_cx_v3::builder::versions::GetOperation;
21136    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21137    ///
21138    /// let builder = prepare_request_builder();
21139    /// let response = builder.send().await?;
21140    /// # Ok(()) }
21141    ///
21142    /// fn prepare_request_builder() -> GetOperation {
21143    ///   # panic!();
21144    ///   // ... details omitted ...
21145    /// }
21146    /// ```
21147    #[derive(Clone, Debug)]
21148    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21149
21150    impl GetOperation {
21151        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
21152            Self(RequestBuilder::new(stub))
21153        }
21154
21155        /// Sets the full request, replacing any prior values.
21156        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21157            mut self,
21158            v: V,
21159        ) -> Self {
21160            self.0.request = v.into();
21161            self
21162        }
21163
21164        /// Sets all the options, replacing any prior values.
21165        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21166            self.0.options = v.into();
21167            self
21168        }
21169
21170        /// Sends the request.
21171        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21172            (*self.0.stub)
21173                .get_operation(self.0.request, self.0.options)
21174                .await
21175                .map(crate::Response::into_body)
21176        }
21177
21178        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
21179        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21180            self.0.request.name = v.into();
21181            self
21182        }
21183    }
21184
21185    #[doc(hidden)]
21186    impl crate::RequestBuilder for GetOperation {
21187        fn request_options(&mut self) -> &mut crate::RequestOptions {
21188            &mut self.0.options
21189        }
21190    }
21191
21192    /// The request builder for [Versions::cancel_operation][crate::client::Versions::cancel_operation] calls.
21193    ///
21194    /// # Example
21195    /// ```
21196    /// # use google_cloud_dialogflow_cx_v3::builder::versions::CancelOperation;
21197    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21198    ///
21199    /// let builder = prepare_request_builder();
21200    /// let response = builder.send().await?;
21201    /// # Ok(()) }
21202    ///
21203    /// fn prepare_request_builder() -> CancelOperation {
21204    ///   # panic!();
21205    ///   // ... details omitted ...
21206    /// }
21207    /// ```
21208    #[derive(Clone, Debug)]
21209    pub struct CancelOperation(
21210        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21211    );
21212
21213    impl CancelOperation {
21214        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
21215            Self(RequestBuilder::new(stub))
21216        }
21217
21218        /// Sets the full request, replacing any prior values.
21219        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21220            mut self,
21221            v: V,
21222        ) -> Self {
21223            self.0.request = v.into();
21224            self
21225        }
21226
21227        /// Sets all the options, replacing any prior values.
21228        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21229            self.0.options = v.into();
21230            self
21231        }
21232
21233        /// Sends the request.
21234        pub async fn send(self) -> Result<()> {
21235            (*self.0.stub)
21236                .cancel_operation(self.0.request, self.0.options)
21237                .await
21238                .map(crate::Response::into_body)
21239        }
21240
21241        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
21242        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21243            self.0.request.name = v.into();
21244            self
21245        }
21246    }
21247
21248    #[doc(hidden)]
21249    impl crate::RequestBuilder for CancelOperation {
21250        fn request_options(&mut self) -> &mut crate::RequestOptions {
21251            &mut self.0.options
21252        }
21253    }
21254}
21255
21256/// Request and client builders for [Webhooks][crate::client::Webhooks].
21257#[cfg(feature = "webhooks")]
21258#[cfg_attr(docsrs, doc(cfg(feature = "webhooks")))]
21259pub mod webhooks {
21260    use crate::Result;
21261
21262    /// A builder for [Webhooks][crate::client::Webhooks].
21263    ///
21264    /// ```
21265    /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
21266    /// # use google_cloud_dialogflow_cx_v3::*;
21267    /// # use builder::webhooks::ClientBuilder;
21268    /// # use client::Webhooks;
21269    /// let builder : ClientBuilder = Webhooks::builder();
21270    /// let client = builder
21271    ///     .with_endpoint("https://dialogflow.googleapis.com")
21272    ///     .build().await?;
21273    /// # Ok(()) }
21274    /// ```
21275    pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21276
21277    pub(crate) mod client {
21278        use super::super::super::client::Webhooks;
21279        pub struct Factory;
21280        impl crate::ClientFactory for Factory {
21281            type Client = Webhooks;
21282            type Credentials = gaxi::options::Credentials;
21283            async fn build(
21284                self,
21285                config: gaxi::options::ClientConfig,
21286            ) -> crate::ClientBuilderResult<Self::Client> {
21287                Self::Client::new(config).await
21288            }
21289        }
21290    }
21291
21292    /// Common implementation for [crate::client::Webhooks] request builders.
21293    #[derive(Clone, Debug)]
21294    pub(crate) struct RequestBuilder<R: std::default::Default> {
21295        stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>,
21296        request: R,
21297        options: crate::RequestOptions,
21298    }
21299
21300    impl<R> RequestBuilder<R>
21301    where
21302        R: std::default::Default,
21303    {
21304        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21305            Self {
21306                stub,
21307                request: R::default(),
21308                options: crate::RequestOptions::default(),
21309            }
21310        }
21311    }
21312
21313    /// The request builder for [Webhooks::list_webhooks][crate::client::Webhooks::list_webhooks] calls.
21314    ///
21315    /// # Example
21316    /// ```
21317    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::ListWebhooks;
21318    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21319    /// use google_cloud_gax::paginator::ItemPaginator;
21320    ///
21321    /// let builder = prepare_request_builder();
21322    /// let mut items = builder.by_item();
21323    /// while let Some(result) = items.next().await {
21324    ///   let item = result?;
21325    /// }
21326    /// # Ok(()) }
21327    ///
21328    /// fn prepare_request_builder() -> ListWebhooks {
21329    ///   # panic!();
21330    ///   // ... details omitted ...
21331    /// }
21332    /// ```
21333    #[derive(Clone, Debug)]
21334    pub struct ListWebhooks(RequestBuilder<crate::model::ListWebhooksRequest>);
21335
21336    impl ListWebhooks {
21337        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21338            Self(RequestBuilder::new(stub))
21339        }
21340
21341        /// Sets the full request, replacing any prior values.
21342        pub fn with_request<V: Into<crate::model::ListWebhooksRequest>>(mut self, v: V) -> Self {
21343            self.0.request = v.into();
21344            self
21345        }
21346
21347        /// Sets all the options, replacing any prior values.
21348        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21349            self.0.options = v.into();
21350            self
21351        }
21352
21353        /// Sends the request.
21354        pub async fn send(self) -> Result<crate::model::ListWebhooksResponse> {
21355            (*self.0.stub)
21356                .list_webhooks(self.0.request, self.0.options)
21357                .await
21358                .map(crate::Response::into_body)
21359        }
21360
21361        /// Streams each page in the collection.
21362        pub fn by_page(
21363            self,
21364        ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListWebhooksResponse, crate::Error>
21365        {
21366            use std::clone::Clone;
21367            let token = self.0.request.page_token.clone();
21368            let execute = move |token: String| {
21369                let mut builder = self.clone();
21370                builder.0.request = builder.0.request.set_page_token(token);
21371                builder.send()
21372            };
21373            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21374        }
21375
21376        /// Streams each item in the collection.
21377        pub fn by_item(
21378            self,
21379        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21380            crate::model::ListWebhooksResponse,
21381            crate::Error,
21382        > {
21383            use google_cloud_gax::paginator::Paginator;
21384            self.by_page().items()
21385        }
21386
21387        /// Sets the value of [parent][crate::model::ListWebhooksRequest::parent].
21388        ///
21389        /// This is a **required** field for requests.
21390        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21391            self.0.request.parent = v.into();
21392            self
21393        }
21394
21395        /// Sets the value of [page_size][crate::model::ListWebhooksRequest::page_size].
21396        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21397            self.0.request.page_size = v.into();
21398            self
21399        }
21400
21401        /// Sets the value of [page_token][crate::model::ListWebhooksRequest::page_token].
21402        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21403            self.0.request.page_token = v.into();
21404            self
21405        }
21406    }
21407
21408    #[doc(hidden)]
21409    impl crate::RequestBuilder for ListWebhooks {
21410        fn request_options(&mut self) -> &mut crate::RequestOptions {
21411            &mut self.0.options
21412        }
21413    }
21414
21415    /// The request builder for [Webhooks::get_webhook][crate::client::Webhooks::get_webhook] calls.
21416    ///
21417    /// # Example
21418    /// ```
21419    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::GetWebhook;
21420    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21421    ///
21422    /// let builder = prepare_request_builder();
21423    /// let response = builder.send().await?;
21424    /// # Ok(()) }
21425    ///
21426    /// fn prepare_request_builder() -> GetWebhook {
21427    ///   # panic!();
21428    ///   // ... details omitted ...
21429    /// }
21430    /// ```
21431    #[derive(Clone, Debug)]
21432    pub struct GetWebhook(RequestBuilder<crate::model::GetWebhookRequest>);
21433
21434    impl GetWebhook {
21435        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21436            Self(RequestBuilder::new(stub))
21437        }
21438
21439        /// Sets the full request, replacing any prior values.
21440        pub fn with_request<V: Into<crate::model::GetWebhookRequest>>(mut self, v: V) -> Self {
21441            self.0.request = v.into();
21442            self
21443        }
21444
21445        /// Sets all the options, replacing any prior values.
21446        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21447            self.0.options = v.into();
21448            self
21449        }
21450
21451        /// Sends the request.
21452        pub async fn send(self) -> Result<crate::model::Webhook> {
21453            (*self.0.stub)
21454                .get_webhook(self.0.request, self.0.options)
21455                .await
21456                .map(crate::Response::into_body)
21457        }
21458
21459        /// Sets the value of [name][crate::model::GetWebhookRequest::name].
21460        ///
21461        /// This is a **required** field for requests.
21462        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21463            self.0.request.name = v.into();
21464            self
21465        }
21466    }
21467
21468    #[doc(hidden)]
21469    impl crate::RequestBuilder for GetWebhook {
21470        fn request_options(&mut self) -> &mut crate::RequestOptions {
21471            &mut self.0.options
21472        }
21473    }
21474
21475    /// The request builder for [Webhooks::create_webhook][crate::client::Webhooks::create_webhook] calls.
21476    ///
21477    /// # Example
21478    /// ```
21479    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::CreateWebhook;
21480    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21481    ///
21482    /// let builder = prepare_request_builder();
21483    /// let response = builder.send().await?;
21484    /// # Ok(()) }
21485    ///
21486    /// fn prepare_request_builder() -> CreateWebhook {
21487    ///   # panic!();
21488    ///   // ... details omitted ...
21489    /// }
21490    /// ```
21491    #[derive(Clone, Debug)]
21492    pub struct CreateWebhook(RequestBuilder<crate::model::CreateWebhookRequest>);
21493
21494    impl CreateWebhook {
21495        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21496            Self(RequestBuilder::new(stub))
21497        }
21498
21499        /// Sets the full request, replacing any prior values.
21500        pub fn with_request<V: Into<crate::model::CreateWebhookRequest>>(mut self, v: V) -> Self {
21501            self.0.request = v.into();
21502            self
21503        }
21504
21505        /// Sets all the options, replacing any prior values.
21506        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21507            self.0.options = v.into();
21508            self
21509        }
21510
21511        /// Sends the request.
21512        pub async fn send(self) -> Result<crate::model::Webhook> {
21513            (*self.0.stub)
21514                .create_webhook(self.0.request, self.0.options)
21515                .await
21516                .map(crate::Response::into_body)
21517        }
21518
21519        /// Sets the value of [parent][crate::model::CreateWebhookRequest::parent].
21520        ///
21521        /// This is a **required** field for requests.
21522        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21523            self.0.request.parent = v.into();
21524            self
21525        }
21526
21527        /// Sets the value of [webhook][crate::model::CreateWebhookRequest::webhook].
21528        ///
21529        /// This is a **required** field for requests.
21530        pub fn set_webhook<T>(mut self, v: T) -> Self
21531        where
21532            T: std::convert::Into<crate::model::Webhook>,
21533        {
21534            self.0.request.webhook = std::option::Option::Some(v.into());
21535            self
21536        }
21537
21538        /// Sets or clears the value of [webhook][crate::model::CreateWebhookRequest::webhook].
21539        ///
21540        /// This is a **required** field for requests.
21541        pub fn set_or_clear_webhook<T>(mut self, v: std::option::Option<T>) -> Self
21542        where
21543            T: std::convert::Into<crate::model::Webhook>,
21544        {
21545            self.0.request.webhook = v.map(|x| x.into());
21546            self
21547        }
21548    }
21549
21550    #[doc(hidden)]
21551    impl crate::RequestBuilder for CreateWebhook {
21552        fn request_options(&mut self) -> &mut crate::RequestOptions {
21553            &mut self.0.options
21554        }
21555    }
21556
21557    /// The request builder for [Webhooks::update_webhook][crate::client::Webhooks::update_webhook] calls.
21558    ///
21559    /// # Example
21560    /// ```
21561    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::UpdateWebhook;
21562    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21563    ///
21564    /// let builder = prepare_request_builder();
21565    /// let response = builder.send().await?;
21566    /// # Ok(()) }
21567    ///
21568    /// fn prepare_request_builder() -> UpdateWebhook {
21569    ///   # panic!();
21570    ///   // ... details omitted ...
21571    /// }
21572    /// ```
21573    #[derive(Clone, Debug)]
21574    pub struct UpdateWebhook(RequestBuilder<crate::model::UpdateWebhookRequest>);
21575
21576    impl UpdateWebhook {
21577        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21578            Self(RequestBuilder::new(stub))
21579        }
21580
21581        /// Sets the full request, replacing any prior values.
21582        pub fn with_request<V: Into<crate::model::UpdateWebhookRequest>>(mut self, v: V) -> Self {
21583            self.0.request = v.into();
21584            self
21585        }
21586
21587        /// Sets all the options, replacing any prior values.
21588        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21589            self.0.options = v.into();
21590            self
21591        }
21592
21593        /// Sends the request.
21594        pub async fn send(self) -> Result<crate::model::Webhook> {
21595            (*self.0.stub)
21596                .update_webhook(self.0.request, self.0.options)
21597                .await
21598                .map(crate::Response::into_body)
21599        }
21600
21601        /// Sets the value of [webhook][crate::model::UpdateWebhookRequest::webhook].
21602        ///
21603        /// This is a **required** field for requests.
21604        pub fn set_webhook<T>(mut self, v: T) -> Self
21605        where
21606            T: std::convert::Into<crate::model::Webhook>,
21607        {
21608            self.0.request.webhook = std::option::Option::Some(v.into());
21609            self
21610        }
21611
21612        /// Sets or clears the value of [webhook][crate::model::UpdateWebhookRequest::webhook].
21613        ///
21614        /// This is a **required** field for requests.
21615        pub fn set_or_clear_webhook<T>(mut self, v: std::option::Option<T>) -> Self
21616        where
21617            T: std::convert::Into<crate::model::Webhook>,
21618        {
21619            self.0.request.webhook = v.map(|x| x.into());
21620            self
21621        }
21622
21623        /// Sets the value of [update_mask][crate::model::UpdateWebhookRequest::update_mask].
21624        pub fn set_update_mask<T>(mut self, v: T) -> Self
21625        where
21626            T: std::convert::Into<wkt::FieldMask>,
21627        {
21628            self.0.request.update_mask = std::option::Option::Some(v.into());
21629            self
21630        }
21631
21632        /// Sets or clears the value of [update_mask][crate::model::UpdateWebhookRequest::update_mask].
21633        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21634        where
21635            T: std::convert::Into<wkt::FieldMask>,
21636        {
21637            self.0.request.update_mask = v.map(|x| x.into());
21638            self
21639        }
21640    }
21641
21642    #[doc(hidden)]
21643    impl crate::RequestBuilder for UpdateWebhook {
21644        fn request_options(&mut self) -> &mut crate::RequestOptions {
21645            &mut self.0.options
21646        }
21647    }
21648
21649    /// The request builder for [Webhooks::delete_webhook][crate::client::Webhooks::delete_webhook] calls.
21650    ///
21651    /// # Example
21652    /// ```
21653    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::DeleteWebhook;
21654    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21655    ///
21656    /// let builder = prepare_request_builder();
21657    /// let response = builder.send().await?;
21658    /// # Ok(()) }
21659    ///
21660    /// fn prepare_request_builder() -> DeleteWebhook {
21661    ///   # panic!();
21662    ///   // ... details omitted ...
21663    /// }
21664    /// ```
21665    #[derive(Clone, Debug)]
21666    pub struct DeleteWebhook(RequestBuilder<crate::model::DeleteWebhookRequest>);
21667
21668    impl DeleteWebhook {
21669        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21670            Self(RequestBuilder::new(stub))
21671        }
21672
21673        /// Sets the full request, replacing any prior values.
21674        pub fn with_request<V: Into<crate::model::DeleteWebhookRequest>>(mut self, v: V) -> Self {
21675            self.0.request = v.into();
21676            self
21677        }
21678
21679        /// Sets all the options, replacing any prior values.
21680        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21681            self.0.options = v.into();
21682            self
21683        }
21684
21685        /// Sends the request.
21686        pub async fn send(self) -> Result<()> {
21687            (*self.0.stub)
21688                .delete_webhook(self.0.request, self.0.options)
21689                .await
21690                .map(crate::Response::into_body)
21691        }
21692
21693        /// Sets the value of [name][crate::model::DeleteWebhookRequest::name].
21694        ///
21695        /// This is a **required** field for requests.
21696        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21697            self.0.request.name = v.into();
21698            self
21699        }
21700
21701        /// Sets the value of [force][crate::model::DeleteWebhookRequest::force].
21702        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
21703            self.0.request.force = v.into();
21704            self
21705        }
21706    }
21707
21708    #[doc(hidden)]
21709    impl crate::RequestBuilder for DeleteWebhook {
21710        fn request_options(&mut self) -> &mut crate::RequestOptions {
21711            &mut self.0.options
21712        }
21713    }
21714
21715    /// The request builder for [Webhooks::list_locations][crate::client::Webhooks::list_locations] calls.
21716    ///
21717    /// # Example
21718    /// ```
21719    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::ListLocations;
21720    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21721    /// use google_cloud_gax::paginator::ItemPaginator;
21722    ///
21723    /// let builder = prepare_request_builder();
21724    /// let mut items = builder.by_item();
21725    /// while let Some(result) = items.next().await {
21726    ///   let item = result?;
21727    /// }
21728    /// # Ok(()) }
21729    ///
21730    /// fn prepare_request_builder() -> ListLocations {
21731    ///   # panic!();
21732    ///   // ... details omitted ...
21733    /// }
21734    /// ```
21735    #[derive(Clone, Debug)]
21736    pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21737
21738    impl ListLocations {
21739        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21740            Self(RequestBuilder::new(stub))
21741        }
21742
21743        /// Sets the full request, replacing any prior values.
21744        pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21745            mut self,
21746            v: V,
21747        ) -> Self {
21748            self.0.request = v.into();
21749            self
21750        }
21751
21752        /// Sets all the options, replacing any prior values.
21753        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21754            self.0.options = v.into();
21755            self
21756        }
21757
21758        /// Sends the request.
21759        pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21760            (*self.0.stub)
21761                .list_locations(self.0.request, self.0.options)
21762                .await
21763                .map(crate::Response::into_body)
21764        }
21765
21766        /// Streams each page in the collection.
21767        pub fn by_page(
21768            self,
21769        ) -> impl google_cloud_gax::paginator::Paginator<
21770            google_cloud_location::model::ListLocationsResponse,
21771            crate::Error,
21772        > {
21773            use std::clone::Clone;
21774            let token = self.0.request.page_token.clone();
21775            let execute = move |token: String| {
21776                let mut builder = self.clone();
21777                builder.0.request = builder.0.request.set_page_token(token);
21778                builder.send()
21779            };
21780            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21781        }
21782
21783        /// Streams each item in the collection.
21784        pub fn by_item(
21785            self,
21786        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21787            google_cloud_location::model::ListLocationsResponse,
21788            crate::Error,
21789        > {
21790            use google_cloud_gax::paginator::Paginator;
21791            self.by_page().items()
21792        }
21793
21794        /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
21795        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21796            self.0.request.name = v.into();
21797            self
21798        }
21799
21800        /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
21801        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21802            self.0.request.filter = v.into();
21803            self
21804        }
21805
21806        /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
21807        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21808            self.0.request.page_size = v.into();
21809            self
21810        }
21811
21812        /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
21813        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21814            self.0.request.page_token = v.into();
21815            self
21816        }
21817    }
21818
21819    #[doc(hidden)]
21820    impl crate::RequestBuilder for ListLocations {
21821        fn request_options(&mut self) -> &mut crate::RequestOptions {
21822            &mut self.0.options
21823        }
21824    }
21825
21826    /// The request builder for [Webhooks::get_location][crate::client::Webhooks::get_location] calls.
21827    ///
21828    /// # Example
21829    /// ```
21830    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::GetLocation;
21831    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21832    ///
21833    /// let builder = prepare_request_builder();
21834    /// let response = builder.send().await?;
21835    /// # Ok(()) }
21836    ///
21837    /// fn prepare_request_builder() -> GetLocation {
21838    ///   # panic!();
21839    ///   // ... details omitted ...
21840    /// }
21841    /// ```
21842    #[derive(Clone, Debug)]
21843    pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21844
21845    impl GetLocation {
21846        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21847            Self(RequestBuilder::new(stub))
21848        }
21849
21850        /// Sets the full request, replacing any prior values.
21851        pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21852            mut self,
21853            v: V,
21854        ) -> Self {
21855            self.0.request = v.into();
21856            self
21857        }
21858
21859        /// Sets all the options, replacing any prior values.
21860        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21861            self.0.options = v.into();
21862            self
21863        }
21864
21865        /// Sends the request.
21866        pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21867            (*self.0.stub)
21868                .get_location(self.0.request, self.0.options)
21869                .await
21870                .map(crate::Response::into_body)
21871        }
21872
21873        /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
21874        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21875            self.0.request.name = v.into();
21876            self
21877        }
21878    }
21879
21880    #[doc(hidden)]
21881    impl crate::RequestBuilder for GetLocation {
21882        fn request_options(&mut self) -> &mut crate::RequestOptions {
21883            &mut self.0.options
21884        }
21885    }
21886
21887    /// The request builder for [Webhooks::list_operations][crate::client::Webhooks::list_operations] calls.
21888    ///
21889    /// # Example
21890    /// ```
21891    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::ListOperations;
21892    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
21893    /// use google_cloud_gax::paginator::ItemPaginator;
21894    ///
21895    /// let builder = prepare_request_builder();
21896    /// let mut items = builder.by_item();
21897    /// while let Some(result) = items.next().await {
21898    ///   let item = result?;
21899    /// }
21900    /// # Ok(()) }
21901    ///
21902    /// fn prepare_request_builder() -> ListOperations {
21903    ///   # panic!();
21904    ///   // ... details omitted ...
21905    /// }
21906    /// ```
21907    #[derive(Clone, Debug)]
21908    pub struct ListOperations(
21909        RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21910    );
21911
21912    impl ListOperations {
21913        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21914            Self(RequestBuilder::new(stub))
21915        }
21916
21917        /// Sets the full request, replacing any prior values.
21918        pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21919            mut self,
21920            v: V,
21921        ) -> Self {
21922            self.0.request = v.into();
21923            self
21924        }
21925
21926        /// Sets all the options, replacing any prior values.
21927        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21928            self.0.options = v.into();
21929            self
21930        }
21931
21932        /// Sends the request.
21933        pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21934            (*self.0.stub)
21935                .list_operations(self.0.request, self.0.options)
21936                .await
21937                .map(crate::Response::into_body)
21938        }
21939
21940        /// Streams each page in the collection.
21941        pub fn by_page(
21942            self,
21943        ) -> impl google_cloud_gax::paginator::Paginator<
21944            google_cloud_longrunning::model::ListOperationsResponse,
21945            crate::Error,
21946        > {
21947            use std::clone::Clone;
21948            let token = self.0.request.page_token.clone();
21949            let execute = move |token: String| {
21950                let mut builder = self.clone();
21951                builder.0.request = builder.0.request.set_page_token(token);
21952                builder.send()
21953            };
21954            google_cloud_gax::paginator::internal::new_paginator(token, execute)
21955        }
21956
21957        /// Streams each item in the collection.
21958        pub fn by_item(
21959            self,
21960        ) -> impl google_cloud_gax::paginator::ItemPaginator<
21961            google_cloud_longrunning::model::ListOperationsResponse,
21962            crate::Error,
21963        > {
21964            use google_cloud_gax::paginator::Paginator;
21965            self.by_page().items()
21966        }
21967
21968        /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
21969        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21970            self.0.request.name = v.into();
21971            self
21972        }
21973
21974        /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
21975        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21976            self.0.request.filter = v.into();
21977            self
21978        }
21979
21980        /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
21981        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21982            self.0.request.page_size = v.into();
21983            self
21984        }
21985
21986        /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
21987        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21988            self.0.request.page_token = v.into();
21989            self
21990        }
21991
21992        /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
21993        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21994            self.0.request.return_partial_success = v.into();
21995            self
21996        }
21997    }
21998
21999    #[doc(hidden)]
22000    impl crate::RequestBuilder for ListOperations {
22001        fn request_options(&mut self) -> &mut crate::RequestOptions {
22002            &mut self.0.options
22003        }
22004    }
22005
22006    /// The request builder for [Webhooks::get_operation][crate::client::Webhooks::get_operation] calls.
22007    ///
22008    /// # Example
22009    /// ```
22010    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::GetOperation;
22011    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
22012    ///
22013    /// let builder = prepare_request_builder();
22014    /// let response = builder.send().await?;
22015    /// # Ok(()) }
22016    ///
22017    /// fn prepare_request_builder() -> GetOperation {
22018    ///   # panic!();
22019    ///   // ... details omitted ...
22020    /// }
22021    /// ```
22022    #[derive(Clone, Debug)]
22023    pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22024
22025    impl GetOperation {
22026        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
22027            Self(RequestBuilder::new(stub))
22028        }
22029
22030        /// Sets the full request, replacing any prior values.
22031        pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22032            mut self,
22033            v: V,
22034        ) -> Self {
22035            self.0.request = v.into();
22036            self
22037        }
22038
22039        /// Sets all the options, replacing any prior values.
22040        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22041            self.0.options = v.into();
22042            self
22043        }
22044
22045        /// Sends the request.
22046        pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22047            (*self.0.stub)
22048                .get_operation(self.0.request, self.0.options)
22049                .await
22050                .map(crate::Response::into_body)
22051        }
22052
22053        /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
22054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22055            self.0.request.name = v.into();
22056            self
22057        }
22058    }
22059
22060    #[doc(hidden)]
22061    impl crate::RequestBuilder for GetOperation {
22062        fn request_options(&mut self) -> &mut crate::RequestOptions {
22063            &mut self.0.options
22064        }
22065    }
22066
22067    /// The request builder for [Webhooks::cancel_operation][crate::client::Webhooks::cancel_operation] calls.
22068    ///
22069    /// # Example
22070    /// ```
22071    /// # use google_cloud_dialogflow_cx_v3::builder::webhooks::CancelOperation;
22072    /// # async fn sample() -> google_cloud_dialogflow_cx_v3::Result<()> {
22073    ///
22074    /// let builder = prepare_request_builder();
22075    /// let response = builder.send().await?;
22076    /// # Ok(()) }
22077    ///
22078    /// fn prepare_request_builder() -> CancelOperation {
22079    ///   # panic!();
22080    ///   // ... details omitted ...
22081    /// }
22082    /// ```
22083    #[derive(Clone, Debug)]
22084    pub struct CancelOperation(
22085        RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22086    );
22087
22088    impl CancelOperation {
22089        pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
22090            Self(RequestBuilder::new(stub))
22091        }
22092
22093        /// Sets the full request, replacing any prior values.
22094        pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22095            mut self,
22096            v: V,
22097        ) -> Self {
22098            self.0.request = v.into();
22099            self
22100        }
22101
22102        /// Sets all the options, replacing any prior values.
22103        pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22104            self.0.options = v.into();
22105            self
22106        }
22107
22108        /// Sends the request.
22109        pub async fn send(self) -> Result<()> {
22110            (*self.0.stub)
22111                .cancel_operation(self.0.request, self.0.options)
22112                .await
22113                .map(crate::Response::into_body)
22114        }
22115
22116        /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
22117        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22118            self.0.request.name = v.into();
22119            self
22120        }
22121    }
22122
22123    #[doc(hidden)]
22124    impl crate::RequestBuilder for CancelOperation {
22125        fn request_options(&mut self) -> &mut crate::RequestOptions {
22126            &mut self.0.options
22127        }
22128    }
22129}