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