google_cloud_datastream_v1/
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
17pub mod datastream {
18    use crate::Result;
19
20    /// A builder for [Datastream][crate::client::Datastream].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_datastream_v1::*;
25    /// # use builder::datastream::ClientBuilder;
26    /// # use client::Datastream;
27    /// let builder : ClientBuilder = Datastream::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://datastream.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::Datastream;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = Datastream;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::Datastream] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Datastream::list_connection_profiles][crate::client::Datastream::list_connection_profiles] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_datastream_v1::builder;
79    /// use builder::datastream::ListConnectionProfiles;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListConnectionProfiles {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
97
98    impl ListConnectionProfiles {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
107            mut self,
108            v: V,
109        ) -> Self {
110            self.0.request = v.into();
111            self
112        }
113
114        /// Sets all the options, replacing any prior values.
115        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
116            self.0.options = v.into();
117            self
118        }
119
120        /// Sends the request.
121        pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
122            (*self.0.stub)
123                .list_connection_profiles(self.0.request, self.0.options)
124                .await
125                .map(gax::response::Response::into_body)
126        }
127
128        /// Streams each page in the collection.
129        pub fn by_page(
130            self,
131        ) -> impl gax::paginator::Paginator<
132            crate::model::ListConnectionProfilesResponse,
133            gax::error::Error,
134        > {
135            use std::clone::Clone;
136            let token = self.0.request.page_token.clone();
137            let execute = move |token: String| {
138                let mut builder = self.clone();
139                builder.0.request = builder.0.request.set_page_token(token);
140                builder.send()
141            };
142            gax::paginator::internal::new_paginator(token, execute)
143        }
144
145        /// Streams each item in the collection.
146        pub fn by_item(
147            self,
148        ) -> impl gax::paginator::ItemPaginator<
149            crate::model::ListConnectionProfilesResponse,
150            gax::error::Error,
151        > {
152            use gax::paginator::Paginator;
153            self.by_page().items()
154        }
155
156        /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
157        ///
158        /// This is a **required** field for requests.
159        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
160            self.0.request.parent = v.into();
161            self
162        }
163
164        /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
165        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
166            self.0.request.page_size = v.into();
167            self
168        }
169
170        /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
171        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
172            self.0.request.page_token = v.into();
173            self
174        }
175
176        /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
177        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
178            self.0.request.filter = v.into();
179            self
180        }
181
182        /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
183        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
184            self.0.request.order_by = v.into();
185            self
186        }
187    }
188
189    #[doc(hidden)]
190    impl gax::options::internal::RequestBuilder for ListConnectionProfiles {
191        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
192            &mut self.0.options
193        }
194    }
195
196    /// The request builder for [Datastream::get_connection_profile][crate::client::Datastream::get_connection_profile] calls.
197    ///
198    /// # Example
199    /// ```no_run
200    /// # use google_cloud_datastream_v1::builder;
201    /// use builder::datastream::GetConnectionProfile;
202    /// # tokio_test::block_on(async {
203    ///
204    /// let builder = prepare_request_builder();
205    /// let response = builder.send().await?;
206    /// # gax::Result::<()>::Ok(()) });
207    ///
208    /// fn prepare_request_builder() -> GetConnectionProfile {
209    ///   # panic!();
210    ///   // ... details omitted ...
211    /// }
212    /// ```
213    #[derive(Clone, Debug)]
214    pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
215
216    impl GetConnectionProfile {
217        pub(crate) fn new(
218            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
219        ) -> Self {
220            Self(RequestBuilder::new(stub))
221        }
222
223        /// Sets the full request, replacing any prior values.
224        pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
225            mut self,
226            v: V,
227        ) -> Self {
228            self.0.request = v.into();
229            self
230        }
231
232        /// Sets all the options, replacing any prior values.
233        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
234            self.0.options = v.into();
235            self
236        }
237
238        /// Sends the request.
239        pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
240            (*self.0.stub)
241                .get_connection_profile(self.0.request, self.0.options)
242                .await
243                .map(gax::response::Response::into_body)
244        }
245
246        /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
247        ///
248        /// This is a **required** field for requests.
249        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
250            self.0.request.name = v.into();
251            self
252        }
253    }
254
255    #[doc(hidden)]
256    impl gax::options::internal::RequestBuilder for GetConnectionProfile {
257        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
258            &mut self.0.options
259        }
260    }
261
262    /// The request builder for [Datastream::create_connection_profile][crate::client::Datastream::create_connection_profile] calls.
263    ///
264    /// # Example
265    /// ```no_run
266    /// # use google_cloud_datastream_v1::builder;
267    /// use builder::datastream::CreateConnectionProfile;
268    /// # tokio_test::block_on(async {
269    /// use lro::Poller;
270    ///
271    /// let builder = prepare_request_builder();
272    /// let response = builder.poller().until_done().await?;
273    /// # gax::Result::<()>::Ok(()) });
274    ///
275    /// fn prepare_request_builder() -> CreateConnectionProfile {
276    ///   # panic!();
277    ///   // ... details omitted ...
278    /// }
279    /// ```
280    #[derive(Clone, Debug)]
281    pub struct CreateConnectionProfile(
282        RequestBuilder<crate::model::CreateConnectionProfileRequest>,
283    );
284
285    impl CreateConnectionProfile {
286        pub(crate) fn new(
287            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
288        ) -> Self {
289            Self(RequestBuilder::new(stub))
290        }
291
292        /// Sets the full request, replacing any prior values.
293        pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
294            mut self,
295            v: V,
296        ) -> Self {
297            self.0.request = v.into();
298            self
299        }
300
301        /// Sets all the options, replacing any prior values.
302        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
303            self.0.options = v.into();
304            self
305        }
306
307        /// Sends the request.
308        ///
309        /// # Long running operations
310        ///
311        /// This starts, but does not poll, a longrunning operation. More information
312        /// on [create_connection_profile][crate::client::Datastream::create_connection_profile].
313        pub async fn send(self) -> Result<longrunning::model::Operation> {
314            (*self.0.stub)
315                .create_connection_profile(self.0.request, self.0.options)
316                .await
317                .map(gax::response::Response::into_body)
318        }
319
320        /// Creates a [Poller][lro::Poller] to work with `create_connection_profile`.
321        pub fn poller(
322            self,
323        ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
324        {
325            type Operation = lro::internal::Operation<
326                crate::model::ConnectionProfile,
327                crate::model::OperationMetadata,
328            >;
329            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
330            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
331
332            let stub = self.0.stub.clone();
333            let mut options = self.0.options.clone();
334            options.set_retry_policy(gax::retry_policy::NeverRetry);
335            let query = move |name| {
336                let stub = stub.clone();
337                let options = options.clone();
338                async {
339                    let op = GetOperation::new(stub)
340                        .set_name(name)
341                        .with_options(options)
342                        .send()
343                        .await?;
344                    Ok(Operation::new(op))
345                }
346            };
347
348            let start = move || async {
349                let op = self.send().await?;
350                Ok(Operation::new(op))
351            };
352
353            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
354        }
355
356        /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
357        ///
358        /// This is a **required** field for requests.
359        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
360            self.0.request.parent = v.into();
361            self
362        }
363
364        /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
365        ///
366        /// This is a **required** field for requests.
367        pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
368            self.0.request.connection_profile_id = v.into();
369            self
370        }
371
372        /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
373        ///
374        /// This is a **required** field for requests.
375        pub fn set_connection_profile<T>(mut self, v: T) -> Self
376        where
377            T: std::convert::Into<crate::model::ConnectionProfile>,
378        {
379            self.0.request.connection_profile = std::option::Option::Some(v.into());
380            self
381        }
382
383        /// Sets or clears the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
384        ///
385        /// This is a **required** field for requests.
386        pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
387        where
388            T: std::convert::Into<crate::model::ConnectionProfile>,
389        {
390            self.0.request.connection_profile = v.map(|x| x.into());
391            self
392        }
393
394        /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
395        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
396            self.0.request.request_id = v.into();
397            self
398        }
399
400        /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
401        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
402            self.0.request.validate_only = v.into();
403            self
404        }
405
406        /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
407        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
408            self.0.request.force = v.into();
409            self
410        }
411    }
412
413    #[doc(hidden)]
414    impl gax::options::internal::RequestBuilder for CreateConnectionProfile {
415        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
416            &mut self.0.options
417        }
418    }
419
420    /// The request builder for [Datastream::update_connection_profile][crate::client::Datastream::update_connection_profile] calls.
421    ///
422    /// # Example
423    /// ```no_run
424    /// # use google_cloud_datastream_v1::builder;
425    /// use builder::datastream::UpdateConnectionProfile;
426    /// # tokio_test::block_on(async {
427    /// use lro::Poller;
428    ///
429    /// let builder = prepare_request_builder();
430    /// let response = builder.poller().until_done().await?;
431    /// # gax::Result::<()>::Ok(()) });
432    ///
433    /// fn prepare_request_builder() -> UpdateConnectionProfile {
434    ///   # panic!();
435    ///   // ... details omitted ...
436    /// }
437    /// ```
438    #[derive(Clone, Debug)]
439    pub struct UpdateConnectionProfile(
440        RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
441    );
442
443    impl UpdateConnectionProfile {
444        pub(crate) fn new(
445            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
446        ) -> Self {
447            Self(RequestBuilder::new(stub))
448        }
449
450        /// Sets the full request, replacing any prior values.
451        pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
452            mut self,
453            v: V,
454        ) -> Self {
455            self.0.request = v.into();
456            self
457        }
458
459        /// Sets all the options, replacing any prior values.
460        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
461            self.0.options = v.into();
462            self
463        }
464
465        /// Sends the request.
466        ///
467        /// # Long running operations
468        ///
469        /// This starts, but does not poll, a longrunning operation. More information
470        /// on [update_connection_profile][crate::client::Datastream::update_connection_profile].
471        pub async fn send(self) -> Result<longrunning::model::Operation> {
472            (*self.0.stub)
473                .update_connection_profile(self.0.request, self.0.options)
474                .await
475                .map(gax::response::Response::into_body)
476        }
477
478        /// Creates a [Poller][lro::Poller] to work with `update_connection_profile`.
479        pub fn poller(
480            self,
481        ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
482        {
483            type Operation = lro::internal::Operation<
484                crate::model::ConnectionProfile,
485                crate::model::OperationMetadata,
486            >;
487            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
488            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
489
490            let stub = self.0.stub.clone();
491            let mut options = self.0.options.clone();
492            options.set_retry_policy(gax::retry_policy::NeverRetry);
493            let query = move |name| {
494                let stub = stub.clone();
495                let options = options.clone();
496                async {
497                    let op = GetOperation::new(stub)
498                        .set_name(name)
499                        .with_options(options)
500                        .send()
501                        .await?;
502                    Ok(Operation::new(op))
503                }
504            };
505
506            let start = move || async {
507                let op = self.send().await?;
508                Ok(Operation::new(op))
509            };
510
511            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
512        }
513
514        /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
515        pub fn set_update_mask<T>(mut self, v: T) -> Self
516        where
517            T: std::convert::Into<wkt::FieldMask>,
518        {
519            self.0.request.update_mask = std::option::Option::Some(v.into());
520            self
521        }
522
523        /// Sets or clears the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
524        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
525        where
526            T: std::convert::Into<wkt::FieldMask>,
527        {
528            self.0.request.update_mask = v.map(|x| x.into());
529            self
530        }
531
532        /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
533        ///
534        /// This is a **required** field for requests.
535        pub fn set_connection_profile<T>(mut self, v: T) -> Self
536        where
537            T: std::convert::Into<crate::model::ConnectionProfile>,
538        {
539            self.0.request.connection_profile = std::option::Option::Some(v.into());
540            self
541        }
542
543        /// Sets or clears the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
544        ///
545        /// This is a **required** field for requests.
546        pub fn set_or_clear_connection_profile<T>(mut self, v: std::option::Option<T>) -> Self
547        where
548            T: std::convert::Into<crate::model::ConnectionProfile>,
549        {
550            self.0.request.connection_profile = v.map(|x| x.into());
551            self
552        }
553
554        /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
555        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
556            self.0.request.request_id = v.into();
557            self
558        }
559
560        /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
561        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
562            self.0.request.validate_only = v.into();
563            self
564        }
565
566        /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
567        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
568            self.0.request.force = v.into();
569            self
570        }
571    }
572
573    #[doc(hidden)]
574    impl gax::options::internal::RequestBuilder for UpdateConnectionProfile {
575        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
576            &mut self.0.options
577        }
578    }
579
580    /// The request builder for [Datastream::delete_connection_profile][crate::client::Datastream::delete_connection_profile] calls.
581    ///
582    /// # Example
583    /// ```no_run
584    /// # use google_cloud_datastream_v1::builder;
585    /// use builder::datastream::DeleteConnectionProfile;
586    /// # tokio_test::block_on(async {
587    /// use lro::Poller;
588    ///
589    /// let builder = prepare_request_builder();
590    /// let response = builder.poller().until_done().await?;
591    /// # gax::Result::<()>::Ok(()) });
592    ///
593    /// fn prepare_request_builder() -> DeleteConnectionProfile {
594    ///   # panic!();
595    ///   // ... details omitted ...
596    /// }
597    /// ```
598    #[derive(Clone, Debug)]
599    pub struct DeleteConnectionProfile(
600        RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
601    );
602
603    impl DeleteConnectionProfile {
604        pub(crate) fn new(
605            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
606        ) -> Self {
607            Self(RequestBuilder::new(stub))
608        }
609
610        /// Sets the full request, replacing any prior values.
611        pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
612            mut self,
613            v: V,
614        ) -> Self {
615            self.0.request = v.into();
616            self
617        }
618
619        /// Sets all the options, replacing any prior values.
620        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
621            self.0.options = v.into();
622            self
623        }
624
625        /// Sends the request.
626        ///
627        /// # Long running operations
628        ///
629        /// This starts, but does not poll, a longrunning operation. More information
630        /// on [delete_connection_profile][crate::client::Datastream::delete_connection_profile].
631        pub async fn send(self) -> Result<longrunning::model::Operation> {
632            (*self.0.stub)
633                .delete_connection_profile(self.0.request, self.0.options)
634                .await
635                .map(gax::response::Response::into_body)
636        }
637
638        /// Creates a [Poller][lro::Poller] to work with `delete_connection_profile`.
639        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
640            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
641            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
642            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
643
644            let stub = self.0.stub.clone();
645            let mut options = self.0.options.clone();
646            options.set_retry_policy(gax::retry_policy::NeverRetry);
647            let query = move |name| {
648                let stub = stub.clone();
649                let options = options.clone();
650                async {
651                    let op = GetOperation::new(stub)
652                        .set_name(name)
653                        .with_options(options)
654                        .send()
655                        .await?;
656                    Ok(Operation::new(op))
657                }
658            };
659
660            let start = move || async {
661                let op = self.send().await?;
662                Ok(Operation::new(op))
663            };
664
665            lro::internal::new_unit_response_poller(
666                polling_error_policy,
667                polling_backoff_policy,
668                start,
669                query,
670            )
671        }
672
673        /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
674        ///
675        /// This is a **required** field for requests.
676        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
677            self.0.request.name = v.into();
678            self
679        }
680
681        /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
682        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
683            self.0.request.request_id = v.into();
684            self
685        }
686    }
687
688    #[doc(hidden)]
689    impl gax::options::internal::RequestBuilder for DeleteConnectionProfile {
690        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
691            &mut self.0.options
692        }
693    }
694
695    /// The request builder for [Datastream::discover_connection_profile][crate::client::Datastream::discover_connection_profile] calls.
696    ///
697    /// # Example
698    /// ```no_run
699    /// # use google_cloud_datastream_v1::builder;
700    /// use builder::datastream::DiscoverConnectionProfile;
701    /// # tokio_test::block_on(async {
702    ///
703    /// let builder = prepare_request_builder();
704    /// let response = builder.send().await?;
705    /// # gax::Result::<()>::Ok(()) });
706    ///
707    /// fn prepare_request_builder() -> DiscoverConnectionProfile {
708    ///   # panic!();
709    ///   // ... details omitted ...
710    /// }
711    /// ```
712    #[derive(Clone, Debug)]
713    pub struct DiscoverConnectionProfile(
714        RequestBuilder<crate::model::DiscoverConnectionProfileRequest>,
715    );
716
717    impl DiscoverConnectionProfile {
718        pub(crate) fn new(
719            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
720        ) -> Self {
721            Self(RequestBuilder::new(stub))
722        }
723
724        /// Sets the full request, replacing any prior values.
725        pub fn with_request<V: Into<crate::model::DiscoverConnectionProfileRequest>>(
726            mut self,
727            v: V,
728        ) -> Self {
729            self.0.request = v.into();
730            self
731        }
732
733        /// Sets all the options, replacing any prior values.
734        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
735            self.0.options = v.into();
736            self
737        }
738
739        /// Sends the request.
740        pub async fn send(self) -> Result<crate::model::DiscoverConnectionProfileResponse> {
741            (*self.0.stub)
742                .discover_connection_profile(self.0.request, self.0.options)
743                .await
744                .map(gax::response::Response::into_body)
745        }
746
747        /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
748        ///
749        /// This is a **required** field for requests.
750        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
751            self.0.request.parent = v.into();
752            self
753        }
754
755        /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
756        ///
757        /// Note that all the setters affecting `target` are
758        /// mutually exclusive.
759        pub fn set_target<
760            T: Into<Option<crate::model::discover_connection_profile_request::Target>>,
761        >(
762            mut self,
763            v: T,
764        ) -> Self {
765            self.0.request.target = v.into();
766            self
767        }
768
769        /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
770        /// to hold a `ConnectionProfile`.
771        ///
772        /// Note that all the setters affecting `target` are
773        /// mutually exclusive.
774        pub fn set_connection_profile<
775            T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
776        >(
777            mut self,
778            v: T,
779        ) -> Self {
780            self.0.request = self.0.request.set_connection_profile(v);
781            self
782        }
783
784        /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
785        /// to hold a `ConnectionProfileName`.
786        ///
787        /// Note that all the setters affecting `target` are
788        /// mutually exclusive.
789        pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
790            mut self,
791            v: T,
792        ) -> Self {
793            self.0.request = self.0.request.set_connection_profile_name(v);
794            self
795        }
796
797        /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
798        ///
799        /// Note that all the setters affecting `hierarchy` are
800        /// mutually exclusive.
801        pub fn set_hierarchy<
802            T: Into<Option<crate::model::discover_connection_profile_request::Hierarchy>>,
803        >(
804            mut self,
805            v: T,
806        ) -> Self {
807            self.0.request.hierarchy = v.into();
808            self
809        }
810
811        /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
812        /// to hold a `FullHierarchy`.
813        ///
814        /// Note that all the setters affecting `hierarchy` are
815        /// mutually exclusive.
816        pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
817            self.0.request = self.0.request.set_full_hierarchy(v);
818            self
819        }
820
821        /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
822        /// to hold a `HierarchyDepth`.
823        ///
824        /// Note that all the setters affecting `hierarchy` are
825        /// mutually exclusive.
826        pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
827            self.0.request = self.0.request.set_hierarchy_depth(v);
828            self
829        }
830
831        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
832        ///
833        /// Note that all the setters affecting `data_object` are
834        /// mutually exclusive.
835        pub fn set_data_object<
836            T: Into<Option<crate::model::discover_connection_profile_request::DataObject>>,
837        >(
838            mut self,
839            v: T,
840        ) -> Self {
841            self.0.request.data_object = v.into();
842            self
843        }
844
845        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
846        /// to hold a `OracleRdbms`.
847        ///
848        /// Note that all the setters affecting `data_object` are
849        /// mutually exclusive.
850        pub fn set_oracle_rdbms<
851            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
852        >(
853            mut self,
854            v: T,
855        ) -> Self {
856            self.0.request = self.0.request.set_oracle_rdbms(v);
857            self
858        }
859
860        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
861        /// to hold a `MysqlRdbms`.
862        ///
863        /// Note that all the setters affecting `data_object` are
864        /// mutually exclusive.
865        pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
866            mut self,
867            v: T,
868        ) -> Self {
869            self.0.request = self.0.request.set_mysql_rdbms(v);
870            self
871        }
872
873        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
874        /// to hold a `PostgresqlRdbms`.
875        ///
876        /// Note that all the setters affecting `data_object` are
877        /// mutually exclusive.
878        pub fn set_postgresql_rdbms<
879            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
880        >(
881            mut self,
882            v: T,
883        ) -> Self {
884            self.0.request = self.0.request.set_postgresql_rdbms(v);
885            self
886        }
887
888        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
889        /// to hold a `SqlServerRdbms`.
890        ///
891        /// Note that all the setters affecting `data_object` are
892        /// mutually exclusive.
893        pub fn set_sql_server_rdbms<
894            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
895        >(
896            mut self,
897            v: T,
898        ) -> Self {
899            self.0.request = self.0.request.set_sql_server_rdbms(v);
900            self
901        }
902    }
903
904    #[doc(hidden)]
905    impl gax::options::internal::RequestBuilder for DiscoverConnectionProfile {
906        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
907            &mut self.0.options
908        }
909    }
910
911    /// The request builder for [Datastream::list_streams][crate::client::Datastream::list_streams] calls.
912    ///
913    /// # Example
914    /// ```no_run
915    /// # use google_cloud_datastream_v1::builder;
916    /// use builder::datastream::ListStreams;
917    /// # tokio_test::block_on(async {
918    /// use gax::paginator::ItemPaginator;
919    ///
920    /// let builder = prepare_request_builder();
921    /// let mut items = builder.by_item();
922    /// while let Some(result) = items.next().await {
923    ///   let item = result?;
924    /// }
925    /// # gax::Result::<()>::Ok(()) });
926    ///
927    /// fn prepare_request_builder() -> ListStreams {
928    ///   # panic!();
929    ///   // ... details omitted ...
930    /// }
931    /// ```
932    #[derive(Clone, Debug)]
933    pub struct ListStreams(RequestBuilder<crate::model::ListStreamsRequest>);
934
935    impl ListStreams {
936        pub(crate) fn new(
937            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
938        ) -> Self {
939            Self(RequestBuilder::new(stub))
940        }
941
942        /// Sets the full request, replacing any prior values.
943        pub fn with_request<V: Into<crate::model::ListStreamsRequest>>(mut self, v: V) -> 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<gax::options::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::ListStreamsResponse> {
956            (*self.0.stub)
957                .list_streams(self.0.request, self.0.options)
958                .await
959                .map(gax::response::Response::into_body)
960        }
961
962        /// Streams each page in the collection.
963        pub fn by_page(
964            self,
965        ) -> impl gax::paginator::Paginator<crate::model::ListStreamsResponse, gax::error::Error>
966        {
967            use std::clone::Clone;
968            let token = self.0.request.page_token.clone();
969            let execute = move |token: String| {
970                let mut builder = self.clone();
971                builder.0.request = builder.0.request.set_page_token(token);
972                builder.send()
973            };
974            gax::paginator::internal::new_paginator(token, execute)
975        }
976
977        /// Streams each item in the collection.
978        pub fn by_item(
979            self,
980        ) -> impl gax::paginator::ItemPaginator<crate::model::ListStreamsResponse, gax::error::Error>
981        {
982            use gax::paginator::Paginator;
983            self.by_page().items()
984        }
985
986        /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
987        ///
988        /// This is a **required** field for requests.
989        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
990            self.0.request.parent = v.into();
991            self
992        }
993
994        /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
995        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
996            self.0.request.page_size = v.into();
997            self
998        }
999
1000        /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
1001        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1002            self.0.request.page_token = v.into();
1003            self
1004        }
1005
1006        /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
1007        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1008            self.0.request.filter = v.into();
1009            self
1010        }
1011
1012        /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
1013        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1014            self.0.request.order_by = v.into();
1015            self
1016        }
1017    }
1018
1019    #[doc(hidden)]
1020    impl gax::options::internal::RequestBuilder for ListStreams {
1021        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1022            &mut self.0.options
1023        }
1024    }
1025
1026    /// The request builder for [Datastream::get_stream][crate::client::Datastream::get_stream] calls.
1027    ///
1028    /// # Example
1029    /// ```no_run
1030    /// # use google_cloud_datastream_v1::builder;
1031    /// use builder::datastream::GetStream;
1032    /// # tokio_test::block_on(async {
1033    ///
1034    /// let builder = prepare_request_builder();
1035    /// let response = builder.send().await?;
1036    /// # gax::Result::<()>::Ok(()) });
1037    ///
1038    /// fn prepare_request_builder() -> GetStream {
1039    ///   # panic!();
1040    ///   // ... details omitted ...
1041    /// }
1042    /// ```
1043    #[derive(Clone, Debug)]
1044    pub struct GetStream(RequestBuilder<crate::model::GetStreamRequest>);
1045
1046    impl GetStream {
1047        pub(crate) fn new(
1048            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1049        ) -> Self {
1050            Self(RequestBuilder::new(stub))
1051        }
1052
1053        /// Sets the full request, replacing any prior values.
1054        pub fn with_request<V: Into<crate::model::GetStreamRequest>>(mut self, v: V) -> Self {
1055            self.0.request = v.into();
1056            self
1057        }
1058
1059        /// Sets all the options, replacing any prior values.
1060        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1061            self.0.options = v.into();
1062            self
1063        }
1064
1065        /// Sends the request.
1066        pub async fn send(self) -> Result<crate::model::Stream> {
1067            (*self.0.stub)
1068                .get_stream(self.0.request, self.0.options)
1069                .await
1070                .map(gax::response::Response::into_body)
1071        }
1072
1073        /// Sets the value of [name][crate::model::GetStreamRequest::name].
1074        ///
1075        /// This is a **required** field for requests.
1076        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1077            self.0.request.name = v.into();
1078            self
1079        }
1080    }
1081
1082    #[doc(hidden)]
1083    impl gax::options::internal::RequestBuilder for GetStream {
1084        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1085            &mut self.0.options
1086        }
1087    }
1088
1089    /// The request builder for [Datastream::create_stream][crate::client::Datastream::create_stream] calls.
1090    ///
1091    /// # Example
1092    /// ```no_run
1093    /// # use google_cloud_datastream_v1::builder;
1094    /// use builder::datastream::CreateStream;
1095    /// # tokio_test::block_on(async {
1096    /// use lro::Poller;
1097    ///
1098    /// let builder = prepare_request_builder();
1099    /// let response = builder.poller().until_done().await?;
1100    /// # gax::Result::<()>::Ok(()) });
1101    ///
1102    /// fn prepare_request_builder() -> CreateStream {
1103    ///   # panic!();
1104    ///   // ... details omitted ...
1105    /// }
1106    /// ```
1107    #[derive(Clone, Debug)]
1108    pub struct CreateStream(RequestBuilder<crate::model::CreateStreamRequest>);
1109
1110    impl CreateStream {
1111        pub(crate) fn new(
1112            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1113        ) -> Self {
1114            Self(RequestBuilder::new(stub))
1115        }
1116
1117        /// Sets the full request, replacing any prior values.
1118        pub fn with_request<V: Into<crate::model::CreateStreamRequest>>(mut self, v: V) -> Self {
1119            self.0.request = v.into();
1120            self
1121        }
1122
1123        /// Sets all the options, replacing any prior values.
1124        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1125            self.0.options = v.into();
1126            self
1127        }
1128
1129        /// Sends the request.
1130        ///
1131        /// # Long running operations
1132        ///
1133        /// This starts, but does not poll, a longrunning operation. More information
1134        /// on [create_stream][crate::client::Datastream::create_stream].
1135        pub async fn send(self) -> Result<longrunning::model::Operation> {
1136            (*self.0.stub)
1137                .create_stream(self.0.request, self.0.options)
1138                .await
1139                .map(gax::response::Response::into_body)
1140        }
1141
1142        /// Creates a [Poller][lro::Poller] to work with `create_stream`.
1143        pub fn poller(
1144            self,
1145        ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1146            type Operation =
1147                lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1148            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1149            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1150
1151            let stub = self.0.stub.clone();
1152            let mut options = self.0.options.clone();
1153            options.set_retry_policy(gax::retry_policy::NeverRetry);
1154            let query = move |name| {
1155                let stub = stub.clone();
1156                let options = options.clone();
1157                async {
1158                    let op = GetOperation::new(stub)
1159                        .set_name(name)
1160                        .with_options(options)
1161                        .send()
1162                        .await?;
1163                    Ok(Operation::new(op))
1164                }
1165            };
1166
1167            let start = move || async {
1168                let op = self.send().await?;
1169                Ok(Operation::new(op))
1170            };
1171
1172            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1173        }
1174
1175        /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
1176        ///
1177        /// This is a **required** field for requests.
1178        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1179            self.0.request.parent = v.into();
1180            self
1181        }
1182
1183        /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
1184        ///
1185        /// This is a **required** field for requests.
1186        pub fn set_stream_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1187            self.0.request.stream_id = v.into();
1188            self
1189        }
1190
1191        /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
1192        ///
1193        /// This is a **required** field for requests.
1194        pub fn set_stream<T>(mut self, v: T) -> Self
1195        where
1196            T: std::convert::Into<crate::model::Stream>,
1197        {
1198            self.0.request.stream = std::option::Option::Some(v.into());
1199            self
1200        }
1201
1202        /// Sets or clears the value of [stream][crate::model::CreateStreamRequest::stream].
1203        ///
1204        /// This is a **required** field for requests.
1205        pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1206        where
1207            T: std::convert::Into<crate::model::Stream>,
1208        {
1209            self.0.request.stream = v.map(|x| x.into());
1210            self
1211        }
1212
1213        /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
1214        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1215            self.0.request.request_id = v.into();
1216            self
1217        }
1218
1219        /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
1220        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1221            self.0.request.validate_only = v.into();
1222            self
1223        }
1224
1225        /// Sets the value of [force][crate::model::CreateStreamRequest::force].
1226        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1227            self.0.request.force = v.into();
1228            self
1229        }
1230    }
1231
1232    #[doc(hidden)]
1233    impl gax::options::internal::RequestBuilder for CreateStream {
1234        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1235            &mut self.0.options
1236        }
1237    }
1238
1239    /// The request builder for [Datastream::update_stream][crate::client::Datastream::update_stream] calls.
1240    ///
1241    /// # Example
1242    /// ```no_run
1243    /// # use google_cloud_datastream_v1::builder;
1244    /// use builder::datastream::UpdateStream;
1245    /// # tokio_test::block_on(async {
1246    /// use lro::Poller;
1247    ///
1248    /// let builder = prepare_request_builder();
1249    /// let response = builder.poller().until_done().await?;
1250    /// # gax::Result::<()>::Ok(()) });
1251    ///
1252    /// fn prepare_request_builder() -> UpdateStream {
1253    ///   # panic!();
1254    ///   // ... details omitted ...
1255    /// }
1256    /// ```
1257    #[derive(Clone, Debug)]
1258    pub struct UpdateStream(RequestBuilder<crate::model::UpdateStreamRequest>);
1259
1260    impl UpdateStream {
1261        pub(crate) fn new(
1262            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1263        ) -> Self {
1264            Self(RequestBuilder::new(stub))
1265        }
1266
1267        /// Sets the full request, replacing any prior values.
1268        pub fn with_request<V: Into<crate::model::UpdateStreamRequest>>(mut self, v: V) -> Self {
1269            self.0.request = v.into();
1270            self
1271        }
1272
1273        /// Sets all the options, replacing any prior values.
1274        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1275            self.0.options = v.into();
1276            self
1277        }
1278
1279        /// Sends the request.
1280        ///
1281        /// # Long running operations
1282        ///
1283        /// This starts, but does not poll, a longrunning operation. More information
1284        /// on [update_stream][crate::client::Datastream::update_stream].
1285        pub async fn send(self) -> Result<longrunning::model::Operation> {
1286            (*self.0.stub)
1287                .update_stream(self.0.request, self.0.options)
1288                .await
1289                .map(gax::response::Response::into_body)
1290        }
1291
1292        /// Creates a [Poller][lro::Poller] to work with `update_stream`.
1293        pub fn poller(
1294            self,
1295        ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1296            type Operation =
1297                lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1298            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1299            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1300
1301            let stub = self.0.stub.clone();
1302            let mut options = self.0.options.clone();
1303            options.set_retry_policy(gax::retry_policy::NeverRetry);
1304            let query = move |name| {
1305                let stub = stub.clone();
1306                let options = options.clone();
1307                async {
1308                    let op = GetOperation::new(stub)
1309                        .set_name(name)
1310                        .with_options(options)
1311                        .send()
1312                        .await?;
1313                    Ok(Operation::new(op))
1314                }
1315            };
1316
1317            let start = move || async {
1318                let op = self.send().await?;
1319                Ok(Operation::new(op))
1320            };
1321
1322            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1323        }
1324
1325        /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1326        pub fn set_update_mask<T>(mut self, v: T) -> Self
1327        where
1328            T: std::convert::Into<wkt::FieldMask>,
1329        {
1330            self.0.request.update_mask = std::option::Option::Some(v.into());
1331            self
1332        }
1333
1334        /// Sets or clears the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1335        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1336        where
1337            T: std::convert::Into<wkt::FieldMask>,
1338        {
1339            self.0.request.update_mask = v.map(|x| x.into());
1340            self
1341        }
1342
1343        /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
1344        ///
1345        /// This is a **required** field for requests.
1346        pub fn set_stream<T>(mut self, v: T) -> Self
1347        where
1348            T: std::convert::Into<crate::model::Stream>,
1349        {
1350            self.0.request.stream = std::option::Option::Some(v.into());
1351            self
1352        }
1353
1354        /// Sets or clears the value of [stream][crate::model::UpdateStreamRequest::stream].
1355        ///
1356        /// This is a **required** field for requests.
1357        pub fn set_or_clear_stream<T>(mut self, v: std::option::Option<T>) -> Self
1358        where
1359            T: std::convert::Into<crate::model::Stream>,
1360        {
1361            self.0.request.stream = v.map(|x| x.into());
1362            self
1363        }
1364
1365        /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
1366        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1367            self.0.request.request_id = v.into();
1368            self
1369        }
1370
1371        /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
1372        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1373            self.0.request.validate_only = v.into();
1374            self
1375        }
1376
1377        /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
1378        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1379            self.0.request.force = v.into();
1380            self
1381        }
1382    }
1383
1384    #[doc(hidden)]
1385    impl gax::options::internal::RequestBuilder for UpdateStream {
1386        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1387            &mut self.0.options
1388        }
1389    }
1390
1391    /// The request builder for [Datastream::delete_stream][crate::client::Datastream::delete_stream] calls.
1392    ///
1393    /// # Example
1394    /// ```no_run
1395    /// # use google_cloud_datastream_v1::builder;
1396    /// use builder::datastream::DeleteStream;
1397    /// # tokio_test::block_on(async {
1398    /// use lro::Poller;
1399    ///
1400    /// let builder = prepare_request_builder();
1401    /// let response = builder.poller().until_done().await?;
1402    /// # gax::Result::<()>::Ok(()) });
1403    ///
1404    /// fn prepare_request_builder() -> DeleteStream {
1405    ///   # panic!();
1406    ///   // ... details omitted ...
1407    /// }
1408    /// ```
1409    #[derive(Clone, Debug)]
1410    pub struct DeleteStream(RequestBuilder<crate::model::DeleteStreamRequest>);
1411
1412    impl DeleteStream {
1413        pub(crate) fn new(
1414            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1415        ) -> Self {
1416            Self(RequestBuilder::new(stub))
1417        }
1418
1419        /// Sets the full request, replacing any prior values.
1420        pub fn with_request<V: Into<crate::model::DeleteStreamRequest>>(mut self, v: V) -> Self {
1421            self.0.request = v.into();
1422            self
1423        }
1424
1425        /// Sets all the options, replacing any prior values.
1426        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1427            self.0.options = v.into();
1428            self
1429        }
1430
1431        /// Sends the request.
1432        ///
1433        /// # Long running operations
1434        ///
1435        /// This starts, but does not poll, a longrunning operation. More information
1436        /// on [delete_stream][crate::client::Datastream::delete_stream].
1437        pub async fn send(self) -> Result<longrunning::model::Operation> {
1438            (*self.0.stub)
1439                .delete_stream(self.0.request, self.0.options)
1440                .await
1441                .map(gax::response::Response::into_body)
1442        }
1443
1444        /// Creates a [Poller][lro::Poller] to work with `delete_stream`.
1445        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
1446            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1447            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1448            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1449
1450            let stub = self.0.stub.clone();
1451            let mut options = self.0.options.clone();
1452            options.set_retry_policy(gax::retry_policy::NeverRetry);
1453            let query = move |name| {
1454                let stub = stub.clone();
1455                let options = options.clone();
1456                async {
1457                    let op = GetOperation::new(stub)
1458                        .set_name(name)
1459                        .with_options(options)
1460                        .send()
1461                        .await?;
1462                    Ok(Operation::new(op))
1463                }
1464            };
1465
1466            let start = move || async {
1467                let op = self.send().await?;
1468                Ok(Operation::new(op))
1469            };
1470
1471            lro::internal::new_unit_response_poller(
1472                polling_error_policy,
1473                polling_backoff_policy,
1474                start,
1475                query,
1476            )
1477        }
1478
1479        /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
1480        ///
1481        /// This is a **required** field for requests.
1482        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1483            self.0.request.name = v.into();
1484            self
1485        }
1486
1487        /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
1488        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1489            self.0.request.request_id = v.into();
1490            self
1491        }
1492    }
1493
1494    #[doc(hidden)]
1495    impl gax::options::internal::RequestBuilder for DeleteStream {
1496        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1497            &mut self.0.options
1498        }
1499    }
1500
1501    /// The request builder for [Datastream::run_stream][crate::client::Datastream::run_stream] calls.
1502    ///
1503    /// # Example
1504    /// ```no_run
1505    /// # use google_cloud_datastream_v1::builder;
1506    /// use builder::datastream::RunStream;
1507    /// # tokio_test::block_on(async {
1508    /// use lro::Poller;
1509    ///
1510    /// let builder = prepare_request_builder();
1511    /// let response = builder.poller().until_done().await?;
1512    /// # gax::Result::<()>::Ok(()) });
1513    ///
1514    /// fn prepare_request_builder() -> RunStream {
1515    ///   # panic!();
1516    ///   // ... details omitted ...
1517    /// }
1518    /// ```
1519    #[derive(Clone, Debug)]
1520    pub struct RunStream(RequestBuilder<crate::model::RunStreamRequest>);
1521
1522    impl RunStream {
1523        pub(crate) fn new(
1524            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1525        ) -> Self {
1526            Self(RequestBuilder::new(stub))
1527        }
1528
1529        /// Sets the full request, replacing any prior values.
1530        pub fn with_request<V: Into<crate::model::RunStreamRequest>>(mut self, v: V) -> Self {
1531            self.0.request = v.into();
1532            self
1533        }
1534
1535        /// Sets all the options, replacing any prior values.
1536        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1537            self.0.options = v.into();
1538            self
1539        }
1540
1541        /// Sends the request.
1542        ///
1543        /// # Long running operations
1544        ///
1545        /// This starts, but does not poll, a longrunning operation. More information
1546        /// on [run_stream][crate::client::Datastream::run_stream].
1547        pub async fn send(self) -> Result<longrunning::model::Operation> {
1548            (*self.0.stub)
1549                .run_stream(self.0.request, self.0.options)
1550                .await
1551                .map(gax::response::Response::into_body)
1552        }
1553
1554        /// Creates a [Poller][lro::Poller] to work with `run_stream`.
1555        pub fn poller(
1556            self,
1557        ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1558            type Operation =
1559                lro::internal::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1560            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1561            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1562
1563            let stub = self.0.stub.clone();
1564            let mut options = self.0.options.clone();
1565            options.set_retry_policy(gax::retry_policy::NeverRetry);
1566            let query = move |name| {
1567                let stub = stub.clone();
1568                let options = options.clone();
1569                async {
1570                    let op = GetOperation::new(stub)
1571                        .set_name(name)
1572                        .with_options(options)
1573                        .send()
1574                        .await?;
1575                    Ok(Operation::new(op))
1576                }
1577            };
1578
1579            let start = move || async {
1580                let op = self.send().await?;
1581                Ok(Operation::new(op))
1582            };
1583
1584            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1585        }
1586
1587        /// Sets the value of [name][crate::model::RunStreamRequest::name].
1588        ///
1589        /// This is a **required** field for requests.
1590        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1591            self.0.request.name = v.into();
1592            self
1593        }
1594
1595        /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1596        pub fn set_cdc_strategy<T>(mut self, v: T) -> Self
1597        where
1598            T: std::convert::Into<crate::model::CdcStrategy>,
1599        {
1600            self.0.request.cdc_strategy = std::option::Option::Some(v.into());
1601            self
1602        }
1603
1604        /// Sets or clears the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1605        pub fn set_or_clear_cdc_strategy<T>(mut self, v: std::option::Option<T>) -> Self
1606        where
1607            T: std::convert::Into<crate::model::CdcStrategy>,
1608        {
1609            self.0.request.cdc_strategy = v.map(|x| x.into());
1610            self
1611        }
1612
1613        /// Sets the value of [force][crate::model::RunStreamRequest::force].
1614        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1615            self.0.request.force = v.into();
1616            self
1617        }
1618    }
1619
1620    #[doc(hidden)]
1621    impl gax::options::internal::RequestBuilder for RunStream {
1622        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1623            &mut self.0.options
1624        }
1625    }
1626
1627    /// The request builder for [Datastream::get_stream_object][crate::client::Datastream::get_stream_object] calls.
1628    ///
1629    /// # Example
1630    /// ```no_run
1631    /// # use google_cloud_datastream_v1::builder;
1632    /// use builder::datastream::GetStreamObject;
1633    /// # tokio_test::block_on(async {
1634    ///
1635    /// let builder = prepare_request_builder();
1636    /// let response = builder.send().await?;
1637    /// # gax::Result::<()>::Ok(()) });
1638    ///
1639    /// fn prepare_request_builder() -> GetStreamObject {
1640    ///   # panic!();
1641    ///   // ... details omitted ...
1642    /// }
1643    /// ```
1644    #[derive(Clone, Debug)]
1645    pub struct GetStreamObject(RequestBuilder<crate::model::GetStreamObjectRequest>);
1646
1647    impl GetStreamObject {
1648        pub(crate) fn new(
1649            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1650        ) -> Self {
1651            Self(RequestBuilder::new(stub))
1652        }
1653
1654        /// Sets the full request, replacing any prior values.
1655        pub fn with_request<V: Into<crate::model::GetStreamObjectRequest>>(mut self, v: V) -> Self {
1656            self.0.request = v.into();
1657            self
1658        }
1659
1660        /// Sets all the options, replacing any prior values.
1661        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1662            self.0.options = v.into();
1663            self
1664        }
1665
1666        /// Sends the request.
1667        pub async fn send(self) -> Result<crate::model::StreamObject> {
1668            (*self.0.stub)
1669                .get_stream_object(self.0.request, self.0.options)
1670                .await
1671                .map(gax::response::Response::into_body)
1672        }
1673
1674        /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
1675        ///
1676        /// This is a **required** field for requests.
1677        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1678            self.0.request.name = v.into();
1679            self
1680        }
1681    }
1682
1683    #[doc(hidden)]
1684    impl gax::options::internal::RequestBuilder for GetStreamObject {
1685        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1686            &mut self.0.options
1687        }
1688    }
1689
1690    /// The request builder for [Datastream::lookup_stream_object][crate::client::Datastream::lookup_stream_object] calls.
1691    ///
1692    /// # Example
1693    /// ```no_run
1694    /// # use google_cloud_datastream_v1::builder;
1695    /// use builder::datastream::LookupStreamObject;
1696    /// # tokio_test::block_on(async {
1697    ///
1698    /// let builder = prepare_request_builder();
1699    /// let response = builder.send().await?;
1700    /// # gax::Result::<()>::Ok(()) });
1701    ///
1702    /// fn prepare_request_builder() -> LookupStreamObject {
1703    ///   # panic!();
1704    ///   // ... details omitted ...
1705    /// }
1706    /// ```
1707    #[derive(Clone, Debug)]
1708    pub struct LookupStreamObject(RequestBuilder<crate::model::LookupStreamObjectRequest>);
1709
1710    impl LookupStreamObject {
1711        pub(crate) fn new(
1712            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1713        ) -> Self {
1714            Self(RequestBuilder::new(stub))
1715        }
1716
1717        /// Sets the full request, replacing any prior values.
1718        pub fn with_request<V: Into<crate::model::LookupStreamObjectRequest>>(
1719            mut self,
1720            v: V,
1721        ) -> Self {
1722            self.0.request = v.into();
1723            self
1724        }
1725
1726        /// Sets all the options, replacing any prior values.
1727        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1728            self.0.options = v.into();
1729            self
1730        }
1731
1732        /// Sends the request.
1733        pub async fn send(self) -> Result<crate::model::StreamObject> {
1734            (*self.0.stub)
1735                .lookup_stream_object(self.0.request, self.0.options)
1736                .await
1737                .map(gax::response::Response::into_body)
1738        }
1739
1740        /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
1741        ///
1742        /// This is a **required** field for requests.
1743        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1744            self.0.request.parent = v.into();
1745            self
1746        }
1747
1748        /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1749        ///
1750        /// This is a **required** field for requests.
1751        pub fn set_source_object_identifier<T>(mut self, v: T) -> Self
1752        where
1753            T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1754        {
1755            self.0.request.source_object_identifier = std::option::Option::Some(v.into());
1756            self
1757        }
1758
1759        /// Sets or clears the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1760        ///
1761        /// This is a **required** field for requests.
1762        pub fn set_or_clear_source_object_identifier<T>(mut self, v: std::option::Option<T>) -> Self
1763        where
1764            T: std::convert::Into<crate::model::SourceObjectIdentifier>,
1765        {
1766            self.0.request.source_object_identifier = v.map(|x| x.into());
1767            self
1768        }
1769    }
1770
1771    #[doc(hidden)]
1772    impl gax::options::internal::RequestBuilder for LookupStreamObject {
1773        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1774            &mut self.0.options
1775        }
1776    }
1777
1778    /// The request builder for [Datastream::list_stream_objects][crate::client::Datastream::list_stream_objects] calls.
1779    ///
1780    /// # Example
1781    /// ```no_run
1782    /// # use google_cloud_datastream_v1::builder;
1783    /// use builder::datastream::ListStreamObjects;
1784    /// # tokio_test::block_on(async {
1785    /// use gax::paginator::ItemPaginator;
1786    ///
1787    /// let builder = prepare_request_builder();
1788    /// let mut items = builder.by_item();
1789    /// while let Some(result) = items.next().await {
1790    ///   let item = result?;
1791    /// }
1792    /// # gax::Result::<()>::Ok(()) });
1793    ///
1794    /// fn prepare_request_builder() -> ListStreamObjects {
1795    ///   # panic!();
1796    ///   // ... details omitted ...
1797    /// }
1798    /// ```
1799    #[derive(Clone, Debug)]
1800    pub struct ListStreamObjects(RequestBuilder<crate::model::ListStreamObjectsRequest>);
1801
1802    impl ListStreamObjects {
1803        pub(crate) fn new(
1804            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1805        ) -> Self {
1806            Self(RequestBuilder::new(stub))
1807        }
1808
1809        /// Sets the full request, replacing any prior values.
1810        pub fn with_request<V: Into<crate::model::ListStreamObjectsRequest>>(
1811            mut self,
1812            v: V,
1813        ) -> Self {
1814            self.0.request = v.into();
1815            self
1816        }
1817
1818        /// Sets all the options, replacing any prior values.
1819        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1820            self.0.options = v.into();
1821            self
1822        }
1823
1824        /// Sends the request.
1825        pub async fn send(self) -> Result<crate::model::ListStreamObjectsResponse> {
1826            (*self.0.stub)
1827                .list_stream_objects(self.0.request, self.0.options)
1828                .await
1829                .map(gax::response::Response::into_body)
1830        }
1831
1832        /// Streams each page in the collection.
1833        pub fn by_page(
1834            self,
1835        ) -> impl gax::paginator::Paginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1836        {
1837            use std::clone::Clone;
1838            let token = self.0.request.page_token.clone();
1839            let execute = move |token: String| {
1840                let mut builder = self.clone();
1841                builder.0.request = builder.0.request.set_page_token(token);
1842                builder.send()
1843            };
1844            gax::paginator::internal::new_paginator(token, execute)
1845        }
1846
1847        /// Streams each item in the collection.
1848        pub fn by_item(
1849            self,
1850        ) -> impl gax::paginator::ItemPaginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1851        {
1852            use gax::paginator::Paginator;
1853            self.by_page().items()
1854        }
1855
1856        /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
1857        ///
1858        /// This is a **required** field for requests.
1859        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1860            self.0.request.parent = v.into();
1861            self
1862        }
1863
1864        /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
1865        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1866            self.0.request.page_size = v.into();
1867            self
1868        }
1869
1870        /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
1871        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1872            self.0.request.page_token = v.into();
1873            self
1874        }
1875    }
1876
1877    #[doc(hidden)]
1878    impl gax::options::internal::RequestBuilder for ListStreamObjects {
1879        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1880            &mut self.0.options
1881        }
1882    }
1883
1884    /// The request builder for [Datastream::start_backfill_job][crate::client::Datastream::start_backfill_job] calls.
1885    ///
1886    /// # Example
1887    /// ```no_run
1888    /// # use google_cloud_datastream_v1::builder;
1889    /// use builder::datastream::StartBackfillJob;
1890    /// # tokio_test::block_on(async {
1891    ///
1892    /// let builder = prepare_request_builder();
1893    /// let response = builder.send().await?;
1894    /// # gax::Result::<()>::Ok(()) });
1895    ///
1896    /// fn prepare_request_builder() -> StartBackfillJob {
1897    ///   # panic!();
1898    ///   // ... details omitted ...
1899    /// }
1900    /// ```
1901    #[derive(Clone, Debug)]
1902    pub struct StartBackfillJob(RequestBuilder<crate::model::StartBackfillJobRequest>);
1903
1904    impl StartBackfillJob {
1905        pub(crate) fn new(
1906            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1907        ) -> Self {
1908            Self(RequestBuilder::new(stub))
1909        }
1910
1911        /// Sets the full request, replacing any prior values.
1912        pub fn with_request<V: Into<crate::model::StartBackfillJobRequest>>(
1913            mut self,
1914            v: V,
1915        ) -> Self {
1916            self.0.request = v.into();
1917            self
1918        }
1919
1920        /// Sets all the options, replacing any prior values.
1921        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1922            self.0.options = v.into();
1923            self
1924        }
1925
1926        /// Sends the request.
1927        pub async fn send(self) -> Result<crate::model::StartBackfillJobResponse> {
1928            (*self.0.stub)
1929                .start_backfill_job(self.0.request, self.0.options)
1930                .await
1931                .map(gax::response::Response::into_body)
1932        }
1933
1934        /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
1935        ///
1936        /// This is a **required** field for requests.
1937        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1938            self.0.request.object = v.into();
1939            self
1940        }
1941    }
1942
1943    #[doc(hidden)]
1944    impl gax::options::internal::RequestBuilder for StartBackfillJob {
1945        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1946            &mut self.0.options
1947        }
1948    }
1949
1950    /// The request builder for [Datastream::stop_backfill_job][crate::client::Datastream::stop_backfill_job] calls.
1951    ///
1952    /// # Example
1953    /// ```no_run
1954    /// # use google_cloud_datastream_v1::builder;
1955    /// use builder::datastream::StopBackfillJob;
1956    /// # tokio_test::block_on(async {
1957    ///
1958    /// let builder = prepare_request_builder();
1959    /// let response = builder.send().await?;
1960    /// # gax::Result::<()>::Ok(()) });
1961    ///
1962    /// fn prepare_request_builder() -> StopBackfillJob {
1963    ///   # panic!();
1964    ///   // ... details omitted ...
1965    /// }
1966    /// ```
1967    #[derive(Clone, Debug)]
1968    pub struct StopBackfillJob(RequestBuilder<crate::model::StopBackfillJobRequest>);
1969
1970    impl StopBackfillJob {
1971        pub(crate) fn new(
1972            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
1973        ) -> Self {
1974            Self(RequestBuilder::new(stub))
1975        }
1976
1977        /// Sets the full request, replacing any prior values.
1978        pub fn with_request<V: Into<crate::model::StopBackfillJobRequest>>(mut self, v: V) -> Self {
1979            self.0.request = v.into();
1980            self
1981        }
1982
1983        /// Sets all the options, replacing any prior values.
1984        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1985            self.0.options = v.into();
1986            self
1987        }
1988
1989        /// Sends the request.
1990        pub async fn send(self) -> Result<crate::model::StopBackfillJobResponse> {
1991            (*self.0.stub)
1992                .stop_backfill_job(self.0.request, self.0.options)
1993                .await
1994                .map(gax::response::Response::into_body)
1995        }
1996
1997        /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
1998        ///
1999        /// This is a **required** field for requests.
2000        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
2001            self.0.request.object = v.into();
2002            self
2003        }
2004    }
2005
2006    #[doc(hidden)]
2007    impl gax::options::internal::RequestBuilder for StopBackfillJob {
2008        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2009            &mut self.0.options
2010        }
2011    }
2012
2013    /// The request builder for [Datastream::fetch_static_ips][crate::client::Datastream::fetch_static_ips] calls.
2014    ///
2015    /// # Example
2016    /// ```no_run
2017    /// # use google_cloud_datastream_v1::builder;
2018    /// use builder::datastream::FetchStaticIps;
2019    /// # tokio_test::block_on(async {
2020    ///
2021    /// let builder = prepare_request_builder();
2022    /// let response = builder.send().await?;
2023    /// # gax::Result::<()>::Ok(()) });
2024    ///
2025    /// fn prepare_request_builder() -> FetchStaticIps {
2026    ///   # panic!();
2027    ///   // ... details omitted ...
2028    /// }
2029    /// ```
2030    #[derive(Clone, Debug)]
2031    pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
2032
2033    impl FetchStaticIps {
2034        pub(crate) fn new(
2035            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2036        ) -> Self {
2037            Self(RequestBuilder::new(stub))
2038        }
2039
2040        /// Sets the full request, replacing any prior values.
2041        pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
2042            self.0.request = v.into();
2043            self
2044        }
2045
2046        /// Sets all the options, replacing any prior values.
2047        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2048            self.0.options = v.into();
2049            self
2050        }
2051
2052        /// Sends the request.
2053        pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
2054            (*self.0.stub)
2055                .fetch_static_ips(self.0.request, self.0.options)
2056                .await
2057                .map(gax::response::Response::into_body)
2058        }
2059
2060        /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
2061        ///
2062        /// This is a **required** field for requests.
2063        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2064            self.0.request.name = v.into();
2065            self
2066        }
2067
2068        /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
2069        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2070            self.0.request.page_size = v.into();
2071            self
2072        }
2073
2074        /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
2075        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2076            self.0.request.page_token = v.into();
2077            self
2078        }
2079    }
2080
2081    #[doc(hidden)]
2082    impl gax::options::internal::RequestBuilder for FetchStaticIps {
2083        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2084            &mut self.0.options
2085        }
2086    }
2087
2088    /// The request builder for [Datastream::create_private_connection][crate::client::Datastream::create_private_connection] calls.
2089    ///
2090    /// # Example
2091    /// ```no_run
2092    /// # use google_cloud_datastream_v1::builder;
2093    /// use builder::datastream::CreatePrivateConnection;
2094    /// # tokio_test::block_on(async {
2095    /// use lro::Poller;
2096    ///
2097    /// let builder = prepare_request_builder();
2098    /// let response = builder.poller().until_done().await?;
2099    /// # gax::Result::<()>::Ok(()) });
2100    ///
2101    /// fn prepare_request_builder() -> CreatePrivateConnection {
2102    ///   # panic!();
2103    ///   // ... details omitted ...
2104    /// }
2105    /// ```
2106    #[derive(Clone, Debug)]
2107    pub struct CreatePrivateConnection(
2108        RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
2109    );
2110
2111    impl CreatePrivateConnection {
2112        pub(crate) fn new(
2113            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2114        ) -> Self {
2115            Self(RequestBuilder::new(stub))
2116        }
2117
2118        /// Sets the full request, replacing any prior values.
2119        pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
2120            mut self,
2121            v: V,
2122        ) -> Self {
2123            self.0.request = v.into();
2124            self
2125        }
2126
2127        /// Sets all the options, replacing any prior values.
2128        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2129            self.0.options = v.into();
2130            self
2131        }
2132
2133        /// Sends the request.
2134        ///
2135        /// # Long running operations
2136        ///
2137        /// This starts, but does not poll, a longrunning operation. More information
2138        /// on [create_private_connection][crate::client::Datastream::create_private_connection].
2139        pub async fn send(self) -> Result<longrunning::model::Operation> {
2140            (*self.0.stub)
2141                .create_private_connection(self.0.request, self.0.options)
2142                .await
2143                .map(gax::response::Response::into_body)
2144        }
2145
2146        /// Creates a [Poller][lro::Poller] to work with `create_private_connection`.
2147        pub fn poller(
2148            self,
2149        ) -> impl lro::Poller<crate::model::PrivateConnection, crate::model::OperationMetadata>
2150        {
2151            type Operation = lro::internal::Operation<
2152                crate::model::PrivateConnection,
2153                crate::model::OperationMetadata,
2154            >;
2155            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2156            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2157
2158            let stub = self.0.stub.clone();
2159            let mut options = self.0.options.clone();
2160            options.set_retry_policy(gax::retry_policy::NeverRetry);
2161            let query = move |name| {
2162                let stub = stub.clone();
2163                let options = options.clone();
2164                async {
2165                    let op = GetOperation::new(stub)
2166                        .set_name(name)
2167                        .with_options(options)
2168                        .send()
2169                        .await?;
2170                    Ok(Operation::new(op))
2171                }
2172            };
2173
2174            let start = move || async {
2175                let op = self.send().await?;
2176                Ok(Operation::new(op))
2177            };
2178
2179            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2180        }
2181
2182        /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
2183        ///
2184        /// This is a **required** field for requests.
2185        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2186            self.0.request.parent = v.into();
2187            self
2188        }
2189
2190        /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
2191        ///
2192        /// This is a **required** field for requests.
2193        pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2194            self.0.request.private_connection_id = v.into();
2195            self
2196        }
2197
2198        /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2199        ///
2200        /// This is a **required** field for requests.
2201        pub fn set_private_connection<T>(mut self, v: T) -> Self
2202        where
2203            T: std::convert::Into<crate::model::PrivateConnection>,
2204        {
2205            self.0.request.private_connection = std::option::Option::Some(v.into());
2206            self
2207        }
2208
2209        /// Sets or clears the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
2210        ///
2211        /// This is a **required** field for requests.
2212        pub fn set_or_clear_private_connection<T>(mut self, v: std::option::Option<T>) -> Self
2213        where
2214            T: std::convert::Into<crate::model::PrivateConnection>,
2215        {
2216            self.0.request.private_connection = v.map(|x| x.into());
2217            self
2218        }
2219
2220        /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
2221        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2222            self.0.request.request_id = v.into();
2223            self
2224        }
2225
2226        /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
2227        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2228            self.0.request.force = v.into();
2229            self
2230        }
2231    }
2232
2233    #[doc(hidden)]
2234    impl gax::options::internal::RequestBuilder for CreatePrivateConnection {
2235        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2236            &mut self.0.options
2237        }
2238    }
2239
2240    /// The request builder for [Datastream::get_private_connection][crate::client::Datastream::get_private_connection] calls.
2241    ///
2242    /// # Example
2243    /// ```no_run
2244    /// # use google_cloud_datastream_v1::builder;
2245    /// use builder::datastream::GetPrivateConnection;
2246    /// # tokio_test::block_on(async {
2247    ///
2248    /// let builder = prepare_request_builder();
2249    /// let response = builder.send().await?;
2250    /// # gax::Result::<()>::Ok(()) });
2251    ///
2252    /// fn prepare_request_builder() -> GetPrivateConnection {
2253    ///   # panic!();
2254    ///   // ... details omitted ...
2255    /// }
2256    /// ```
2257    #[derive(Clone, Debug)]
2258    pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
2259
2260    impl GetPrivateConnection {
2261        pub(crate) fn new(
2262            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2263        ) -> Self {
2264            Self(RequestBuilder::new(stub))
2265        }
2266
2267        /// Sets the full request, replacing any prior values.
2268        pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
2269            mut self,
2270            v: V,
2271        ) -> Self {
2272            self.0.request = v.into();
2273            self
2274        }
2275
2276        /// Sets all the options, replacing any prior values.
2277        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2278            self.0.options = v.into();
2279            self
2280        }
2281
2282        /// Sends the request.
2283        pub async fn send(self) -> Result<crate::model::PrivateConnection> {
2284            (*self.0.stub)
2285                .get_private_connection(self.0.request, self.0.options)
2286                .await
2287                .map(gax::response::Response::into_body)
2288        }
2289
2290        /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
2291        ///
2292        /// This is a **required** field for requests.
2293        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294            self.0.request.name = v.into();
2295            self
2296        }
2297    }
2298
2299    #[doc(hidden)]
2300    impl gax::options::internal::RequestBuilder for GetPrivateConnection {
2301        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2302            &mut self.0.options
2303        }
2304    }
2305
2306    /// The request builder for [Datastream::list_private_connections][crate::client::Datastream::list_private_connections] calls.
2307    ///
2308    /// # Example
2309    /// ```no_run
2310    /// # use google_cloud_datastream_v1::builder;
2311    /// use builder::datastream::ListPrivateConnections;
2312    /// # tokio_test::block_on(async {
2313    /// use gax::paginator::ItemPaginator;
2314    ///
2315    /// let builder = prepare_request_builder();
2316    /// let mut items = builder.by_item();
2317    /// while let Some(result) = items.next().await {
2318    ///   let item = result?;
2319    /// }
2320    /// # gax::Result::<()>::Ok(()) });
2321    ///
2322    /// fn prepare_request_builder() -> ListPrivateConnections {
2323    ///   # panic!();
2324    ///   // ... details omitted ...
2325    /// }
2326    /// ```
2327    #[derive(Clone, Debug)]
2328    pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
2329
2330    impl ListPrivateConnections {
2331        pub(crate) fn new(
2332            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2333        ) -> Self {
2334            Self(RequestBuilder::new(stub))
2335        }
2336
2337        /// Sets the full request, replacing any prior values.
2338        pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
2339            mut self,
2340            v: V,
2341        ) -> Self {
2342            self.0.request = v.into();
2343            self
2344        }
2345
2346        /// Sets all the options, replacing any prior values.
2347        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2348            self.0.options = v.into();
2349            self
2350        }
2351
2352        /// Sends the request.
2353        pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
2354            (*self.0.stub)
2355                .list_private_connections(self.0.request, self.0.options)
2356                .await
2357                .map(gax::response::Response::into_body)
2358        }
2359
2360        /// Streams each page in the collection.
2361        pub fn by_page(
2362            self,
2363        ) -> impl gax::paginator::Paginator<
2364            crate::model::ListPrivateConnectionsResponse,
2365            gax::error::Error,
2366        > {
2367            use std::clone::Clone;
2368            let token = self.0.request.page_token.clone();
2369            let execute = move |token: String| {
2370                let mut builder = self.clone();
2371                builder.0.request = builder.0.request.set_page_token(token);
2372                builder.send()
2373            };
2374            gax::paginator::internal::new_paginator(token, execute)
2375        }
2376
2377        /// Streams each item in the collection.
2378        pub fn by_item(
2379            self,
2380        ) -> impl gax::paginator::ItemPaginator<
2381            crate::model::ListPrivateConnectionsResponse,
2382            gax::error::Error,
2383        > {
2384            use gax::paginator::Paginator;
2385            self.by_page().items()
2386        }
2387
2388        /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
2389        ///
2390        /// This is a **required** field for requests.
2391        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2392            self.0.request.parent = v.into();
2393            self
2394        }
2395
2396        /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
2397        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2398            self.0.request.page_size = v.into();
2399            self
2400        }
2401
2402        /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
2403        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2404            self.0.request.page_token = v.into();
2405            self
2406        }
2407
2408        /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
2409        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2410            self.0.request.filter = v.into();
2411            self
2412        }
2413
2414        /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
2415        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2416            self.0.request.order_by = v.into();
2417            self
2418        }
2419    }
2420
2421    #[doc(hidden)]
2422    impl gax::options::internal::RequestBuilder for ListPrivateConnections {
2423        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2424            &mut self.0.options
2425        }
2426    }
2427
2428    /// The request builder for [Datastream::delete_private_connection][crate::client::Datastream::delete_private_connection] calls.
2429    ///
2430    /// # Example
2431    /// ```no_run
2432    /// # use google_cloud_datastream_v1::builder;
2433    /// use builder::datastream::DeletePrivateConnection;
2434    /// # tokio_test::block_on(async {
2435    /// use lro::Poller;
2436    ///
2437    /// let builder = prepare_request_builder();
2438    /// let response = builder.poller().until_done().await?;
2439    /// # gax::Result::<()>::Ok(()) });
2440    ///
2441    /// fn prepare_request_builder() -> DeletePrivateConnection {
2442    ///   # panic!();
2443    ///   // ... details omitted ...
2444    /// }
2445    /// ```
2446    #[derive(Clone, Debug)]
2447    pub struct DeletePrivateConnection(
2448        RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
2449    );
2450
2451    impl DeletePrivateConnection {
2452        pub(crate) fn new(
2453            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2454        ) -> Self {
2455            Self(RequestBuilder::new(stub))
2456        }
2457
2458        /// Sets the full request, replacing any prior values.
2459        pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
2460            mut self,
2461            v: V,
2462        ) -> Self {
2463            self.0.request = v.into();
2464            self
2465        }
2466
2467        /// Sets all the options, replacing any prior values.
2468        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2469            self.0.options = v.into();
2470            self
2471        }
2472
2473        /// Sends the request.
2474        ///
2475        /// # Long running operations
2476        ///
2477        /// This starts, but does not poll, a longrunning operation. More information
2478        /// on [delete_private_connection][crate::client::Datastream::delete_private_connection].
2479        pub async fn send(self) -> Result<longrunning::model::Operation> {
2480            (*self.0.stub)
2481                .delete_private_connection(self.0.request, self.0.options)
2482                .await
2483                .map(gax::response::Response::into_body)
2484        }
2485
2486        /// Creates a [Poller][lro::Poller] to work with `delete_private_connection`.
2487        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2488            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2489            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2490            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2491
2492            let stub = self.0.stub.clone();
2493            let mut options = self.0.options.clone();
2494            options.set_retry_policy(gax::retry_policy::NeverRetry);
2495            let query = move |name| {
2496                let stub = stub.clone();
2497                let options = options.clone();
2498                async {
2499                    let op = GetOperation::new(stub)
2500                        .set_name(name)
2501                        .with_options(options)
2502                        .send()
2503                        .await?;
2504                    Ok(Operation::new(op))
2505                }
2506            };
2507
2508            let start = move || async {
2509                let op = self.send().await?;
2510                Ok(Operation::new(op))
2511            };
2512
2513            lro::internal::new_unit_response_poller(
2514                polling_error_policy,
2515                polling_backoff_policy,
2516                start,
2517                query,
2518            )
2519        }
2520
2521        /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
2522        ///
2523        /// This is a **required** field for requests.
2524        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2525            self.0.request.name = v.into();
2526            self
2527        }
2528
2529        /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
2530        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2531            self.0.request.request_id = v.into();
2532            self
2533        }
2534
2535        /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
2536        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2537            self.0.request.force = v.into();
2538            self
2539        }
2540    }
2541
2542    #[doc(hidden)]
2543    impl gax::options::internal::RequestBuilder for DeletePrivateConnection {
2544        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2545            &mut self.0.options
2546        }
2547    }
2548
2549    /// The request builder for [Datastream::create_route][crate::client::Datastream::create_route] calls.
2550    ///
2551    /// # Example
2552    /// ```no_run
2553    /// # use google_cloud_datastream_v1::builder;
2554    /// use builder::datastream::CreateRoute;
2555    /// # tokio_test::block_on(async {
2556    /// use lro::Poller;
2557    ///
2558    /// let builder = prepare_request_builder();
2559    /// let response = builder.poller().until_done().await?;
2560    /// # gax::Result::<()>::Ok(()) });
2561    ///
2562    /// fn prepare_request_builder() -> CreateRoute {
2563    ///   # panic!();
2564    ///   // ... details omitted ...
2565    /// }
2566    /// ```
2567    #[derive(Clone, Debug)]
2568    pub struct CreateRoute(RequestBuilder<crate::model::CreateRouteRequest>);
2569
2570    impl CreateRoute {
2571        pub(crate) fn new(
2572            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2573        ) -> Self {
2574            Self(RequestBuilder::new(stub))
2575        }
2576
2577        /// Sets the full request, replacing any prior values.
2578        pub fn with_request<V: Into<crate::model::CreateRouteRequest>>(mut self, v: V) -> Self {
2579            self.0.request = v.into();
2580            self
2581        }
2582
2583        /// Sets all the options, replacing any prior values.
2584        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2585            self.0.options = v.into();
2586            self
2587        }
2588
2589        /// Sends the request.
2590        ///
2591        /// # Long running operations
2592        ///
2593        /// This starts, but does not poll, a longrunning operation. More information
2594        /// on [create_route][crate::client::Datastream::create_route].
2595        pub async fn send(self) -> Result<longrunning::model::Operation> {
2596            (*self.0.stub)
2597                .create_route(self.0.request, self.0.options)
2598                .await
2599                .map(gax::response::Response::into_body)
2600        }
2601
2602        /// Creates a [Poller][lro::Poller] to work with `create_route`.
2603        pub fn poller(
2604            self,
2605        ) -> impl lro::Poller<crate::model::Route, crate::model::OperationMetadata> {
2606            type Operation =
2607                lro::internal::Operation<crate::model::Route, crate::model::OperationMetadata>;
2608            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2609            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2610
2611            let stub = self.0.stub.clone();
2612            let mut options = self.0.options.clone();
2613            options.set_retry_policy(gax::retry_policy::NeverRetry);
2614            let query = move |name| {
2615                let stub = stub.clone();
2616                let options = options.clone();
2617                async {
2618                    let op = GetOperation::new(stub)
2619                        .set_name(name)
2620                        .with_options(options)
2621                        .send()
2622                        .await?;
2623                    Ok(Operation::new(op))
2624                }
2625            };
2626
2627            let start = move || async {
2628                let op = self.send().await?;
2629                Ok(Operation::new(op))
2630            };
2631
2632            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2633        }
2634
2635        /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
2636        ///
2637        /// This is a **required** field for requests.
2638        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2639            self.0.request.parent = v.into();
2640            self
2641        }
2642
2643        /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
2644        ///
2645        /// This is a **required** field for requests.
2646        pub fn set_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2647            self.0.request.route_id = v.into();
2648            self
2649        }
2650
2651        /// Sets the value of [route][crate::model::CreateRouteRequest::route].
2652        ///
2653        /// This is a **required** field for requests.
2654        pub fn set_route<T>(mut self, v: T) -> Self
2655        where
2656            T: std::convert::Into<crate::model::Route>,
2657        {
2658            self.0.request.route = std::option::Option::Some(v.into());
2659            self
2660        }
2661
2662        /// Sets or clears the value of [route][crate::model::CreateRouteRequest::route].
2663        ///
2664        /// This is a **required** field for requests.
2665        pub fn set_or_clear_route<T>(mut self, v: std::option::Option<T>) -> Self
2666        where
2667            T: std::convert::Into<crate::model::Route>,
2668        {
2669            self.0.request.route = v.map(|x| x.into());
2670            self
2671        }
2672
2673        /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
2674        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2675            self.0.request.request_id = v.into();
2676            self
2677        }
2678    }
2679
2680    #[doc(hidden)]
2681    impl gax::options::internal::RequestBuilder for CreateRoute {
2682        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2683            &mut self.0.options
2684        }
2685    }
2686
2687    /// The request builder for [Datastream::get_route][crate::client::Datastream::get_route] calls.
2688    ///
2689    /// # Example
2690    /// ```no_run
2691    /// # use google_cloud_datastream_v1::builder;
2692    /// use builder::datastream::GetRoute;
2693    /// # tokio_test::block_on(async {
2694    ///
2695    /// let builder = prepare_request_builder();
2696    /// let response = builder.send().await?;
2697    /// # gax::Result::<()>::Ok(()) });
2698    ///
2699    /// fn prepare_request_builder() -> GetRoute {
2700    ///   # panic!();
2701    ///   // ... details omitted ...
2702    /// }
2703    /// ```
2704    #[derive(Clone, Debug)]
2705    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
2706
2707    impl GetRoute {
2708        pub(crate) fn new(
2709            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2710        ) -> Self {
2711            Self(RequestBuilder::new(stub))
2712        }
2713
2714        /// Sets the full request, replacing any prior values.
2715        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
2716            self.0.request = v.into();
2717            self
2718        }
2719
2720        /// Sets all the options, replacing any prior values.
2721        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2722            self.0.options = v.into();
2723            self
2724        }
2725
2726        /// Sends the request.
2727        pub async fn send(self) -> Result<crate::model::Route> {
2728            (*self.0.stub)
2729                .get_route(self.0.request, self.0.options)
2730                .await
2731                .map(gax::response::Response::into_body)
2732        }
2733
2734        /// Sets the value of [name][crate::model::GetRouteRequest::name].
2735        ///
2736        /// This is a **required** field for requests.
2737        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2738            self.0.request.name = v.into();
2739            self
2740        }
2741    }
2742
2743    #[doc(hidden)]
2744    impl gax::options::internal::RequestBuilder for GetRoute {
2745        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2746            &mut self.0.options
2747        }
2748    }
2749
2750    /// The request builder for [Datastream::list_routes][crate::client::Datastream::list_routes] calls.
2751    ///
2752    /// # Example
2753    /// ```no_run
2754    /// # use google_cloud_datastream_v1::builder;
2755    /// use builder::datastream::ListRoutes;
2756    /// # tokio_test::block_on(async {
2757    /// use gax::paginator::ItemPaginator;
2758    ///
2759    /// let builder = prepare_request_builder();
2760    /// let mut items = builder.by_item();
2761    /// while let Some(result) = items.next().await {
2762    ///   let item = result?;
2763    /// }
2764    /// # gax::Result::<()>::Ok(()) });
2765    ///
2766    /// fn prepare_request_builder() -> ListRoutes {
2767    ///   # panic!();
2768    ///   // ... details omitted ...
2769    /// }
2770    /// ```
2771    #[derive(Clone, Debug)]
2772    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
2773
2774    impl ListRoutes {
2775        pub(crate) fn new(
2776            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2777        ) -> Self {
2778            Self(RequestBuilder::new(stub))
2779        }
2780
2781        /// Sets the full request, replacing any prior values.
2782        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
2783            self.0.request = v.into();
2784            self
2785        }
2786
2787        /// Sets all the options, replacing any prior values.
2788        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2789            self.0.options = v.into();
2790            self
2791        }
2792
2793        /// Sends the request.
2794        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
2795            (*self.0.stub)
2796                .list_routes(self.0.request, self.0.options)
2797                .await
2798                .map(gax::response::Response::into_body)
2799        }
2800
2801        /// Streams each page in the collection.
2802        pub fn by_page(
2803            self,
2804        ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
2805        {
2806            use std::clone::Clone;
2807            let token = self.0.request.page_token.clone();
2808            let execute = move |token: String| {
2809                let mut builder = self.clone();
2810                builder.0.request = builder.0.request.set_page_token(token);
2811                builder.send()
2812            };
2813            gax::paginator::internal::new_paginator(token, execute)
2814        }
2815
2816        /// Streams each item in the collection.
2817        pub fn by_item(
2818            self,
2819        ) -> impl gax::paginator::ItemPaginator<crate::model::ListRoutesResponse, gax::error::Error>
2820        {
2821            use gax::paginator::Paginator;
2822            self.by_page().items()
2823        }
2824
2825        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
2826        ///
2827        /// This is a **required** field for requests.
2828        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2829            self.0.request.parent = v.into();
2830            self
2831        }
2832
2833        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
2834        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2835            self.0.request.page_size = v.into();
2836            self
2837        }
2838
2839        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
2840        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2841            self.0.request.page_token = v.into();
2842            self
2843        }
2844
2845        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
2846        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2847            self.0.request.filter = v.into();
2848            self
2849        }
2850
2851        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
2852        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2853            self.0.request.order_by = v.into();
2854            self
2855        }
2856    }
2857
2858    #[doc(hidden)]
2859    impl gax::options::internal::RequestBuilder for ListRoutes {
2860        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2861            &mut self.0.options
2862        }
2863    }
2864
2865    /// The request builder for [Datastream::delete_route][crate::client::Datastream::delete_route] calls.
2866    ///
2867    /// # Example
2868    /// ```no_run
2869    /// # use google_cloud_datastream_v1::builder;
2870    /// use builder::datastream::DeleteRoute;
2871    /// # tokio_test::block_on(async {
2872    /// use lro::Poller;
2873    ///
2874    /// let builder = prepare_request_builder();
2875    /// let response = builder.poller().until_done().await?;
2876    /// # gax::Result::<()>::Ok(()) });
2877    ///
2878    /// fn prepare_request_builder() -> DeleteRoute {
2879    ///   # panic!();
2880    ///   // ... details omitted ...
2881    /// }
2882    /// ```
2883    #[derive(Clone, Debug)]
2884    pub struct DeleteRoute(RequestBuilder<crate::model::DeleteRouteRequest>);
2885
2886    impl DeleteRoute {
2887        pub(crate) fn new(
2888            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
2889        ) -> Self {
2890            Self(RequestBuilder::new(stub))
2891        }
2892
2893        /// Sets the full request, replacing any prior values.
2894        pub fn with_request<V: Into<crate::model::DeleteRouteRequest>>(mut self, v: V) -> Self {
2895            self.0.request = v.into();
2896            self
2897        }
2898
2899        /// Sets all the options, replacing any prior values.
2900        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2901            self.0.options = v.into();
2902            self
2903        }
2904
2905        /// Sends the request.
2906        ///
2907        /// # Long running operations
2908        ///
2909        /// This starts, but does not poll, a longrunning operation. More information
2910        /// on [delete_route][crate::client::Datastream::delete_route].
2911        pub async fn send(self) -> Result<longrunning::model::Operation> {
2912            (*self.0.stub)
2913                .delete_route(self.0.request, self.0.options)
2914                .await
2915                .map(gax::response::Response::into_body)
2916        }
2917
2918        /// Creates a [Poller][lro::Poller] to work with `delete_route`.
2919        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
2920            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2921            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2922            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2923
2924            let stub = self.0.stub.clone();
2925            let mut options = self.0.options.clone();
2926            options.set_retry_policy(gax::retry_policy::NeverRetry);
2927            let query = move |name| {
2928                let stub = stub.clone();
2929                let options = options.clone();
2930                async {
2931                    let op = GetOperation::new(stub)
2932                        .set_name(name)
2933                        .with_options(options)
2934                        .send()
2935                        .await?;
2936                    Ok(Operation::new(op))
2937                }
2938            };
2939
2940            let start = move || async {
2941                let op = self.send().await?;
2942                Ok(Operation::new(op))
2943            };
2944
2945            lro::internal::new_unit_response_poller(
2946                polling_error_policy,
2947                polling_backoff_policy,
2948                start,
2949                query,
2950            )
2951        }
2952
2953        /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
2954        ///
2955        /// This is a **required** field for requests.
2956        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2957            self.0.request.name = v.into();
2958            self
2959        }
2960
2961        /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
2962        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2963            self.0.request.request_id = v.into();
2964            self
2965        }
2966    }
2967
2968    #[doc(hidden)]
2969    impl gax::options::internal::RequestBuilder for DeleteRoute {
2970        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2971            &mut self.0.options
2972        }
2973    }
2974
2975    /// The request builder for [Datastream::list_locations][crate::client::Datastream::list_locations] calls.
2976    ///
2977    /// # Example
2978    /// ```no_run
2979    /// # use google_cloud_datastream_v1::builder;
2980    /// use builder::datastream::ListLocations;
2981    /// # tokio_test::block_on(async {
2982    /// use gax::paginator::ItemPaginator;
2983    ///
2984    /// let builder = prepare_request_builder();
2985    /// let mut items = builder.by_item();
2986    /// while let Some(result) = items.next().await {
2987    ///   let item = result?;
2988    /// }
2989    /// # gax::Result::<()>::Ok(()) });
2990    ///
2991    /// fn prepare_request_builder() -> ListLocations {
2992    ///   # panic!();
2993    ///   // ... details omitted ...
2994    /// }
2995    /// ```
2996    #[derive(Clone, Debug)]
2997    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2998
2999    impl ListLocations {
3000        pub(crate) fn new(
3001            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3002        ) -> Self {
3003            Self(RequestBuilder::new(stub))
3004        }
3005
3006        /// Sets the full request, replacing any prior values.
3007        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
3008            mut self,
3009            v: V,
3010        ) -> Self {
3011            self.0.request = v.into();
3012            self
3013        }
3014
3015        /// Sets all the options, replacing any prior values.
3016        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3017            self.0.options = v.into();
3018            self
3019        }
3020
3021        /// Sends the request.
3022        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
3023            (*self.0.stub)
3024                .list_locations(self.0.request, self.0.options)
3025                .await
3026                .map(gax::response::Response::into_body)
3027        }
3028
3029        /// Streams each page in the collection.
3030        pub fn by_page(
3031            self,
3032        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
3033        {
3034            use std::clone::Clone;
3035            let token = self.0.request.page_token.clone();
3036            let execute = move |token: String| {
3037                let mut builder = self.clone();
3038                builder.0.request = builder.0.request.set_page_token(token);
3039                builder.send()
3040            };
3041            gax::paginator::internal::new_paginator(token, execute)
3042        }
3043
3044        /// Streams each item in the collection.
3045        pub fn by_item(
3046            self,
3047        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
3048        {
3049            use gax::paginator::Paginator;
3050            self.by_page().items()
3051        }
3052
3053        /// Sets the value of [name][location::model::ListLocationsRequest::name].
3054        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3055            self.0.request.name = v.into();
3056            self
3057        }
3058
3059        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
3060        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3061            self.0.request.filter = v.into();
3062            self
3063        }
3064
3065        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
3066        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3067            self.0.request.page_size = v.into();
3068            self
3069        }
3070
3071        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
3072        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3073            self.0.request.page_token = v.into();
3074            self
3075        }
3076    }
3077
3078    #[doc(hidden)]
3079    impl gax::options::internal::RequestBuilder for ListLocations {
3080        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3081            &mut self.0.options
3082        }
3083    }
3084
3085    /// The request builder for [Datastream::get_location][crate::client::Datastream::get_location] calls.
3086    ///
3087    /// # Example
3088    /// ```no_run
3089    /// # use google_cloud_datastream_v1::builder;
3090    /// use builder::datastream::GetLocation;
3091    /// # tokio_test::block_on(async {
3092    ///
3093    /// let builder = prepare_request_builder();
3094    /// let response = builder.send().await?;
3095    /// # gax::Result::<()>::Ok(()) });
3096    ///
3097    /// fn prepare_request_builder() -> GetLocation {
3098    ///   # panic!();
3099    ///   // ... details omitted ...
3100    /// }
3101    /// ```
3102    #[derive(Clone, Debug)]
3103    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
3104
3105    impl GetLocation {
3106        pub(crate) fn new(
3107            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3108        ) -> Self {
3109            Self(RequestBuilder::new(stub))
3110        }
3111
3112        /// Sets the full request, replacing any prior values.
3113        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
3114            self.0.request = v.into();
3115            self
3116        }
3117
3118        /// Sets all the options, replacing any prior values.
3119        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3120            self.0.options = v.into();
3121            self
3122        }
3123
3124        /// Sends the request.
3125        pub async fn send(self) -> Result<location::model::Location> {
3126            (*self.0.stub)
3127                .get_location(self.0.request, self.0.options)
3128                .await
3129                .map(gax::response::Response::into_body)
3130        }
3131
3132        /// Sets the value of [name][location::model::GetLocationRequest::name].
3133        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3134            self.0.request.name = v.into();
3135            self
3136        }
3137    }
3138
3139    #[doc(hidden)]
3140    impl gax::options::internal::RequestBuilder for GetLocation {
3141        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3142            &mut self.0.options
3143        }
3144    }
3145
3146    /// The request builder for [Datastream::list_operations][crate::client::Datastream::list_operations] calls.
3147    ///
3148    /// # Example
3149    /// ```no_run
3150    /// # use google_cloud_datastream_v1::builder;
3151    /// use builder::datastream::ListOperations;
3152    /// # tokio_test::block_on(async {
3153    /// use gax::paginator::ItemPaginator;
3154    ///
3155    /// let builder = prepare_request_builder();
3156    /// let mut items = builder.by_item();
3157    /// while let Some(result) = items.next().await {
3158    ///   let item = result?;
3159    /// }
3160    /// # gax::Result::<()>::Ok(()) });
3161    ///
3162    /// fn prepare_request_builder() -> ListOperations {
3163    ///   # panic!();
3164    ///   // ... details omitted ...
3165    /// }
3166    /// ```
3167    #[derive(Clone, Debug)]
3168    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3169
3170    impl ListOperations {
3171        pub(crate) fn new(
3172            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3173        ) -> Self {
3174            Self(RequestBuilder::new(stub))
3175        }
3176
3177        /// Sets the full request, replacing any prior values.
3178        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3179            mut self,
3180            v: V,
3181        ) -> Self {
3182            self.0.request = v.into();
3183            self
3184        }
3185
3186        /// Sets all the options, replacing any prior values.
3187        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3188            self.0.options = v.into();
3189            self
3190        }
3191
3192        /// Sends the request.
3193        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3194            (*self.0.stub)
3195                .list_operations(self.0.request, self.0.options)
3196                .await
3197                .map(gax::response::Response::into_body)
3198        }
3199
3200        /// Streams each page in the collection.
3201        pub fn by_page(
3202            self,
3203        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3204        {
3205            use std::clone::Clone;
3206            let token = self.0.request.page_token.clone();
3207            let execute = move |token: String| {
3208                let mut builder = self.clone();
3209                builder.0.request = builder.0.request.set_page_token(token);
3210                builder.send()
3211            };
3212            gax::paginator::internal::new_paginator(token, execute)
3213        }
3214
3215        /// Streams each item in the collection.
3216        pub fn by_item(
3217            self,
3218        ) -> impl gax::paginator::ItemPaginator<
3219            longrunning::model::ListOperationsResponse,
3220            gax::error::Error,
3221        > {
3222            use gax::paginator::Paginator;
3223            self.by_page().items()
3224        }
3225
3226        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
3227        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3228            self.0.request.name = v.into();
3229            self
3230        }
3231
3232        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
3233        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3234            self.0.request.filter = v.into();
3235            self
3236        }
3237
3238        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
3239        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3240            self.0.request.page_size = v.into();
3241            self
3242        }
3243
3244        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
3245        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3246            self.0.request.page_token = v.into();
3247            self
3248        }
3249    }
3250
3251    #[doc(hidden)]
3252    impl gax::options::internal::RequestBuilder for ListOperations {
3253        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3254            &mut self.0.options
3255        }
3256    }
3257
3258    /// The request builder for [Datastream::get_operation][crate::client::Datastream::get_operation] calls.
3259    ///
3260    /// # Example
3261    /// ```no_run
3262    /// # use google_cloud_datastream_v1::builder;
3263    /// use builder::datastream::GetOperation;
3264    /// # tokio_test::block_on(async {
3265    ///
3266    /// let builder = prepare_request_builder();
3267    /// let response = builder.send().await?;
3268    /// # gax::Result::<()>::Ok(()) });
3269    ///
3270    /// fn prepare_request_builder() -> GetOperation {
3271    ///   # panic!();
3272    ///   // ... details omitted ...
3273    /// }
3274    /// ```
3275    #[derive(Clone, Debug)]
3276    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3277
3278    impl GetOperation {
3279        pub(crate) fn new(
3280            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3281        ) -> Self {
3282            Self(RequestBuilder::new(stub))
3283        }
3284
3285        /// Sets the full request, replacing any prior values.
3286        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3287            mut self,
3288            v: V,
3289        ) -> Self {
3290            self.0.request = v.into();
3291            self
3292        }
3293
3294        /// Sets all the options, replacing any prior values.
3295        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3296            self.0.options = v.into();
3297            self
3298        }
3299
3300        /// Sends the request.
3301        pub async fn send(self) -> Result<longrunning::model::Operation> {
3302            (*self.0.stub)
3303                .get_operation(self.0.request, self.0.options)
3304                .await
3305                .map(gax::response::Response::into_body)
3306        }
3307
3308        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
3309        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3310            self.0.request.name = v.into();
3311            self
3312        }
3313    }
3314
3315    #[doc(hidden)]
3316    impl gax::options::internal::RequestBuilder for GetOperation {
3317        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3318            &mut self.0.options
3319        }
3320    }
3321
3322    /// The request builder for [Datastream::delete_operation][crate::client::Datastream::delete_operation] calls.
3323    ///
3324    /// # Example
3325    /// ```no_run
3326    /// # use google_cloud_datastream_v1::builder;
3327    /// use builder::datastream::DeleteOperation;
3328    /// # tokio_test::block_on(async {
3329    ///
3330    /// let builder = prepare_request_builder();
3331    /// let response = builder.send().await?;
3332    /// # gax::Result::<()>::Ok(()) });
3333    ///
3334    /// fn prepare_request_builder() -> DeleteOperation {
3335    ///   # panic!();
3336    ///   // ... details omitted ...
3337    /// }
3338    /// ```
3339    #[derive(Clone, Debug)]
3340    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
3341
3342    impl DeleteOperation {
3343        pub(crate) fn new(
3344            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3345        ) -> Self {
3346            Self(RequestBuilder::new(stub))
3347        }
3348
3349        /// Sets the full request, replacing any prior values.
3350        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
3351            mut self,
3352            v: V,
3353        ) -> Self {
3354            self.0.request = v.into();
3355            self
3356        }
3357
3358        /// Sets all the options, replacing any prior values.
3359        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3360            self.0.options = v.into();
3361            self
3362        }
3363
3364        /// Sends the request.
3365        pub async fn send(self) -> Result<()> {
3366            (*self.0.stub)
3367                .delete_operation(self.0.request, self.0.options)
3368                .await
3369                .map(gax::response::Response::into_body)
3370        }
3371
3372        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
3373        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3374            self.0.request.name = v.into();
3375            self
3376        }
3377    }
3378
3379    #[doc(hidden)]
3380    impl gax::options::internal::RequestBuilder for DeleteOperation {
3381        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3382            &mut self.0.options
3383        }
3384    }
3385
3386    /// The request builder for [Datastream::cancel_operation][crate::client::Datastream::cancel_operation] calls.
3387    ///
3388    /// # Example
3389    /// ```no_run
3390    /// # use google_cloud_datastream_v1::builder;
3391    /// use builder::datastream::CancelOperation;
3392    /// # tokio_test::block_on(async {
3393    ///
3394    /// let builder = prepare_request_builder();
3395    /// let response = builder.send().await?;
3396    /// # gax::Result::<()>::Ok(()) });
3397    ///
3398    /// fn prepare_request_builder() -> CancelOperation {
3399    ///   # panic!();
3400    ///   // ... details omitted ...
3401    /// }
3402    /// ```
3403    #[derive(Clone, Debug)]
3404    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3405
3406    impl CancelOperation {
3407        pub(crate) fn new(
3408            stub: std::sync::Arc<dyn super::super::stub::dynamic::Datastream>,
3409        ) -> Self {
3410            Self(RequestBuilder::new(stub))
3411        }
3412
3413        /// Sets the full request, replacing any prior values.
3414        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3415            mut self,
3416            v: V,
3417        ) -> Self {
3418            self.0.request = v.into();
3419            self
3420        }
3421
3422        /// Sets all the options, replacing any prior values.
3423        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3424            self.0.options = v.into();
3425            self
3426        }
3427
3428        /// Sends the request.
3429        pub async fn send(self) -> Result<()> {
3430            (*self.0.stub)
3431                .cancel_operation(self.0.request, self.0.options)
3432                .await
3433                .map(gax::response::Response::into_body)
3434        }
3435
3436        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
3437        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3438            self.0.request.name = v.into();
3439            self
3440        }
3441    }
3442
3443    #[doc(hidden)]
3444    impl gax::options::internal::RequestBuilder for CancelOperation {
3445        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3446            &mut self.0.options
3447        }
3448    }
3449}