google_cloud_datastream_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod datastream {
18    use crate::Result;
19    use std::sync::Arc;
20
21    /// A builder for [Datastream][super::super::client::Datastream].
22    ///
23    /// ```
24    /// # tokio_test::block_on(async {
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    /// # gax::Result::<()>::Ok(()) });
33    /// ```
34    pub type ClientBuilder =
35        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
36
37    pub(crate) mod client {
38        use super::super::super::client::Datastream;
39        pub struct Factory;
40        impl gax::client_builder::internal::ClientFactory for Factory {
41            type Client = Datastream;
42            type Credentials = gaxi::options::Credentials;
43            async fn build(self, config: gaxi::options::ClientConfig) -> gax::Result<Self::Client> {
44                Self::Client::new(config).await
45            }
46        }
47    }
48
49    /// Common implementation for [super::super::client::Datastream] request builders.
50    #[derive(Clone, Debug)]
51    pub(crate) struct RequestBuilder<R: std::default::Default> {
52        stub: Arc<dyn super::super::stub::dynamic::Datastream>,
53        request: R,
54        options: gax::options::RequestOptions,
55    }
56
57    impl<R> RequestBuilder<R>
58    where
59        R: std::default::Default,
60    {
61        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
62            Self {
63                stub,
64                request: R::default(),
65                options: gax::options::RequestOptions::default(),
66            }
67        }
68    }
69
70    /// The request builder for [Datastream::list_connection_profiles][super::super::client::Datastream::list_connection_profiles] calls.
71    #[derive(Clone, Debug)]
72    pub struct ListConnectionProfiles(RequestBuilder<crate::model::ListConnectionProfilesRequest>);
73
74    impl ListConnectionProfiles {
75        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
76            Self(RequestBuilder::new(stub))
77        }
78
79        /// Sets the full request, replacing any prior values.
80        pub fn with_request<V: Into<crate::model::ListConnectionProfilesRequest>>(
81            mut self,
82            v: V,
83        ) -> Self {
84            self.0.request = v.into();
85            self
86        }
87
88        /// Sets all the options, replacing any prior values.
89        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
90            self.0.options = v.into();
91            self
92        }
93
94        /// Sends the request.
95        pub async fn send(self) -> Result<crate::model::ListConnectionProfilesResponse> {
96            (*self.0.stub)
97                .list_connection_profiles(self.0.request, self.0.options)
98                .await
99                .map(gax::response::Response::into_body)
100        }
101
102        /// Streams the responses back.
103        pub async fn paginator(
104            self,
105        ) -> impl gax::paginator::Paginator<
106            crate::model::ListConnectionProfilesResponse,
107            gax::error::Error,
108        > {
109            use std::clone::Clone;
110            let token = self.0.request.page_token.clone();
111            let execute = move |token: String| {
112                let mut builder = self.clone();
113                builder.0.request = builder.0.request.set_page_token(token);
114                builder.send()
115            };
116            gax::paginator::internal::new_paginator(token, execute)
117        }
118
119        /// Sets the value of [parent][crate::model::ListConnectionProfilesRequest::parent].
120        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
121            self.0.request.parent = v.into();
122            self
123        }
124
125        /// Sets the value of [page_size][crate::model::ListConnectionProfilesRequest::page_size].
126        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
127            self.0.request.page_size = v.into();
128            self
129        }
130
131        /// Sets the value of [page_token][crate::model::ListConnectionProfilesRequest::page_token].
132        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
133            self.0.request.page_token = v.into();
134            self
135        }
136
137        /// Sets the value of [filter][crate::model::ListConnectionProfilesRequest::filter].
138        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
139            self.0.request.filter = v.into();
140            self
141        }
142
143        /// Sets the value of [order_by][crate::model::ListConnectionProfilesRequest::order_by].
144        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
145            self.0.request.order_by = v.into();
146            self
147        }
148    }
149
150    #[doc(hidden)]
151    impl gax::options::internal::RequestBuilder for ListConnectionProfiles {
152        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
153            &mut self.0.options
154        }
155    }
156
157    /// The request builder for [Datastream::get_connection_profile][super::super::client::Datastream::get_connection_profile] calls.
158    #[derive(Clone, Debug)]
159    pub struct GetConnectionProfile(RequestBuilder<crate::model::GetConnectionProfileRequest>);
160
161    impl GetConnectionProfile {
162        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
163            Self(RequestBuilder::new(stub))
164        }
165
166        /// Sets the full request, replacing any prior values.
167        pub fn with_request<V: Into<crate::model::GetConnectionProfileRequest>>(
168            mut self,
169            v: V,
170        ) -> Self {
171            self.0.request = v.into();
172            self
173        }
174
175        /// Sets all the options, replacing any prior values.
176        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
177            self.0.options = v.into();
178            self
179        }
180
181        /// Sends the request.
182        pub async fn send(self) -> Result<crate::model::ConnectionProfile> {
183            (*self.0.stub)
184                .get_connection_profile(self.0.request, self.0.options)
185                .await
186                .map(gax::response::Response::into_body)
187        }
188
189        /// Sets the value of [name][crate::model::GetConnectionProfileRequest::name].
190        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
191            self.0.request.name = v.into();
192            self
193        }
194    }
195
196    #[doc(hidden)]
197    impl gax::options::internal::RequestBuilder for GetConnectionProfile {
198        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
199            &mut self.0.options
200        }
201    }
202
203    /// The request builder for [Datastream::create_connection_profile][super::super::client::Datastream::create_connection_profile] calls.
204    #[derive(Clone, Debug)]
205    pub struct CreateConnectionProfile(
206        RequestBuilder<crate::model::CreateConnectionProfileRequest>,
207    );
208
209    impl CreateConnectionProfile {
210        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
211            Self(RequestBuilder::new(stub))
212        }
213
214        /// Sets the full request, replacing any prior values.
215        pub fn with_request<V: Into<crate::model::CreateConnectionProfileRequest>>(
216            mut self,
217            v: V,
218        ) -> Self {
219            self.0.request = v.into();
220            self
221        }
222
223        /// Sets all the options, replacing any prior values.
224        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
225            self.0.options = v.into();
226            self
227        }
228
229        /// Sends the request.
230        ///
231        /// # Long running operations
232        ///
233        /// This starts, but does not poll, a longrunning operation. More information
234        /// on [create_connection_profile][super::super::client::Datastream::create_connection_profile].
235        pub async fn send(self) -> Result<longrunning::model::Operation> {
236            (*self.0.stub)
237                .create_connection_profile(self.0.request, self.0.options)
238                .await
239                .map(gax::response::Response::into_body)
240        }
241
242        /// Creates a [Poller][lro::Poller] to work with `create_connection_profile`.
243        pub fn poller(
244            self,
245        ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
246        {
247            type Operation =
248                lro::Operation<crate::model::ConnectionProfile, crate::model::OperationMetadata>;
249            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
250            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
251
252            let stub = self.0.stub.clone();
253            let mut options = self.0.options.clone();
254            options.set_retry_policy(gax::retry_policy::NeverRetry);
255            let query = move |name| {
256                let stub = stub.clone();
257                let options = options.clone();
258                async {
259                    let op = GetOperation::new(stub)
260                        .set_name(name)
261                        .with_options(options)
262                        .send()
263                        .await?;
264                    Ok(Operation::new(op))
265                }
266            };
267
268            let start = move || async {
269                let op = self.send().await?;
270                Ok(Operation::new(op))
271            };
272
273            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
274        }
275
276        /// Sets the value of [parent][crate::model::CreateConnectionProfileRequest::parent].
277        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
278            self.0.request.parent = v.into();
279            self
280        }
281
282        /// Sets the value of [connection_profile_id][crate::model::CreateConnectionProfileRequest::connection_profile_id].
283        pub fn set_connection_profile_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
284            self.0.request.connection_profile_id = v.into();
285            self
286        }
287
288        /// Sets the value of [connection_profile][crate::model::CreateConnectionProfileRequest::connection_profile].
289        pub fn set_connection_profile<
290            T: Into<std::option::Option<crate::model::ConnectionProfile>>,
291        >(
292            mut self,
293            v: T,
294        ) -> Self {
295            self.0.request.connection_profile = v.into();
296            self
297        }
298
299        /// Sets the value of [request_id][crate::model::CreateConnectionProfileRequest::request_id].
300        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
301            self.0.request.request_id = v.into();
302            self
303        }
304
305        /// Sets the value of [validate_only][crate::model::CreateConnectionProfileRequest::validate_only].
306        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
307            self.0.request.validate_only = v.into();
308            self
309        }
310
311        /// Sets the value of [force][crate::model::CreateConnectionProfileRequest::force].
312        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
313            self.0.request.force = v.into();
314            self
315        }
316    }
317
318    #[doc(hidden)]
319    impl gax::options::internal::RequestBuilder for CreateConnectionProfile {
320        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
321            &mut self.0.options
322        }
323    }
324
325    /// The request builder for [Datastream::update_connection_profile][super::super::client::Datastream::update_connection_profile] calls.
326    #[derive(Clone, Debug)]
327    pub struct UpdateConnectionProfile(
328        RequestBuilder<crate::model::UpdateConnectionProfileRequest>,
329    );
330
331    impl UpdateConnectionProfile {
332        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
333            Self(RequestBuilder::new(stub))
334        }
335
336        /// Sets the full request, replacing any prior values.
337        pub fn with_request<V: Into<crate::model::UpdateConnectionProfileRequest>>(
338            mut self,
339            v: V,
340        ) -> Self {
341            self.0.request = v.into();
342            self
343        }
344
345        /// Sets all the options, replacing any prior values.
346        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
347            self.0.options = v.into();
348            self
349        }
350
351        /// Sends the request.
352        ///
353        /// # Long running operations
354        ///
355        /// This starts, but does not poll, a longrunning operation. More information
356        /// on [update_connection_profile][super::super::client::Datastream::update_connection_profile].
357        pub async fn send(self) -> Result<longrunning::model::Operation> {
358            (*self.0.stub)
359                .update_connection_profile(self.0.request, self.0.options)
360                .await
361                .map(gax::response::Response::into_body)
362        }
363
364        /// Creates a [Poller][lro::Poller] to work with `update_connection_profile`.
365        pub fn poller(
366            self,
367        ) -> impl lro::Poller<crate::model::ConnectionProfile, crate::model::OperationMetadata>
368        {
369            type Operation =
370                lro::Operation<crate::model::ConnectionProfile, crate::model::OperationMetadata>;
371            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
372            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
373
374            let stub = self.0.stub.clone();
375            let mut options = self.0.options.clone();
376            options.set_retry_policy(gax::retry_policy::NeverRetry);
377            let query = move |name| {
378                let stub = stub.clone();
379                let options = options.clone();
380                async {
381                    let op = GetOperation::new(stub)
382                        .set_name(name)
383                        .with_options(options)
384                        .send()
385                        .await?;
386                    Ok(Operation::new(op))
387                }
388            };
389
390            let start = move || async {
391                let op = self.send().await?;
392                Ok(Operation::new(op))
393            };
394
395            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
396        }
397
398        /// Sets the value of [update_mask][crate::model::UpdateConnectionProfileRequest::update_mask].
399        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
400            mut self,
401            v: T,
402        ) -> Self {
403            self.0.request.update_mask = v.into();
404            self
405        }
406
407        /// Sets the value of [connection_profile][crate::model::UpdateConnectionProfileRequest::connection_profile].
408        pub fn set_connection_profile<
409            T: Into<std::option::Option<crate::model::ConnectionProfile>>,
410        >(
411            mut self,
412            v: T,
413        ) -> Self {
414            self.0.request.connection_profile = v.into();
415            self
416        }
417
418        /// Sets the value of [request_id][crate::model::UpdateConnectionProfileRequest::request_id].
419        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
420            self.0.request.request_id = v.into();
421            self
422        }
423
424        /// Sets the value of [validate_only][crate::model::UpdateConnectionProfileRequest::validate_only].
425        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
426            self.0.request.validate_only = v.into();
427            self
428        }
429
430        /// Sets the value of [force][crate::model::UpdateConnectionProfileRequest::force].
431        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
432            self.0.request.force = v.into();
433            self
434        }
435    }
436
437    #[doc(hidden)]
438    impl gax::options::internal::RequestBuilder for UpdateConnectionProfile {
439        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
440            &mut self.0.options
441        }
442    }
443
444    /// The request builder for [Datastream::delete_connection_profile][super::super::client::Datastream::delete_connection_profile] calls.
445    #[derive(Clone, Debug)]
446    pub struct DeleteConnectionProfile(
447        RequestBuilder<crate::model::DeleteConnectionProfileRequest>,
448    );
449
450    impl DeleteConnectionProfile {
451        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
452            Self(RequestBuilder::new(stub))
453        }
454
455        /// Sets the full request, replacing any prior values.
456        pub fn with_request<V: Into<crate::model::DeleteConnectionProfileRequest>>(
457            mut self,
458            v: V,
459        ) -> Self {
460            self.0.request = v.into();
461            self
462        }
463
464        /// Sets all the options, replacing any prior values.
465        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
466            self.0.options = v.into();
467            self
468        }
469
470        /// Sends the request.
471        ///
472        /// # Long running operations
473        ///
474        /// This starts, but does not poll, a longrunning operation. More information
475        /// on [delete_connection_profile][super::super::client::Datastream::delete_connection_profile].
476        pub async fn send(self) -> Result<longrunning::model::Operation> {
477            (*self.0.stub)
478                .delete_connection_profile(self.0.request, self.0.options)
479                .await
480                .map(gax::response::Response::into_body)
481        }
482
483        /// Creates a [Poller][lro::Poller] to work with `delete_connection_profile`.
484        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
485            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
486            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
487            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
488
489            let stub = self.0.stub.clone();
490            let mut options = self.0.options.clone();
491            options.set_retry_policy(gax::retry_policy::NeverRetry);
492            let query = move |name| {
493                let stub = stub.clone();
494                let options = options.clone();
495                async {
496                    let op = GetOperation::new(stub)
497                        .set_name(name)
498                        .with_options(options)
499                        .send()
500                        .await?;
501                    Ok(Operation::new(op))
502                }
503            };
504
505            let start = move || async {
506                let op = self.send().await?;
507                Ok(Operation::new(op))
508            };
509
510            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
511        }
512
513        /// Sets the value of [name][crate::model::DeleteConnectionProfileRequest::name].
514        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
515            self.0.request.name = v.into();
516            self
517        }
518
519        /// Sets the value of [request_id][crate::model::DeleteConnectionProfileRequest::request_id].
520        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
521            self.0.request.request_id = v.into();
522            self
523        }
524    }
525
526    #[doc(hidden)]
527    impl gax::options::internal::RequestBuilder for DeleteConnectionProfile {
528        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
529            &mut self.0.options
530        }
531    }
532
533    /// The request builder for [Datastream::discover_connection_profile][super::super::client::Datastream::discover_connection_profile] calls.
534    #[derive(Clone, Debug)]
535    pub struct DiscoverConnectionProfile(
536        RequestBuilder<crate::model::DiscoverConnectionProfileRequest>,
537    );
538
539    impl DiscoverConnectionProfile {
540        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
541            Self(RequestBuilder::new(stub))
542        }
543
544        /// Sets the full request, replacing any prior values.
545        pub fn with_request<V: Into<crate::model::DiscoverConnectionProfileRequest>>(
546            mut self,
547            v: V,
548        ) -> Self {
549            self.0.request = v.into();
550            self
551        }
552
553        /// Sets all the options, replacing any prior values.
554        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
555            self.0.options = v.into();
556            self
557        }
558
559        /// Sends the request.
560        pub async fn send(self) -> Result<crate::model::DiscoverConnectionProfileResponse> {
561            (*self.0.stub)
562                .discover_connection_profile(self.0.request, self.0.options)
563                .await
564                .map(gax::response::Response::into_body)
565        }
566
567        /// Sets the value of [parent][crate::model::DiscoverConnectionProfileRequest::parent].
568        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
569            self.0.request.parent = v.into();
570            self
571        }
572
573        /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target].
574        ///
575        /// Note that all the setters affecting `target` are
576        /// mutually exclusive.
577        pub fn set_target<
578            T: Into<Option<crate::model::discover_connection_profile_request::Target>>,
579        >(
580            mut self,
581            v: T,
582        ) -> Self {
583            self.0.request.target = v.into();
584            self
585        }
586
587        /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
588        /// to hold a `ConnectionProfile`.
589        ///
590        /// Note that all the setters affecting `target` are
591        /// mutually exclusive.
592        pub fn set_connection_profile<
593            T: std::convert::Into<std::boxed::Box<crate::model::ConnectionProfile>>,
594        >(
595            mut self,
596            v: T,
597        ) -> Self {
598            self.0.request = self.0.request.set_connection_profile(v);
599            self
600        }
601
602        /// Sets the value of [target][crate::model::DiscoverConnectionProfileRequest::target]
603        /// to hold a `ConnectionProfileName`.
604        ///
605        /// Note that all the setters affecting `target` are
606        /// mutually exclusive.
607        pub fn set_connection_profile_name<T: std::convert::Into<std::string::String>>(
608            mut self,
609            v: T,
610        ) -> Self {
611            self.0.request = self.0.request.set_connection_profile_name(v);
612            self
613        }
614
615        /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy].
616        ///
617        /// Note that all the setters affecting `hierarchy` are
618        /// mutually exclusive.
619        pub fn set_hierarchy<
620            T: Into<Option<crate::model::discover_connection_profile_request::Hierarchy>>,
621        >(
622            mut self,
623            v: T,
624        ) -> Self {
625            self.0.request.hierarchy = v.into();
626            self
627        }
628
629        /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
630        /// to hold a `FullHierarchy`.
631        ///
632        /// Note that all the setters affecting `hierarchy` are
633        /// mutually exclusive.
634        pub fn set_full_hierarchy<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
635            self.0.request = self.0.request.set_full_hierarchy(v);
636            self
637        }
638
639        /// Sets the value of [hierarchy][crate::model::DiscoverConnectionProfileRequest::hierarchy]
640        /// to hold a `HierarchyDepth`.
641        ///
642        /// Note that all the setters affecting `hierarchy` are
643        /// mutually exclusive.
644        pub fn set_hierarchy_depth<T: std::convert::Into<i32>>(mut self, v: T) -> Self {
645            self.0.request = self.0.request.set_hierarchy_depth(v);
646            self
647        }
648
649        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object].
650        ///
651        /// Note that all the setters affecting `data_object` are
652        /// mutually exclusive.
653        pub fn set_data_object<
654            T: Into<Option<crate::model::discover_connection_profile_request::DataObject>>,
655        >(
656            mut self,
657            v: T,
658        ) -> Self {
659            self.0.request.data_object = v.into();
660            self
661        }
662
663        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
664        /// to hold a `OracleRdbms`.
665        ///
666        /// Note that all the setters affecting `data_object` are
667        /// mutually exclusive.
668        pub fn set_oracle_rdbms<
669            T: std::convert::Into<std::boxed::Box<crate::model::OracleRdbms>>,
670        >(
671            mut self,
672            v: T,
673        ) -> Self {
674            self.0.request = self.0.request.set_oracle_rdbms(v);
675            self
676        }
677
678        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
679        /// to hold a `MysqlRdbms`.
680        ///
681        /// Note that all the setters affecting `data_object` are
682        /// mutually exclusive.
683        pub fn set_mysql_rdbms<T: std::convert::Into<std::boxed::Box<crate::model::MysqlRdbms>>>(
684            mut self,
685            v: T,
686        ) -> Self {
687            self.0.request = self.0.request.set_mysql_rdbms(v);
688            self
689        }
690
691        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
692        /// to hold a `PostgresqlRdbms`.
693        ///
694        /// Note that all the setters affecting `data_object` are
695        /// mutually exclusive.
696        pub fn set_postgresql_rdbms<
697            T: std::convert::Into<std::boxed::Box<crate::model::PostgresqlRdbms>>,
698        >(
699            mut self,
700            v: T,
701        ) -> Self {
702            self.0.request = self.0.request.set_postgresql_rdbms(v);
703            self
704        }
705
706        /// Sets the value of [data_object][crate::model::DiscoverConnectionProfileRequest::data_object]
707        /// to hold a `SqlServerRdbms`.
708        ///
709        /// Note that all the setters affecting `data_object` are
710        /// mutually exclusive.
711        pub fn set_sql_server_rdbms<
712            T: std::convert::Into<std::boxed::Box<crate::model::SqlServerRdbms>>,
713        >(
714            mut self,
715            v: T,
716        ) -> Self {
717            self.0.request = self.0.request.set_sql_server_rdbms(v);
718            self
719        }
720    }
721
722    #[doc(hidden)]
723    impl gax::options::internal::RequestBuilder for DiscoverConnectionProfile {
724        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
725            &mut self.0.options
726        }
727    }
728
729    /// The request builder for [Datastream::list_streams][super::super::client::Datastream::list_streams] calls.
730    #[derive(Clone, Debug)]
731    pub struct ListStreams(RequestBuilder<crate::model::ListStreamsRequest>);
732
733    impl ListStreams {
734        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
735            Self(RequestBuilder::new(stub))
736        }
737
738        /// Sets the full request, replacing any prior values.
739        pub fn with_request<V: Into<crate::model::ListStreamsRequest>>(mut self, v: V) -> Self {
740            self.0.request = v.into();
741            self
742        }
743
744        /// Sets all the options, replacing any prior values.
745        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
746            self.0.options = v.into();
747            self
748        }
749
750        /// Sends the request.
751        pub async fn send(self) -> Result<crate::model::ListStreamsResponse> {
752            (*self.0.stub)
753                .list_streams(self.0.request, self.0.options)
754                .await
755                .map(gax::response::Response::into_body)
756        }
757
758        /// Streams the responses back.
759        pub async fn paginator(
760            self,
761        ) -> impl gax::paginator::Paginator<crate::model::ListStreamsResponse, gax::error::Error>
762        {
763            use std::clone::Clone;
764            let token = self.0.request.page_token.clone();
765            let execute = move |token: String| {
766                let mut builder = self.clone();
767                builder.0.request = builder.0.request.set_page_token(token);
768                builder.send()
769            };
770            gax::paginator::internal::new_paginator(token, execute)
771        }
772
773        /// Sets the value of [parent][crate::model::ListStreamsRequest::parent].
774        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
775            self.0.request.parent = v.into();
776            self
777        }
778
779        /// Sets the value of [page_size][crate::model::ListStreamsRequest::page_size].
780        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
781            self.0.request.page_size = v.into();
782            self
783        }
784
785        /// Sets the value of [page_token][crate::model::ListStreamsRequest::page_token].
786        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
787            self.0.request.page_token = v.into();
788            self
789        }
790
791        /// Sets the value of [filter][crate::model::ListStreamsRequest::filter].
792        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
793            self.0.request.filter = v.into();
794            self
795        }
796
797        /// Sets the value of [order_by][crate::model::ListStreamsRequest::order_by].
798        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
799            self.0.request.order_by = v.into();
800            self
801        }
802    }
803
804    #[doc(hidden)]
805    impl gax::options::internal::RequestBuilder for ListStreams {
806        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
807            &mut self.0.options
808        }
809    }
810
811    /// The request builder for [Datastream::get_stream][super::super::client::Datastream::get_stream] calls.
812    #[derive(Clone, Debug)]
813    pub struct GetStream(RequestBuilder<crate::model::GetStreamRequest>);
814
815    impl GetStream {
816        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
817            Self(RequestBuilder::new(stub))
818        }
819
820        /// Sets the full request, replacing any prior values.
821        pub fn with_request<V: Into<crate::model::GetStreamRequest>>(mut self, v: V) -> Self {
822            self.0.request = v.into();
823            self
824        }
825
826        /// Sets all the options, replacing any prior values.
827        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
828            self.0.options = v.into();
829            self
830        }
831
832        /// Sends the request.
833        pub async fn send(self) -> Result<crate::model::Stream> {
834            (*self.0.stub)
835                .get_stream(self.0.request, self.0.options)
836                .await
837                .map(gax::response::Response::into_body)
838        }
839
840        /// Sets the value of [name][crate::model::GetStreamRequest::name].
841        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
842            self.0.request.name = v.into();
843            self
844        }
845    }
846
847    #[doc(hidden)]
848    impl gax::options::internal::RequestBuilder for GetStream {
849        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
850            &mut self.0.options
851        }
852    }
853
854    /// The request builder for [Datastream::create_stream][super::super::client::Datastream::create_stream] calls.
855    #[derive(Clone, Debug)]
856    pub struct CreateStream(RequestBuilder<crate::model::CreateStreamRequest>);
857
858    impl CreateStream {
859        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
860            Self(RequestBuilder::new(stub))
861        }
862
863        /// Sets the full request, replacing any prior values.
864        pub fn with_request<V: Into<crate::model::CreateStreamRequest>>(mut self, v: V) -> Self {
865            self.0.request = v.into();
866            self
867        }
868
869        /// Sets all the options, replacing any prior values.
870        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
871            self.0.options = v.into();
872            self
873        }
874
875        /// Sends the request.
876        ///
877        /// # Long running operations
878        ///
879        /// This starts, but does not poll, a longrunning operation. More information
880        /// on [create_stream][super::super::client::Datastream::create_stream].
881        pub async fn send(self) -> Result<longrunning::model::Operation> {
882            (*self.0.stub)
883                .create_stream(self.0.request, self.0.options)
884                .await
885                .map(gax::response::Response::into_body)
886        }
887
888        /// Creates a [Poller][lro::Poller] to work with `create_stream`.
889        pub fn poller(
890            self,
891        ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
892            type Operation = lro::Operation<crate::model::Stream, crate::model::OperationMetadata>;
893            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
894            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
895
896            let stub = self.0.stub.clone();
897            let mut options = self.0.options.clone();
898            options.set_retry_policy(gax::retry_policy::NeverRetry);
899            let query = move |name| {
900                let stub = stub.clone();
901                let options = options.clone();
902                async {
903                    let op = GetOperation::new(stub)
904                        .set_name(name)
905                        .with_options(options)
906                        .send()
907                        .await?;
908                    Ok(Operation::new(op))
909                }
910            };
911
912            let start = move || async {
913                let op = self.send().await?;
914                Ok(Operation::new(op))
915            };
916
917            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
918        }
919
920        /// Sets the value of [parent][crate::model::CreateStreamRequest::parent].
921        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
922            self.0.request.parent = v.into();
923            self
924        }
925
926        /// Sets the value of [stream_id][crate::model::CreateStreamRequest::stream_id].
927        pub fn set_stream_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
928            self.0.request.stream_id = v.into();
929            self
930        }
931
932        /// Sets the value of [stream][crate::model::CreateStreamRequest::stream].
933        pub fn set_stream<T: Into<std::option::Option<crate::model::Stream>>>(
934            mut self,
935            v: T,
936        ) -> Self {
937            self.0.request.stream = v.into();
938            self
939        }
940
941        /// Sets the value of [request_id][crate::model::CreateStreamRequest::request_id].
942        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
943            self.0.request.request_id = v.into();
944            self
945        }
946
947        /// Sets the value of [validate_only][crate::model::CreateStreamRequest::validate_only].
948        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
949            self.0.request.validate_only = v.into();
950            self
951        }
952
953        /// Sets the value of [force][crate::model::CreateStreamRequest::force].
954        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
955            self.0.request.force = v.into();
956            self
957        }
958    }
959
960    #[doc(hidden)]
961    impl gax::options::internal::RequestBuilder for CreateStream {
962        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
963            &mut self.0.options
964        }
965    }
966
967    /// The request builder for [Datastream::update_stream][super::super::client::Datastream::update_stream] calls.
968    #[derive(Clone, Debug)]
969    pub struct UpdateStream(RequestBuilder<crate::model::UpdateStreamRequest>);
970
971    impl UpdateStream {
972        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
973            Self(RequestBuilder::new(stub))
974        }
975
976        /// Sets the full request, replacing any prior values.
977        pub fn with_request<V: Into<crate::model::UpdateStreamRequest>>(mut self, v: V) -> Self {
978            self.0.request = v.into();
979            self
980        }
981
982        /// Sets all the options, replacing any prior values.
983        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
984            self.0.options = v.into();
985            self
986        }
987
988        /// Sends the request.
989        ///
990        /// # Long running operations
991        ///
992        /// This starts, but does not poll, a longrunning operation. More information
993        /// on [update_stream][super::super::client::Datastream::update_stream].
994        pub async fn send(self) -> Result<longrunning::model::Operation> {
995            (*self.0.stub)
996                .update_stream(self.0.request, self.0.options)
997                .await
998                .map(gax::response::Response::into_body)
999        }
1000
1001        /// Creates a [Poller][lro::Poller] to work with `update_stream`.
1002        pub fn poller(
1003            self,
1004        ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1005            type Operation = lro::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1006            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1007            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1008
1009            let stub = self.0.stub.clone();
1010            let mut options = self.0.options.clone();
1011            options.set_retry_policy(gax::retry_policy::NeverRetry);
1012            let query = move |name| {
1013                let stub = stub.clone();
1014                let options = options.clone();
1015                async {
1016                    let op = GetOperation::new(stub)
1017                        .set_name(name)
1018                        .with_options(options)
1019                        .send()
1020                        .await?;
1021                    Ok(Operation::new(op))
1022                }
1023            };
1024
1025            let start = move || async {
1026                let op = self.send().await?;
1027                Ok(Operation::new(op))
1028            };
1029
1030            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1031        }
1032
1033        /// Sets the value of [update_mask][crate::model::UpdateStreamRequest::update_mask].
1034        pub fn set_update_mask<T: Into<std::option::Option<wkt::FieldMask>>>(
1035            mut self,
1036            v: T,
1037        ) -> Self {
1038            self.0.request.update_mask = v.into();
1039            self
1040        }
1041
1042        /// Sets the value of [stream][crate::model::UpdateStreamRequest::stream].
1043        pub fn set_stream<T: Into<std::option::Option<crate::model::Stream>>>(
1044            mut self,
1045            v: T,
1046        ) -> Self {
1047            self.0.request.stream = v.into();
1048            self
1049        }
1050
1051        /// Sets the value of [request_id][crate::model::UpdateStreamRequest::request_id].
1052        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1053            self.0.request.request_id = v.into();
1054            self
1055        }
1056
1057        /// Sets the value of [validate_only][crate::model::UpdateStreamRequest::validate_only].
1058        pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
1059            self.0.request.validate_only = v.into();
1060            self
1061        }
1062
1063        /// Sets the value of [force][crate::model::UpdateStreamRequest::force].
1064        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1065            self.0.request.force = v.into();
1066            self
1067        }
1068    }
1069
1070    #[doc(hidden)]
1071    impl gax::options::internal::RequestBuilder for UpdateStream {
1072        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1073            &mut self.0.options
1074        }
1075    }
1076
1077    /// The request builder for [Datastream::delete_stream][super::super::client::Datastream::delete_stream] calls.
1078    #[derive(Clone, Debug)]
1079    pub struct DeleteStream(RequestBuilder<crate::model::DeleteStreamRequest>);
1080
1081    impl DeleteStream {
1082        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1083            Self(RequestBuilder::new(stub))
1084        }
1085
1086        /// Sets the full request, replacing any prior values.
1087        pub fn with_request<V: Into<crate::model::DeleteStreamRequest>>(mut self, v: V) -> Self {
1088            self.0.request = v.into();
1089            self
1090        }
1091
1092        /// Sets all the options, replacing any prior values.
1093        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1094            self.0.options = v.into();
1095            self
1096        }
1097
1098        /// Sends the request.
1099        ///
1100        /// # Long running operations
1101        ///
1102        /// This starts, but does not poll, a longrunning operation. More information
1103        /// on [delete_stream][super::super::client::Datastream::delete_stream].
1104        pub async fn send(self) -> Result<longrunning::model::Operation> {
1105            (*self.0.stub)
1106                .delete_stream(self.0.request, self.0.options)
1107                .await
1108                .map(gax::response::Response::into_body)
1109        }
1110
1111        /// Creates a [Poller][lro::Poller] to work with `delete_stream`.
1112        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1113            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1114            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1115            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1116
1117            let stub = self.0.stub.clone();
1118            let mut options = self.0.options.clone();
1119            options.set_retry_policy(gax::retry_policy::NeverRetry);
1120            let query = move |name| {
1121                let stub = stub.clone();
1122                let options = options.clone();
1123                async {
1124                    let op = GetOperation::new(stub)
1125                        .set_name(name)
1126                        .with_options(options)
1127                        .send()
1128                        .await?;
1129                    Ok(Operation::new(op))
1130                }
1131            };
1132
1133            let start = move || async {
1134                let op = self.send().await?;
1135                Ok(Operation::new(op))
1136            };
1137
1138            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1139        }
1140
1141        /// Sets the value of [name][crate::model::DeleteStreamRequest::name].
1142        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1143            self.0.request.name = v.into();
1144            self
1145        }
1146
1147        /// Sets the value of [request_id][crate::model::DeleteStreamRequest::request_id].
1148        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1149            self.0.request.request_id = v.into();
1150            self
1151        }
1152    }
1153
1154    #[doc(hidden)]
1155    impl gax::options::internal::RequestBuilder for DeleteStream {
1156        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1157            &mut self.0.options
1158        }
1159    }
1160
1161    /// The request builder for [Datastream::run_stream][super::super::client::Datastream::run_stream] calls.
1162    #[derive(Clone, Debug)]
1163    pub struct RunStream(RequestBuilder<crate::model::RunStreamRequest>);
1164
1165    impl RunStream {
1166        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1167            Self(RequestBuilder::new(stub))
1168        }
1169
1170        /// Sets the full request, replacing any prior values.
1171        pub fn with_request<V: Into<crate::model::RunStreamRequest>>(mut self, v: V) -> Self {
1172            self.0.request = v.into();
1173            self
1174        }
1175
1176        /// Sets all the options, replacing any prior values.
1177        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1178            self.0.options = v.into();
1179            self
1180        }
1181
1182        /// Sends the request.
1183        ///
1184        /// # Long running operations
1185        ///
1186        /// This starts, but does not poll, a longrunning operation. More information
1187        /// on [run_stream][super::super::client::Datastream::run_stream].
1188        pub async fn send(self) -> Result<longrunning::model::Operation> {
1189            (*self.0.stub)
1190                .run_stream(self.0.request, self.0.options)
1191                .await
1192                .map(gax::response::Response::into_body)
1193        }
1194
1195        /// Creates a [Poller][lro::Poller] to work with `run_stream`.
1196        pub fn poller(
1197            self,
1198        ) -> impl lro::Poller<crate::model::Stream, crate::model::OperationMetadata> {
1199            type Operation = lro::Operation<crate::model::Stream, crate::model::OperationMetadata>;
1200            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1201            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1202
1203            let stub = self.0.stub.clone();
1204            let mut options = self.0.options.clone();
1205            options.set_retry_policy(gax::retry_policy::NeverRetry);
1206            let query = move |name| {
1207                let stub = stub.clone();
1208                let options = options.clone();
1209                async {
1210                    let op = GetOperation::new(stub)
1211                        .set_name(name)
1212                        .with_options(options)
1213                        .send()
1214                        .await?;
1215                    Ok(Operation::new(op))
1216                }
1217            };
1218
1219            let start = move || async {
1220                let op = self.send().await?;
1221                Ok(Operation::new(op))
1222            };
1223
1224            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1225        }
1226
1227        /// Sets the value of [name][crate::model::RunStreamRequest::name].
1228        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1229            self.0.request.name = v.into();
1230            self
1231        }
1232
1233        /// Sets the value of [cdc_strategy][crate::model::RunStreamRequest::cdc_strategy].
1234        pub fn set_cdc_strategy<T: Into<std::option::Option<crate::model::CdcStrategy>>>(
1235            mut self,
1236            v: T,
1237        ) -> Self {
1238            self.0.request.cdc_strategy = v.into();
1239            self
1240        }
1241
1242        /// Sets the value of [force][crate::model::RunStreamRequest::force].
1243        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1244            self.0.request.force = v.into();
1245            self
1246        }
1247    }
1248
1249    #[doc(hidden)]
1250    impl gax::options::internal::RequestBuilder for RunStream {
1251        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1252            &mut self.0.options
1253        }
1254    }
1255
1256    /// The request builder for [Datastream::get_stream_object][super::super::client::Datastream::get_stream_object] calls.
1257    #[derive(Clone, Debug)]
1258    pub struct GetStreamObject(RequestBuilder<crate::model::GetStreamObjectRequest>);
1259
1260    impl GetStreamObject {
1261        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1262            Self(RequestBuilder::new(stub))
1263        }
1264
1265        /// Sets the full request, replacing any prior values.
1266        pub fn with_request<V: Into<crate::model::GetStreamObjectRequest>>(mut self, v: V) -> Self {
1267            self.0.request = v.into();
1268            self
1269        }
1270
1271        /// Sets all the options, replacing any prior values.
1272        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1273            self.0.options = v.into();
1274            self
1275        }
1276
1277        /// Sends the request.
1278        pub async fn send(self) -> Result<crate::model::StreamObject> {
1279            (*self.0.stub)
1280                .get_stream_object(self.0.request, self.0.options)
1281                .await
1282                .map(gax::response::Response::into_body)
1283        }
1284
1285        /// Sets the value of [name][crate::model::GetStreamObjectRequest::name].
1286        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1287            self.0.request.name = v.into();
1288            self
1289        }
1290    }
1291
1292    #[doc(hidden)]
1293    impl gax::options::internal::RequestBuilder for GetStreamObject {
1294        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1295            &mut self.0.options
1296        }
1297    }
1298
1299    /// The request builder for [Datastream::lookup_stream_object][super::super::client::Datastream::lookup_stream_object] calls.
1300    #[derive(Clone, Debug)]
1301    pub struct LookupStreamObject(RequestBuilder<crate::model::LookupStreamObjectRequest>);
1302
1303    impl LookupStreamObject {
1304        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1305            Self(RequestBuilder::new(stub))
1306        }
1307
1308        /// Sets the full request, replacing any prior values.
1309        pub fn with_request<V: Into<crate::model::LookupStreamObjectRequest>>(
1310            mut self,
1311            v: V,
1312        ) -> Self {
1313            self.0.request = v.into();
1314            self
1315        }
1316
1317        /// Sets all the options, replacing any prior values.
1318        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1319            self.0.options = v.into();
1320            self
1321        }
1322
1323        /// Sends the request.
1324        pub async fn send(self) -> Result<crate::model::StreamObject> {
1325            (*self.0.stub)
1326                .lookup_stream_object(self.0.request, self.0.options)
1327                .await
1328                .map(gax::response::Response::into_body)
1329        }
1330
1331        /// Sets the value of [parent][crate::model::LookupStreamObjectRequest::parent].
1332        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1333            self.0.request.parent = v.into();
1334            self
1335        }
1336
1337        /// Sets the value of [source_object_identifier][crate::model::LookupStreamObjectRequest::source_object_identifier].
1338        pub fn set_source_object_identifier<
1339            T: Into<std::option::Option<crate::model::SourceObjectIdentifier>>,
1340        >(
1341            mut self,
1342            v: T,
1343        ) -> Self {
1344            self.0.request.source_object_identifier = v.into();
1345            self
1346        }
1347    }
1348
1349    #[doc(hidden)]
1350    impl gax::options::internal::RequestBuilder for LookupStreamObject {
1351        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1352            &mut self.0.options
1353        }
1354    }
1355
1356    /// The request builder for [Datastream::list_stream_objects][super::super::client::Datastream::list_stream_objects] calls.
1357    #[derive(Clone, Debug)]
1358    pub struct ListStreamObjects(RequestBuilder<crate::model::ListStreamObjectsRequest>);
1359
1360    impl ListStreamObjects {
1361        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1362            Self(RequestBuilder::new(stub))
1363        }
1364
1365        /// Sets the full request, replacing any prior values.
1366        pub fn with_request<V: Into<crate::model::ListStreamObjectsRequest>>(
1367            mut self,
1368            v: V,
1369        ) -> Self {
1370            self.0.request = v.into();
1371            self
1372        }
1373
1374        /// Sets all the options, replacing any prior values.
1375        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1376            self.0.options = v.into();
1377            self
1378        }
1379
1380        /// Sends the request.
1381        pub async fn send(self) -> Result<crate::model::ListStreamObjectsResponse> {
1382            (*self.0.stub)
1383                .list_stream_objects(self.0.request, self.0.options)
1384                .await
1385                .map(gax::response::Response::into_body)
1386        }
1387
1388        /// Streams the responses back.
1389        pub async fn paginator(
1390            self,
1391        ) -> impl gax::paginator::Paginator<crate::model::ListStreamObjectsResponse, gax::error::Error>
1392        {
1393            use std::clone::Clone;
1394            let token = self.0.request.page_token.clone();
1395            let execute = move |token: String| {
1396                let mut builder = self.clone();
1397                builder.0.request = builder.0.request.set_page_token(token);
1398                builder.send()
1399            };
1400            gax::paginator::internal::new_paginator(token, execute)
1401        }
1402
1403        /// Sets the value of [parent][crate::model::ListStreamObjectsRequest::parent].
1404        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1405            self.0.request.parent = v.into();
1406            self
1407        }
1408
1409        /// Sets the value of [page_size][crate::model::ListStreamObjectsRequest::page_size].
1410        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1411            self.0.request.page_size = v.into();
1412            self
1413        }
1414
1415        /// Sets the value of [page_token][crate::model::ListStreamObjectsRequest::page_token].
1416        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1417            self.0.request.page_token = v.into();
1418            self
1419        }
1420    }
1421
1422    #[doc(hidden)]
1423    impl gax::options::internal::RequestBuilder for ListStreamObjects {
1424        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1425            &mut self.0.options
1426        }
1427    }
1428
1429    /// The request builder for [Datastream::start_backfill_job][super::super::client::Datastream::start_backfill_job] calls.
1430    #[derive(Clone, Debug)]
1431    pub struct StartBackfillJob(RequestBuilder<crate::model::StartBackfillJobRequest>);
1432
1433    impl StartBackfillJob {
1434        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1435            Self(RequestBuilder::new(stub))
1436        }
1437
1438        /// Sets the full request, replacing any prior values.
1439        pub fn with_request<V: Into<crate::model::StartBackfillJobRequest>>(
1440            mut self,
1441            v: V,
1442        ) -> Self {
1443            self.0.request = v.into();
1444            self
1445        }
1446
1447        /// Sets all the options, replacing any prior values.
1448        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1449            self.0.options = v.into();
1450            self
1451        }
1452
1453        /// Sends the request.
1454        pub async fn send(self) -> Result<crate::model::StartBackfillJobResponse> {
1455            (*self.0.stub)
1456                .start_backfill_job(self.0.request, self.0.options)
1457                .await
1458                .map(gax::response::Response::into_body)
1459        }
1460
1461        /// Sets the value of [object][crate::model::StartBackfillJobRequest::object].
1462        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1463            self.0.request.object = v.into();
1464            self
1465        }
1466    }
1467
1468    #[doc(hidden)]
1469    impl gax::options::internal::RequestBuilder for StartBackfillJob {
1470        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1471            &mut self.0.options
1472        }
1473    }
1474
1475    /// The request builder for [Datastream::stop_backfill_job][super::super::client::Datastream::stop_backfill_job] calls.
1476    #[derive(Clone, Debug)]
1477    pub struct StopBackfillJob(RequestBuilder<crate::model::StopBackfillJobRequest>);
1478
1479    impl StopBackfillJob {
1480        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1481            Self(RequestBuilder::new(stub))
1482        }
1483
1484        /// Sets the full request, replacing any prior values.
1485        pub fn with_request<V: Into<crate::model::StopBackfillJobRequest>>(mut self, v: V) -> Self {
1486            self.0.request = v.into();
1487            self
1488        }
1489
1490        /// Sets all the options, replacing any prior values.
1491        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1492            self.0.options = v.into();
1493            self
1494        }
1495
1496        /// Sends the request.
1497        pub async fn send(self) -> Result<crate::model::StopBackfillJobResponse> {
1498            (*self.0.stub)
1499                .stop_backfill_job(self.0.request, self.0.options)
1500                .await
1501                .map(gax::response::Response::into_body)
1502        }
1503
1504        /// Sets the value of [object][crate::model::StopBackfillJobRequest::object].
1505        pub fn set_object<T: Into<std::string::String>>(mut self, v: T) -> Self {
1506            self.0.request.object = v.into();
1507            self
1508        }
1509    }
1510
1511    #[doc(hidden)]
1512    impl gax::options::internal::RequestBuilder for StopBackfillJob {
1513        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1514            &mut self.0.options
1515        }
1516    }
1517
1518    /// The request builder for [Datastream::fetch_static_ips][super::super::client::Datastream::fetch_static_ips] calls.
1519    #[derive(Clone, Debug)]
1520    pub struct FetchStaticIps(RequestBuilder<crate::model::FetchStaticIpsRequest>);
1521
1522    impl FetchStaticIps {
1523        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1524            Self(RequestBuilder::new(stub))
1525        }
1526
1527        /// Sets the full request, replacing any prior values.
1528        pub fn with_request<V: Into<crate::model::FetchStaticIpsRequest>>(mut self, v: V) -> Self {
1529            self.0.request = v.into();
1530            self
1531        }
1532
1533        /// Sets all the options, replacing any prior values.
1534        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1535            self.0.options = v.into();
1536            self
1537        }
1538
1539        /// Sends the request.
1540        pub async fn send(self) -> Result<crate::model::FetchStaticIpsResponse> {
1541            (*self.0.stub)
1542                .fetch_static_ips(self.0.request, self.0.options)
1543                .await
1544                .map(gax::response::Response::into_body)
1545        }
1546
1547        /// Sets the value of [name][crate::model::FetchStaticIpsRequest::name].
1548        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1549            self.0.request.name = v.into();
1550            self
1551        }
1552
1553        /// Sets the value of [page_size][crate::model::FetchStaticIpsRequest::page_size].
1554        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1555            self.0.request.page_size = v.into();
1556            self
1557        }
1558
1559        /// Sets the value of [page_token][crate::model::FetchStaticIpsRequest::page_token].
1560        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1561            self.0.request.page_token = v.into();
1562            self
1563        }
1564    }
1565
1566    #[doc(hidden)]
1567    impl gax::options::internal::RequestBuilder for FetchStaticIps {
1568        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1569            &mut self.0.options
1570        }
1571    }
1572
1573    /// The request builder for [Datastream::create_private_connection][super::super::client::Datastream::create_private_connection] calls.
1574    #[derive(Clone, Debug)]
1575    pub struct CreatePrivateConnection(
1576        RequestBuilder<crate::model::CreatePrivateConnectionRequest>,
1577    );
1578
1579    impl CreatePrivateConnection {
1580        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1581            Self(RequestBuilder::new(stub))
1582        }
1583
1584        /// Sets the full request, replacing any prior values.
1585        pub fn with_request<V: Into<crate::model::CreatePrivateConnectionRequest>>(
1586            mut self,
1587            v: V,
1588        ) -> Self {
1589            self.0.request = v.into();
1590            self
1591        }
1592
1593        /// Sets all the options, replacing any prior values.
1594        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1595            self.0.options = v.into();
1596            self
1597        }
1598
1599        /// Sends the request.
1600        ///
1601        /// # Long running operations
1602        ///
1603        /// This starts, but does not poll, a longrunning operation. More information
1604        /// on [create_private_connection][super::super::client::Datastream::create_private_connection].
1605        pub async fn send(self) -> Result<longrunning::model::Operation> {
1606            (*self.0.stub)
1607                .create_private_connection(self.0.request, self.0.options)
1608                .await
1609                .map(gax::response::Response::into_body)
1610        }
1611
1612        /// Creates a [Poller][lro::Poller] to work with `create_private_connection`.
1613        pub fn poller(
1614            self,
1615        ) -> impl lro::Poller<crate::model::PrivateConnection, crate::model::OperationMetadata>
1616        {
1617            type Operation =
1618                lro::Operation<crate::model::PrivateConnection, crate::model::OperationMetadata>;
1619            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1620            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1621
1622            let stub = self.0.stub.clone();
1623            let mut options = self.0.options.clone();
1624            options.set_retry_policy(gax::retry_policy::NeverRetry);
1625            let query = move |name| {
1626                let stub = stub.clone();
1627                let options = options.clone();
1628                async {
1629                    let op = GetOperation::new(stub)
1630                        .set_name(name)
1631                        .with_options(options)
1632                        .send()
1633                        .await?;
1634                    Ok(Operation::new(op))
1635                }
1636            };
1637
1638            let start = move || async {
1639                let op = self.send().await?;
1640                Ok(Operation::new(op))
1641            };
1642
1643            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1644        }
1645
1646        /// Sets the value of [parent][crate::model::CreatePrivateConnectionRequest::parent].
1647        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1648            self.0.request.parent = v.into();
1649            self
1650        }
1651
1652        /// Sets the value of [private_connection_id][crate::model::CreatePrivateConnectionRequest::private_connection_id].
1653        pub fn set_private_connection_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1654            self.0.request.private_connection_id = v.into();
1655            self
1656        }
1657
1658        /// Sets the value of [private_connection][crate::model::CreatePrivateConnectionRequest::private_connection].
1659        pub fn set_private_connection<
1660            T: Into<std::option::Option<crate::model::PrivateConnection>>,
1661        >(
1662            mut self,
1663            v: T,
1664        ) -> Self {
1665            self.0.request.private_connection = v.into();
1666            self
1667        }
1668
1669        /// Sets the value of [request_id][crate::model::CreatePrivateConnectionRequest::request_id].
1670        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1671            self.0.request.request_id = v.into();
1672            self
1673        }
1674
1675        /// Sets the value of [force][crate::model::CreatePrivateConnectionRequest::force].
1676        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1677            self.0.request.force = v.into();
1678            self
1679        }
1680    }
1681
1682    #[doc(hidden)]
1683    impl gax::options::internal::RequestBuilder for CreatePrivateConnection {
1684        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1685            &mut self.0.options
1686        }
1687    }
1688
1689    /// The request builder for [Datastream::get_private_connection][super::super::client::Datastream::get_private_connection] calls.
1690    #[derive(Clone, Debug)]
1691    pub struct GetPrivateConnection(RequestBuilder<crate::model::GetPrivateConnectionRequest>);
1692
1693    impl GetPrivateConnection {
1694        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1695            Self(RequestBuilder::new(stub))
1696        }
1697
1698        /// Sets the full request, replacing any prior values.
1699        pub fn with_request<V: Into<crate::model::GetPrivateConnectionRequest>>(
1700            mut self,
1701            v: V,
1702        ) -> Self {
1703            self.0.request = v.into();
1704            self
1705        }
1706
1707        /// Sets all the options, replacing any prior values.
1708        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1709            self.0.options = v.into();
1710            self
1711        }
1712
1713        /// Sends the request.
1714        pub async fn send(self) -> Result<crate::model::PrivateConnection> {
1715            (*self.0.stub)
1716                .get_private_connection(self.0.request, self.0.options)
1717                .await
1718                .map(gax::response::Response::into_body)
1719        }
1720
1721        /// Sets the value of [name][crate::model::GetPrivateConnectionRequest::name].
1722        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1723            self.0.request.name = v.into();
1724            self
1725        }
1726    }
1727
1728    #[doc(hidden)]
1729    impl gax::options::internal::RequestBuilder for GetPrivateConnection {
1730        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1731            &mut self.0.options
1732        }
1733    }
1734
1735    /// The request builder for [Datastream::list_private_connections][super::super::client::Datastream::list_private_connections] calls.
1736    #[derive(Clone, Debug)]
1737    pub struct ListPrivateConnections(RequestBuilder<crate::model::ListPrivateConnectionsRequest>);
1738
1739    impl ListPrivateConnections {
1740        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1741            Self(RequestBuilder::new(stub))
1742        }
1743
1744        /// Sets the full request, replacing any prior values.
1745        pub fn with_request<V: Into<crate::model::ListPrivateConnectionsRequest>>(
1746            mut self,
1747            v: V,
1748        ) -> Self {
1749            self.0.request = v.into();
1750            self
1751        }
1752
1753        /// Sets all the options, replacing any prior values.
1754        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1755            self.0.options = v.into();
1756            self
1757        }
1758
1759        /// Sends the request.
1760        pub async fn send(self) -> Result<crate::model::ListPrivateConnectionsResponse> {
1761            (*self.0.stub)
1762                .list_private_connections(self.0.request, self.0.options)
1763                .await
1764                .map(gax::response::Response::into_body)
1765        }
1766
1767        /// Streams the responses back.
1768        pub async fn paginator(
1769            self,
1770        ) -> impl gax::paginator::Paginator<
1771            crate::model::ListPrivateConnectionsResponse,
1772            gax::error::Error,
1773        > {
1774            use std::clone::Clone;
1775            let token = self.0.request.page_token.clone();
1776            let execute = move |token: String| {
1777                let mut builder = self.clone();
1778                builder.0.request = builder.0.request.set_page_token(token);
1779                builder.send()
1780            };
1781            gax::paginator::internal::new_paginator(token, execute)
1782        }
1783
1784        /// Sets the value of [parent][crate::model::ListPrivateConnectionsRequest::parent].
1785        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1786            self.0.request.parent = v.into();
1787            self
1788        }
1789
1790        /// Sets the value of [page_size][crate::model::ListPrivateConnectionsRequest::page_size].
1791        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1792            self.0.request.page_size = v.into();
1793            self
1794        }
1795
1796        /// Sets the value of [page_token][crate::model::ListPrivateConnectionsRequest::page_token].
1797        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1798            self.0.request.page_token = v.into();
1799            self
1800        }
1801
1802        /// Sets the value of [filter][crate::model::ListPrivateConnectionsRequest::filter].
1803        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1804            self.0.request.filter = v.into();
1805            self
1806        }
1807
1808        /// Sets the value of [order_by][crate::model::ListPrivateConnectionsRequest::order_by].
1809        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1810            self.0.request.order_by = v.into();
1811            self
1812        }
1813    }
1814
1815    #[doc(hidden)]
1816    impl gax::options::internal::RequestBuilder for ListPrivateConnections {
1817        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1818            &mut self.0.options
1819        }
1820    }
1821
1822    /// The request builder for [Datastream::delete_private_connection][super::super::client::Datastream::delete_private_connection] calls.
1823    #[derive(Clone, Debug)]
1824    pub struct DeletePrivateConnection(
1825        RequestBuilder<crate::model::DeletePrivateConnectionRequest>,
1826    );
1827
1828    impl DeletePrivateConnection {
1829        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
1830            Self(RequestBuilder::new(stub))
1831        }
1832
1833        /// Sets the full request, replacing any prior values.
1834        pub fn with_request<V: Into<crate::model::DeletePrivateConnectionRequest>>(
1835            mut self,
1836            v: V,
1837        ) -> Self {
1838            self.0.request = v.into();
1839            self
1840        }
1841
1842        /// Sets all the options, replacing any prior values.
1843        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1844            self.0.options = v.into();
1845            self
1846        }
1847
1848        /// Sends the request.
1849        ///
1850        /// # Long running operations
1851        ///
1852        /// This starts, but does not poll, a longrunning operation. More information
1853        /// on [delete_private_connection][super::super::client::Datastream::delete_private_connection].
1854        pub async fn send(self) -> Result<longrunning::model::Operation> {
1855            (*self.0.stub)
1856                .delete_private_connection(self.0.request, self.0.options)
1857                .await
1858                .map(gax::response::Response::into_body)
1859        }
1860
1861        /// Creates a [Poller][lro::Poller] to work with `delete_private_connection`.
1862        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
1863            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
1864            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1865            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1866
1867            let stub = self.0.stub.clone();
1868            let mut options = self.0.options.clone();
1869            options.set_retry_policy(gax::retry_policy::NeverRetry);
1870            let query = move |name| {
1871                let stub = stub.clone();
1872                let options = options.clone();
1873                async {
1874                    let op = GetOperation::new(stub)
1875                        .set_name(name)
1876                        .with_options(options)
1877                        .send()
1878                        .await?;
1879                    Ok(Operation::new(op))
1880                }
1881            };
1882
1883            let start = move || async {
1884                let op = self.send().await?;
1885                Ok(Operation::new(op))
1886            };
1887
1888            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1889        }
1890
1891        /// Sets the value of [name][crate::model::DeletePrivateConnectionRequest::name].
1892        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1893            self.0.request.name = v.into();
1894            self
1895        }
1896
1897        /// Sets the value of [request_id][crate::model::DeletePrivateConnectionRequest::request_id].
1898        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1899            self.0.request.request_id = v.into();
1900            self
1901        }
1902
1903        /// Sets the value of [force][crate::model::DeletePrivateConnectionRequest::force].
1904        pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1905            self.0.request.force = v.into();
1906            self
1907        }
1908    }
1909
1910    #[doc(hidden)]
1911    impl gax::options::internal::RequestBuilder for DeletePrivateConnection {
1912        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1913            &mut self.0.options
1914        }
1915    }
1916
1917    /// The request builder for [Datastream::create_route][super::super::client::Datastream::create_route] calls.
1918    #[derive(Clone, Debug)]
1919    pub struct CreateRoute(RequestBuilder<crate::model::CreateRouteRequest>);
1920
1921    impl CreateRoute {
1922        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> 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::CreateRouteRequest>>(mut self, v: V) -> Self {
1928            self.0.request = v.into();
1929            self
1930        }
1931
1932        /// Sets all the options, replacing any prior values.
1933        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1934            self.0.options = v.into();
1935            self
1936        }
1937
1938        /// Sends the request.
1939        ///
1940        /// # Long running operations
1941        ///
1942        /// This starts, but does not poll, a longrunning operation. More information
1943        /// on [create_route][super::super::client::Datastream::create_route].
1944        pub async fn send(self) -> Result<longrunning::model::Operation> {
1945            (*self.0.stub)
1946                .create_route(self.0.request, self.0.options)
1947                .await
1948                .map(gax::response::Response::into_body)
1949        }
1950
1951        /// Creates a [Poller][lro::Poller] to work with `create_route`.
1952        pub fn poller(
1953            self,
1954        ) -> impl lro::Poller<crate::model::Route, crate::model::OperationMetadata> {
1955            type Operation = lro::Operation<crate::model::Route, crate::model::OperationMetadata>;
1956            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1957            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1958
1959            let stub = self.0.stub.clone();
1960            let mut options = self.0.options.clone();
1961            options.set_retry_policy(gax::retry_policy::NeverRetry);
1962            let query = move |name| {
1963                let stub = stub.clone();
1964                let options = options.clone();
1965                async {
1966                    let op = GetOperation::new(stub)
1967                        .set_name(name)
1968                        .with_options(options)
1969                        .send()
1970                        .await?;
1971                    Ok(Operation::new(op))
1972                }
1973            };
1974
1975            let start = move || async {
1976                let op = self.send().await?;
1977                Ok(Operation::new(op))
1978            };
1979
1980            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1981        }
1982
1983        /// Sets the value of [parent][crate::model::CreateRouteRequest::parent].
1984        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1985            self.0.request.parent = v.into();
1986            self
1987        }
1988
1989        /// Sets the value of [route_id][crate::model::CreateRouteRequest::route_id].
1990        pub fn set_route_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1991            self.0.request.route_id = v.into();
1992            self
1993        }
1994
1995        /// Sets the value of [route][crate::model::CreateRouteRequest::route].
1996        pub fn set_route<T: Into<std::option::Option<crate::model::Route>>>(
1997            mut self,
1998            v: T,
1999        ) -> Self {
2000            self.0.request.route = v.into();
2001            self
2002        }
2003
2004        /// Sets the value of [request_id][crate::model::CreateRouteRequest::request_id].
2005        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2006            self.0.request.request_id = v.into();
2007            self
2008        }
2009    }
2010
2011    #[doc(hidden)]
2012    impl gax::options::internal::RequestBuilder for CreateRoute {
2013        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2014            &mut self.0.options
2015        }
2016    }
2017
2018    /// The request builder for [Datastream::get_route][super::super::client::Datastream::get_route] calls.
2019    #[derive(Clone, Debug)]
2020    pub struct GetRoute(RequestBuilder<crate::model::GetRouteRequest>);
2021
2022    impl GetRoute {
2023        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2024            Self(RequestBuilder::new(stub))
2025        }
2026
2027        /// Sets the full request, replacing any prior values.
2028        pub fn with_request<V: Into<crate::model::GetRouteRequest>>(mut self, v: V) -> Self {
2029            self.0.request = v.into();
2030            self
2031        }
2032
2033        /// Sets all the options, replacing any prior values.
2034        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2035            self.0.options = v.into();
2036            self
2037        }
2038
2039        /// Sends the request.
2040        pub async fn send(self) -> Result<crate::model::Route> {
2041            (*self.0.stub)
2042                .get_route(self.0.request, self.0.options)
2043                .await
2044                .map(gax::response::Response::into_body)
2045        }
2046
2047        /// Sets the value of [name][crate::model::GetRouteRequest::name].
2048        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2049            self.0.request.name = v.into();
2050            self
2051        }
2052    }
2053
2054    #[doc(hidden)]
2055    impl gax::options::internal::RequestBuilder for GetRoute {
2056        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2057            &mut self.0.options
2058        }
2059    }
2060
2061    /// The request builder for [Datastream::list_routes][super::super::client::Datastream::list_routes] calls.
2062    #[derive(Clone, Debug)]
2063    pub struct ListRoutes(RequestBuilder<crate::model::ListRoutesRequest>);
2064
2065    impl ListRoutes {
2066        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2067            Self(RequestBuilder::new(stub))
2068        }
2069
2070        /// Sets the full request, replacing any prior values.
2071        pub fn with_request<V: Into<crate::model::ListRoutesRequest>>(mut self, v: V) -> Self {
2072            self.0.request = v.into();
2073            self
2074        }
2075
2076        /// Sets all the options, replacing any prior values.
2077        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2078            self.0.options = v.into();
2079            self
2080        }
2081
2082        /// Sends the request.
2083        pub async fn send(self) -> Result<crate::model::ListRoutesResponse> {
2084            (*self.0.stub)
2085                .list_routes(self.0.request, self.0.options)
2086                .await
2087                .map(gax::response::Response::into_body)
2088        }
2089
2090        /// Streams the responses back.
2091        pub async fn paginator(
2092            self,
2093        ) -> impl gax::paginator::Paginator<crate::model::ListRoutesResponse, gax::error::Error>
2094        {
2095            use std::clone::Clone;
2096            let token = self.0.request.page_token.clone();
2097            let execute = move |token: String| {
2098                let mut builder = self.clone();
2099                builder.0.request = builder.0.request.set_page_token(token);
2100                builder.send()
2101            };
2102            gax::paginator::internal::new_paginator(token, execute)
2103        }
2104
2105        /// Sets the value of [parent][crate::model::ListRoutesRequest::parent].
2106        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2107            self.0.request.parent = v.into();
2108            self
2109        }
2110
2111        /// Sets the value of [page_size][crate::model::ListRoutesRequest::page_size].
2112        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2113            self.0.request.page_size = v.into();
2114            self
2115        }
2116
2117        /// Sets the value of [page_token][crate::model::ListRoutesRequest::page_token].
2118        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2119            self.0.request.page_token = v.into();
2120            self
2121        }
2122
2123        /// Sets the value of [filter][crate::model::ListRoutesRequest::filter].
2124        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2125            self.0.request.filter = v.into();
2126            self
2127        }
2128
2129        /// Sets the value of [order_by][crate::model::ListRoutesRequest::order_by].
2130        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2131            self.0.request.order_by = v.into();
2132            self
2133        }
2134    }
2135
2136    #[doc(hidden)]
2137    impl gax::options::internal::RequestBuilder for ListRoutes {
2138        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2139            &mut self.0.options
2140        }
2141    }
2142
2143    /// The request builder for [Datastream::delete_route][super::super::client::Datastream::delete_route] calls.
2144    #[derive(Clone, Debug)]
2145    pub struct DeleteRoute(RequestBuilder<crate::model::DeleteRouteRequest>);
2146
2147    impl DeleteRoute {
2148        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2149            Self(RequestBuilder::new(stub))
2150        }
2151
2152        /// Sets the full request, replacing any prior values.
2153        pub fn with_request<V: Into<crate::model::DeleteRouteRequest>>(mut self, v: V) -> Self {
2154            self.0.request = v.into();
2155            self
2156        }
2157
2158        /// Sets all the options, replacing any prior values.
2159        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2160            self.0.options = v.into();
2161            self
2162        }
2163
2164        /// Sends the request.
2165        ///
2166        /// # Long running operations
2167        ///
2168        /// This starts, but does not poll, a longrunning operation. More information
2169        /// on [delete_route][super::super::client::Datastream::delete_route].
2170        pub async fn send(self) -> Result<longrunning::model::Operation> {
2171            (*self.0.stub)
2172                .delete_route(self.0.request, self.0.options)
2173                .await
2174                .map(gax::response::Response::into_body)
2175        }
2176
2177        /// Creates a [Poller][lro::Poller] to work with `delete_route`.
2178        pub fn poller(self) -> impl lro::Poller<wkt::Empty, crate::model::OperationMetadata> {
2179            type Operation = lro::Operation<wkt::Empty, crate::model::OperationMetadata>;
2180            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2181            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2182
2183            let stub = self.0.stub.clone();
2184            let mut options = self.0.options.clone();
2185            options.set_retry_policy(gax::retry_policy::NeverRetry);
2186            let query = move |name| {
2187                let stub = stub.clone();
2188                let options = options.clone();
2189                async {
2190                    let op = GetOperation::new(stub)
2191                        .set_name(name)
2192                        .with_options(options)
2193                        .send()
2194                        .await?;
2195                    Ok(Operation::new(op))
2196                }
2197            };
2198
2199            let start = move || async {
2200                let op = self.send().await?;
2201                Ok(Operation::new(op))
2202            };
2203
2204            lro::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2205        }
2206
2207        /// Sets the value of [name][crate::model::DeleteRouteRequest::name].
2208        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2209            self.0.request.name = v.into();
2210            self
2211        }
2212
2213        /// Sets the value of [request_id][crate::model::DeleteRouteRequest::request_id].
2214        pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2215            self.0.request.request_id = v.into();
2216            self
2217        }
2218    }
2219
2220    #[doc(hidden)]
2221    impl gax::options::internal::RequestBuilder for DeleteRoute {
2222        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2223            &mut self.0.options
2224        }
2225    }
2226
2227    /// The request builder for [Datastream::list_locations][super::super::client::Datastream::list_locations] calls.
2228    #[derive(Clone, Debug)]
2229    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
2230
2231    impl ListLocations {
2232        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2233            Self(RequestBuilder::new(stub))
2234        }
2235
2236        /// Sets the full request, replacing any prior values.
2237        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
2238            mut self,
2239            v: V,
2240        ) -> Self {
2241            self.0.request = v.into();
2242            self
2243        }
2244
2245        /// Sets all the options, replacing any prior values.
2246        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2247            self.0.options = v.into();
2248            self
2249        }
2250
2251        /// Sends the request.
2252        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
2253            (*self.0.stub)
2254                .list_locations(self.0.request, self.0.options)
2255                .await
2256                .map(gax::response::Response::into_body)
2257        }
2258
2259        /// Streams the responses back.
2260        pub async fn paginator(
2261            self,
2262        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
2263        {
2264            use std::clone::Clone;
2265            let token = self.0.request.page_token.clone();
2266            let execute = move |token: String| {
2267                let mut builder = self.clone();
2268                builder.0.request = builder.0.request.set_page_token(token);
2269                builder.send()
2270            };
2271            gax::paginator::internal::new_paginator(token, execute)
2272        }
2273
2274        /// Sets the value of [name][location::model::ListLocationsRequest::name].
2275        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2276            self.0.request.name = v.into();
2277            self
2278        }
2279
2280        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
2281        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2282            self.0.request.filter = v.into();
2283            self
2284        }
2285
2286        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
2287        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2288            self.0.request.page_size = v.into();
2289            self
2290        }
2291
2292        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
2293        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2294            self.0.request.page_token = v.into();
2295            self
2296        }
2297    }
2298
2299    #[doc(hidden)]
2300    impl gax::options::internal::RequestBuilder for ListLocations {
2301        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2302            &mut self.0.options
2303        }
2304    }
2305
2306    /// The request builder for [Datastream::get_location][super::super::client::Datastream::get_location] calls.
2307    #[derive(Clone, Debug)]
2308    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
2309
2310    impl GetLocation {
2311        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2312            Self(RequestBuilder::new(stub))
2313        }
2314
2315        /// Sets the full request, replacing any prior values.
2316        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
2317            self.0.request = v.into();
2318            self
2319        }
2320
2321        /// Sets all the options, replacing any prior values.
2322        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2323            self.0.options = v.into();
2324            self
2325        }
2326
2327        /// Sends the request.
2328        pub async fn send(self) -> Result<location::model::Location> {
2329            (*self.0.stub)
2330                .get_location(self.0.request, self.0.options)
2331                .await
2332                .map(gax::response::Response::into_body)
2333        }
2334
2335        /// Sets the value of [name][location::model::GetLocationRequest::name].
2336        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2337            self.0.request.name = v.into();
2338            self
2339        }
2340    }
2341
2342    #[doc(hidden)]
2343    impl gax::options::internal::RequestBuilder for GetLocation {
2344        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2345            &mut self.0.options
2346        }
2347    }
2348
2349    /// The request builder for [Datastream::list_operations][super::super::client::Datastream::list_operations] calls.
2350    #[derive(Clone, Debug)]
2351    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
2352
2353    impl ListOperations {
2354        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2355            Self(RequestBuilder::new(stub))
2356        }
2357
2358        /// Sets the full request, replacing any prior values.
2359        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
2360            mut self,
2361            v: V,
2362        ) -> Self {
2363            self.0.request = v.into();
2364            self
2365        }
2366
2367        /// Sets all the options, replacing any prior values.
2368        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2369            self.0.options = v.into();
2370            self
2371        }
2372
2373        /// Sends the request.
2374        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
2375            (*self.0.stub)
2376                .list_operations(self.0.request, self.0.options)
2377                .await
2378                .map(gax::response::Response::into_body)
2379        }
2380
2381        /// Streams the responses back.
2382        pub async fn paginator(
2383            self,
2384        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
2385        {
2386            use std::clone::Clone;
2387            let token = self.0.request.page_token.clone();
2388            let execute = move |token: String| {
2389                let mut builder = self.clone();
2390                builder.0.request = builder.0.request.set_page_token(token);
2391                builder.send()
2392            };
2393            gax::paginator::internal::new_paginator(token, execute)
2394        }
2395
2396        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
2397        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2398            self.0.request.name = v.into();
2399            self
2400        }
2401
2402        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
2403        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2404            self.0.request.filter = v.into();
2405            self
2406        }
2407
2408        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
2409        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2410            self.0.request.page_size = v.into();
2411            self
2412        }
2413
2414        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
2415        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2416            self.0.request.page_token = v.into();
2417            self
2418        }
2419    }
2420
2421    #[doc(hidden)]
2422    impl gax::options::internal::RequestBuilder for ListOperations {
2423        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2424            &mut self.0.options
2425        }
2426    }
2427
2428    /// The request builder for [Datastream::get_operation][super::super::client::Datastream::get_operation] calls.
2429    #[derive(Clone, Debug)]
2430    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
2431
2432    impl GetOperation {
2433        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2434            Self(RequestBuilder::new(stub))
2435        }
2436
2437        /// Sets the full request, replacing any prior values.
2438        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
2439            mut self,
2440            v: V,
2441        ) -> Self {
2442            self.0.request = v.into();
2443            self
2444        }
2445
2446        /// Sets all the options, replacing any prior values.
2447        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2448            self.0.options = v.into();
2449            self
2450        }
2451
2452        /// Sends the request.
2453        pub async fn send(self) -> Result<longrunning::model::Operation> {
2454            (*self.0.stub)
2455                .get_operation(self.0.request, self.0.options)
2456                .await
2457                .map(gax::response::Response::into_body)
2458        }
2459
2460        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
2461        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2462            self.0.request.name = v.into();
2463            self
2464        }
2465    }
2466
2467    #[doc(hidden)]
2468    impl gax::options::internal::RequestBuilder for GetOperation {
2469        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2470            &mut self.0.options
2471        }
2472    }
2473
2474    /// The request builder for [Datastream::delete_operation][super::super::client::Datastream::delete_operation] calls.
2475    #[derive(Clone, Debug)]
2476    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
2477
2478    impl DeleteOperation {
2479        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2480            Self(RequestBuilder::new(stub))
2481        }
2482
2483        /// Sets the full request, replacing any prior values.
2484        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
2485            mut self,
2486            v: V,
2487        ) -> Self {
2488            self.0.request = v.into();
2489            self
2490        }
2491
2492        /// Sets all the options, replacing any prior values.
2493        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2494            self.0.options = v.into();
2495            self
2496        }
2497
2498        /// Sends the request.
2499        pub async fn send(self) -> Result<()> {
2500            (*self.0.stub)
2501                .delete_operation(self.0.request, self.0.options)
2502                .await
2503                .map(gax::response::Response::into_body)
2504        }
2505
2506        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
2507        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2508            self.0.request.name = v.into();
2509            self
2510        }
2511    }
2512
2513    #[doc(hidden)]
2514    impl gax::options::internal::RequestBuilder for DeleteOperation {
2515        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2516            &mut self.0.options
2517        }
2518    }
2519
2520    /// The request builder for [Datastream::cancel_operation][super::super::client::Datastream::cancel_operation] calls.
2521    #[derive(Clone, Debug)]
2522    pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
2523
2524    impl CancelOperation {
2525        pub(crate) fn new(stub: Arc<dyn super::super::stub::dynamic::Datastream>) -> Self {
2526            Self(RequestBuilder::new(stub))
2527        }
2528
2529        /// Sets the full request, replacing any prior values.
2530        pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
2531            mut self,
2532            v: V,
2533        ) -> Self {
2534            self.0.request = v.into();
2535            self
2536        }
2537
2538        /// Sets all the options, replacing any prior values.
2539        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2540            self.0.options = v.into();
2541            self
2542        }
2543
2544        /// Sends the request.
2545        pub async fn send(self) -> Result<()> {
2546            (*self.0.stub)
2547                .cancel_operation(self.0.request, self.0.options)
2548                .await
2549                .map(gax::response::Response::into_body)
2550        }
2551
2552        /// Sets the value of [name][longrunning::model::CancelOperationRequest::name].
2553        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2554            self.0.request.name = v.into();
2555            self
2556        }
2557    }
2558
2559    #[doc(hidden)]
2560    impl gax::options::internal::RequestBuilder for CancelOperation {
2561        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2562            &mut self.0.options
2563        }
2564    }
2565}