Skip to main content

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