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