google_cloud_workflows_v1/
builder.rs

1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17pub mod workflows {
18    use crate::Result;
19
20    /// A builder for [Workflows][crate::client::Workflows].
21    ///
22    /// ```
23    /// # tokio_test::block_on(async {
24    /// # use google_cloud_workflows_v1::*;
25    /// # use builder::workflows::ClientBuilder;
26    /// # use client::Workflows;
27    /// let builder : ClientBuilder = Workflows::builder();
28    /// let client = builder
29    ///     .with_endpoint("https://workflows.googleapis.com")
30    ///     .build().await?;
31    /// # gax::client_builder::Result::<()>::Ok(()) });
32    /// ```
33    pub type ClientBuilder =
34        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36    pub(crate) mod client {
37        use super::super::super::client::Workflows;
38        pub struct Factory;
39        impl gax::client_builder::internal::ClientFactory for Factory {
40            type Client = Workflows;
41            type Credentials = gaxi::options::Credentials;
42            async fn build(
43                self,
44                config: gaxi::options::ClientConfig,
45            ) -> gax::client_builder::Result<Self::Client> {
46                Self::Client::new(config).await
47            }
48        }
49    }
50
51    /// Common implementation for [crate::client::Workflows] request builders.
52    #[derive(Clone, Debug)]
53    pub(crate) struct RequestBuilder<R: std::default::Default> {
54        stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
55        request: R,
56        options: gax::options::RequestOptions,
57    }
58
59    impl<R> RequestBuilder<R>
60    where
61        R: std::default::Default,
62    {
63        pub(crate) fn new(
64            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
65        ) -> Self {
66            Self {
67                stub,
68                request: R::default(),
69                options: gax::options::RequestOptions::default(),
70            }
71        }
72    }
73
74    /// The request builder for [Workflows::list_workflows][crate::client::Workflows::list_workflows] calls.
75    ///
76    /// # Example
77    /// ```no_run
78    /// # use google_cloud_workflows_v1::builder;
79    /// use builder::workflows::ListWorkflows;
80    /// # tokio_test::block_on(async {
81    /// use gax::paginator::ItemPaginator;
82    ///
83    /// let builder = prepare_request_builder();
84    /// let mut items = builder.by_item();
85    /// while let Some(result) = items.next().await {
86    ///   let item = result?;
87    /// }
88    /// # gax::Result::<()>::Ok(()) });
89    ///
90    /// fn prepare_request_builder() -> ListWorkflows {
91    ///   # panic!();
92    ///   // ... details omitted ...
93    /// }
94    /// ```
95    #[derive(Clone, Debug)]
96    pub struct ListWorkflows(RequestBuilder<crate::model::ListWorkflowsRequest>);
97
98    impl ListWorkflows {
99        pub(crate) fn new(
100            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
101        ) -> Self {
102            Self(RequestBuilder::new(stub))
103        }
104
105        /// Sets the full request, replacing any prior values.
106        pub fn with_request<V: Into<crate::model::ListWorkflowsRequest>>(mut self, v: V) -> Self {
107            self.0.request = v.into();
108            self
109        }
110
111        /// Sets all the options, replacing any prior values.
112        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113            self.0.options = v.into();
114            self
115        }
116
117        /// Sends the request.
118        pub async fn send(self) -> Result<crate::model::ListWorkflowsResponse> {
119            (*self.0.stub)
120                .list_workflows(self.0.request, self.0.options)
121                .await
122                .map(gax::response::Response::into_body)
123        }
124
125        /// Streams each page in the collection.
126        pub fn by_page(
127            self,
128        ) -> impl gax::paginator::Paginator<crate::model::ListWorkflowsResponse, gax::error::Error>
129        {
130            use std::clone::Clone;
131            let token = self.0.request.page_token.clone();
132            let execute = move |token: String| {
133                let mut builder = self.clone();
134                builder.0.request = builder.0.request.set_page_token(token);
135                builder.send()
136            };
137            gax::paginator::internal::new_paginator(token, execute)
138        }
139
140        /// Streams each item in the collection.
141        pub fn by_item(
142            self,
143        ) -> impl gax::paginator::ItemPaginator<crate::model::ListWorkflowsResponse, gax::error::Error>
144        {
145            use gax::paginator::Paginator;
146            self.by_page().items()
147        }
148
149        /// Sets the value of [parent][crate::model::ListWorkflowsRequest::parent].
150        ///
151        /// This is a **required** field for requests.
152        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153            self.0.request.parent = v.into();
154            self
155        }
156
157        /// Sets the value of [page_size][crate::model::ListWorkflowsRequest::page_size].
158        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159            self.0.request.page_size = v.into();
160            self
161        }
162
163        /// Sets the value of [page_token][crate::model::ListWorkflowsRequest::page_token].
164        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165            self.0.request.page_token = v.into();
166            self
167        }
168
169        /// Sets the value of [filter][crate::model::ListWorkflowsRequest::filter].
170        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
171            self.0.request.filter = v.into();
172            self
173        }
174
175        /// Sets the value of [order_by][crate::model::ListWorkflowsRequest::order_by].
176        pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
177            self.0.request.order_by = v.into();
178            self
179        }
180    }
181
182    #[doc(hidden)]
183    impl gax::options::internal::RequestBuilder for ListWorkflows {
184        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
185            &mut self.0.options
186        }
187    }
188
189    /// The request builder for [Workflows::get_workflow][crate::client::Workflows::get_workflow] calls.
190    ///
191    /// # Example
192    /// ```no_run
193    /// # use google_cloud_workflows_v1::builder;
194    /// use builder::workflows::GetWorkflow;
195    /// # tokio_test::block_on(async {
196    ///
197    /// let builder = prepare_request_builder();
198    /// let response = builder.send().await?;
199    /// # gax::Result::<()>::Ok(()) });
200    ///
201    /// fn prepare_request_builder() -> GetWorkflow {
202    ///   # panic!();
203    ///   // ... details omitted ...
204    /// }
205    /// ```
206    #[derive(Clone, Debug)]
207    pub struct GetWorkflow(RequestBuilder<crate::model::GetWorkflowRequest>);
208
209    impl GetWorkflow {
210        pub(crate) fn new(
211            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
212        ) -> Self {
213            Self(RequestBuilder::new(stub))
214        }
215
216        /// Sets the full request, replacing any prior values.
217        pub fn with_request<V: Into<crate::model::GetWorkflowRequest>>(mut self, v: V) -> Self {
218            self.0.request = v.into();
219            self
220        }
221
222        /// Sets all the options, replacing any prior values.
223        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
224            self.0.options = v.into();
225            self
226        }
227
228        /// Sends the request.
229        pub async fn send(self) -> Result<crate::model::Workflow> {
230            (*self.0.stub)
231                .get_workflow(self.0.request, self.0.options)
232                .await
233                .map(gax::response::Response::into_body)
234        }
235
236        /// Sets the value of [name][crate::model::GetWorkflowRequest::name].
237        ///
238        /// This is a **required** field for requests.
239        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
240            self.0.request.name = v.into();
241            self
242        }
243
244        /// Sets the value of [revision_id][crate::model::GetWorkflowRequest::revision_id].
245        pub fn set_revision_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
246            self.0.request.revision_id = v.into();
247            self
248        }
249    }
250
251    #[doc(hidden)]
252    impl gax::options::internal::RequestBuilder for GetWorkflow {
253        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
254            &mut self.0.options
255        }
256    }
257
258    /// The request builder for [Workflows::create_workflow][crate::client::Workflows::create_workflow] calls.
259    ///
260    /// # Example
261    /// ```no_run
262    /// # use google_cloud_workflows_v1::builder;
263    /// use builder::workflows::CreateWorkflow;
264    /// # tokio_test::block_on(async {
265    /// use lro::Poller;
266    ///
267    /// let builder = prepare_request_builder();
268    /// let response = builder.poller().until_done().await?;
269    /// # gax::Result::<()>::Ok(()) });
270    ///
271    /// fn prepare_request_builder() -> CreateWorkflow {
272    ///   # panic!();
273    ///   // ... details omitted ...
274    /// }
275    /// ```
276    #[derive(Clone, Debug)]
277    pub struct CreateWorkflow(RequestBuilder<crate::model::CreateWorkflowRequest>);
278
279    impl CreateWorkflow {
280        pub(crate) fn new(
281            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
282        ) -> Self {
283            Self(RequestBuilder::new(stub))
284        }
285
286        /// Sets the full request, replacing any prior values.
287        pub fn with_request<V: Into<crate::model::CreateWorkflowRequest>>(mut self, v: V) -> Self {
288            self.0.request = v.into();
289            self
290        }
291
292        /// Sets all the options, replacing any prior values.
293        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
294            self.0.options = v.into();
295            self
296        }
297
298        /// Sends the request.
299        ///
300        /// # Long running operations
301        ///
302        /// This starts, but does not poll, a longrunning operation. More information
303        /// on [create_workflow][crate::client::Workflows::create_workflow].
304        pub async fn send(self) -> Result<longrunning::model::Operation> {
305            (*self.0.stub)
306                .create_workflow(self.0.request, self.0.options)
307                .await
308                .map(gax::response::Response::into_body)
309        }
310
311        /// Creates a [Poller][lro::Poller] to work with `create_workflow`.
312        pub fn poller(
313            self,
314        ) -> impl lro::Poller<crate::model::Workflow, crate::model::OperationMetadata> {
315            type Operation =
316                lro::internal::Operation<crate::model::Workflow, crate::model::OperationMetadata>;
317            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
318            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
319
320            let stub = self.0.stub.clone();
321            let mut options = self.0.options.clone();
322            options.set_retry_policy(gax::retry_policy::NeverRetry);
323            let query = move |name| {
324                let stub = stub.clone();
325                let options = options.clone();
326                async {
327                    let op = GetOperation::new(stub)
328                        .set_name(name)
329                        .with_options(options)
330                        .send()
331                        .await?;
332                    Ok(Operation::new(op))
333                }
334            };
335
336            let start = move || async {
337                let op = self.send().await?;
338                Ok(Operation::new(op))
339            };
340
341            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
342        }
343
344        /// Sets the value of [parent][crate::model::CreateWorkflowRequest::parent].
345        ///
346        /// This is a **required** field for requests.
347        pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
348            self.0.request.parent = v.into();
349            self
350        }
351
352        /// Sets the value of [workflow][crate::model::CreateWorkflowRequest::workflow].
353        ///
354        /// This is a **required** field for requests.
355        pub fn set_workflow<T>(mut self, v: T) -> Self
356        where
357            T: std::convert::Into<crate::model::Workflow>,
358        {
359            self.0.request.workflow = std::option::Option::Some(v.into());
360            self
361        }
362
363        /// Sets or clears the value of [workflow][crate::model::CreateWorkflowRequest::workflow].
364        ///
365        /// This is a **required** field for requests.
366        pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
367        where
368            T: std::convert::Into<crate::model::Workflow>,
369        {
370            self.0.request.workflow = v.map(|x| x.into());
371            self
372        }
373
374        /// Sets the value of [workflow_id][crate::model::CreateWorkflowRequest::workflow_id].
375        ///
376        /// This is a **required** field for requests.
377        pub fn set_workflow_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
378            self.0.request.workflow_id = v.into();
379            self
380        }
381    }
382
383    #[doc(hidden)]
384    impl gax::options::internal::RequestBuilder for CreateWorkflow {
385        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
386            &mut self.0.options
387        }
388    }
389
390    /// The request builder for [Workflows::delete_workflow][crate::client::Workflows::delete_workflow] calls.
391    ///
392    /// # Example
393    /// ```no_run
394    /// # use google_cloud_workflows_v1::builder;
395    /// use builder::workflows::DeleteWorkflow;
396    /// # tokio_test::block_on(async {
397    /// use lro::Poller;
398    ///
399    /// let builder = prepare_request_builder();
400    /// let response = builder.poller().until_done().await?;
401    /// # gax::Result::<()>::Ok(()) });
402    ///
403    /// fn prepare_request_builder() -> DeleteWorkflow {
404    ///   # panic!();
405    ///   // ... details omitted ...
406    /// }
407    /// ```
408    #[derive(Clone, Debug)]
409    pub struct DeleteWorkflow(RequestBuilder<crate::model::DeleteWorkflowRequest>);
410
411    impl DeleteWorkflow {
412        pub(crate) fn new(
413            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
414        ) -> Self {
415            Self(RequestBuilder::new(stub))
416        }
417
418        /// Sets the full request, replacing any prior values.
419        pub fn with_request<V: Into<crate::model::DeleteWorkflowRequest>>(mut self, v: V) -> Self {
420            self.0.request = v.into();
421            self
422        }
423
424        /// Sets all the options, replacing any prior values.
425        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
426            self.0.options = v.into();
427            self
428        }
429
430        /// Sends the request.
431        ///
432        /// # Long running operations
433        ///
434        /// This starts, but does not poll, a longrunning operation. More information
435        /// on [delete_workflow][crate::client::Workflows::delete_workflow].
436        pub async fn send(self) -> Result<longrunning::model::Operation> {
437            (*self.0.stub)
438                .delete_workflow(self.0.request, self.0.options)
439                .await
440                .map(gax::response::Response::into_body)
441        }
442
443        /// Creates a [Poller][lro::Poller] to work with `delete_workflow`.
444        pub fn poller(self) -> impl lro::Poller<(), crate::model::OperationMetadata> {
445            type Operation = lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
446            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
447            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
448
449            let stub = self.0.stub.clone();
450            let mut options = self.0.options.clone();
451            options.set_retry_policy(gax::retry_policy::NeverRetry);
452            let query = move |name| {
453                let stub = stub.clone();
454                let options = options.clone();
455                async {
456                    let op = GetOperation::new(stub)
457                        .set_name(name)
458                        .with_options(options)
459                        .send()
460                        .await?;
461                    Ok(Operation::new(op))
462                }
463            };
464
465            let start = move || async {
466                let op = self.send().await?;
467                Ok(Operation::new(op))
468            };
469
470            lro::internal::new_unit_response_poller(
471                polling_error_policy,
472                polling_backoff_policy,
473                start,
474                query,
475            )
476        }
477
478        /// Sets the value of [name][crate::model::DeleteWorkflowRequest::name].
479        ///
480        /// This is a **required** field for requests.
481        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
482            self.0.request.name = v.into();
483            self
484        }
485    }
486
487    #[doc(hidden)]
488    impl gax::options::internal::RequestBuilder for DeleteWorkflow {
489        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
490            &mut self.0.options
491        }
492    }
493
494    /// The request builder for [Workflows::update_workflow][crate::client::Workflows::update_workflow] calls.
495    ///
496    /// # Example
497    /// ```no_run
498    /// # use google_cloud_workflows_v1::builder;
499    /// use builder::workflows::UpdateWorkflow;
500    /// # tokio_test::block_on(async {
501    /// use lro::Poller;
502    ///
503    /// let builder = prepare_request_builder();
504    /// let response = builder.poller().until_done().await?;
505    /// # gax::Result::<()>::Ok(()) });
506    ///
507    /// fn prepare_request_builder() -> UpdateWorkflow {
508    ///   # panic!();
509    ///   // ... details omitted ...
510    /// }
511    /// ```
512    #[derive(Clone, Debug)]
513    pub struct UpdateWorkflow(RequestBuilder<crate::model::UpdateWorkflowRequest>);
514
515    impl UpdateWorkflow {
516        pub(crate) fn new(
517            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
518        ) -> Self {
519            Self(RequestBuilder::new(stub))
520        }
521
522        /// Sets the full request, replacing any prior values.
523        pub fn with_request<V: Into<crate::model::UpdateWorkflowRequest>>(mut self, v: V) -> Self {
524            self.0.request = v.into();
525            self
526        }
527
528        /// Sets all the options, replacing any prior values.
529        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
530            self.0.options = v.into();
531            self
532        }
533
534        /// Sends the request.
535        ///
536        /// # Long running operations
537        ///
538        /// This starts, but does not poll, a longrunning operation. More information
539        /// on [update_workflow][crate::client::Workflows::update_workflow].
540        pub async fn send(self) -> Result<longrunning::model::Operation> {
541            (*self.0.stub)
542                .update_workflow(self.0.request, self.0.options)
543                .await
544                .map(gax::response::Response::into_body)
545        }
546
547        /// Creates a [Poller][lro::Poller] to work with `update_workflow`.
548        pub fn poller(
549            self,
550        ) -> impl lro::Poller<crate::model::Workflow, crate::model::OperationMetadata> {
551            type Operation =
552                lro::internal::Operation<crate::model::Workflow, crate::model::OperationMetadata>;
553            let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
554            let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
555
556            let stub = self.0.stub.clone();
557            let mut options = self.0.options.clone();
558            options.set_retry_policy(gax::retry_policy::NeverRetry);
559            let query = move |name| {
560                let stub = stub.clone();
561                let options = options.clone();
562                async {
563                    let op = GetOperation::new(stub)
564                        .set_name(name)
565                        .with_options(options)
566                        .send()
567                        .await?;
568                    Ok(Operation::new(op))
569                }
570            };
571
572            let start = move || async {
573                let op = self.send().await?;
574                Ok(Operation::new(op))
575            };
576
577            lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
578        }
579
580        /// Sets the value of [workflow][crate::model::UpdateWorkflowRequest::workflow].
581        ///
582        /// This is a **required** field for requests.
583        pub fn set_workflow<T>(mut self, v: T) -> Self
584        where
585            T: std::convert::Into<crate::model::Workflow>,
586        {
587            self.0.request.workflow = std::option::Option::Some(v.into());
588            self
589        }
590
591        /// Sets or clears the value of [workflow][crate::model::UpdateWorkflowRequest::workflow].
592        ///
593        /// This is a **required** field for requests.
594        pub fn set_or_clear_workflow<T>(mut self, v: std::option::Option<T>) -> Self
595        where
596            T: std::convert::Into<crate::model::Workflow>,
597        {
598            self.0.request.workflow = v.map(|x| x.into());
599            self
600        }
601
602        /// Sets the value of [update_mask][crate::model::UpdateWorkflowRequest::update_mask].
603        pub fn set_update_mask<T>(mut self, v: T) -> Self
604        where
605            T: std::convert::Into<wkt::FieldMask>,
606        {
607            self.0.request.update_mask = std::option::Option::Some(v.into());
608            self
609        }
610
611        /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowRequest::update_mask].
612        pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
613        where
614            T: std::convert::Into<wkt::FieldMask>,
615        {
616            self.0.request.update_mask = v.map(|x| x.into());
617            self
618        }
619    }
620
621    #[doc(hidden)]
622    impl gax::options::internal::RequestBuilder for UpdateWorkflow {
623        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
624            &mut self.0.options
625        }
626    }
627
628    /// The request builder for [Workflows::list_workflow_revisions][crate::client::Workflows::list_workflow_revisions] calls.
629    ///
630    /// # Example
631    /// ```no_run
632    /// # use google_cloud_workflows_v1::builder;
633    /// use builder::workflows::ListWorkflowRevisions;
634    /// # tokio_test::block_on(async {
635    /// use gax::paginator::ItemPaginator;
636    ///
637    /// let builder = prepare_request_builder();
638    /// let mut items = builder.by_item();
639    /// while let Some(result) = items.next().await {
640    ///   let item = result?;
641    /// }
642    /// # gax::Result::<()>::Ok(()) });
643    ///
644    /// fn prepare_request_builder() -> ListWorkflowRevisions {
645    ///   # panic!();
646    ///   // ... details omitted ...
647    /// }
648    /// ```
649    #[derive(Clone, Debug)]
650    pub struct ListWorkflowRevisions(RequestBuilder<crate::model::ListWorkflowRevisionsRequest>);
651
652    impl ListWorkflowRevisions {
653        pub(crate) fn new(
654            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
655        ) -> Self {
656            Self(RequestBuilder::new(stub))
657        }
658
659        /// Sets the full request, replacing any prior values.
660        pub fn with_request<V: Into<crate::model::ListWorkflowRevisionsRequest>>(
661            mut self,
662            v: V,
663        ) -> Self {
664            self.0.request = v.into();
665            self
666        }
667
668        /// Sets all the options, replacing any prior values.
669        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
670            self.0.options = v.into();
671            self
672        }
673
674        /// Sends the request.
675        pub async fn send(self) -> Result<crate::model::ListWorkflowRevisionsResponse> {
676            (*self.0.stub)
677                .list_workflow_revisions(self.0.request, self.0.options)
678                .await
679                .map(gax::response::Response::into_body)
680        }
681
682        /// Streams each page in the collection.
683        pub fn by_page(
684            self,
685        ) -> impl gax::paginator::Paginator<crate::model::ListWorkflowRevisionsResponse, gax::error::Error>
686        {
687            use std::clone::Clone;
688            let token = self.0.request.page_token.clone();
689            let execute = move |token: String| {
690                let mut builder = self.clone();
691                builder.0.request = builder.0.request.set_page_token(token);
692                builder.send()
693            };
694            gax::paginator::internal::new_paginator(token, execute)
695        }
696
697        /// Streams each item in the collection.
698        pub fn by_item(
699            self,
700        ) -> impl gax::paginator::ItemPaginator<
701            crate::model::ListWorkflowRevisionsResponse,
702            gax::error::Error,
703        > {
704            use gax::paginator::Paginator;
705            self.by_page().items()
706        }
707
708        /// Sets the value of [name][crate::model::ListWorkflowRevisionsRequest::name].
709        ///
710        /// This is a **required** field for requests.
711        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
712            self.0.request.name = v.into();
713            self
714        }
715
716        /// Sets the value of [page_size][crate::model::ListWorkflowRevisionsRequest::page_size].
717        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
718            self.0.request.page_size = v.into();
719            self
720        }
721
722        /// Sets the value of [page_token][crate::model::ListWorkflowRevisionsRequest::page_token].
723        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
724            self.0.request.page_token = v.into();
725            self
726        }
727    }
728
729    #[doc(hidden)]
730    impl gax::options::internal::RequestBuilder for ListWorkflowRevisions {
731        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
732            &mut self.0.options
733        }
734    }
735
736    /// The request builder for [Workflows::list_locations][crate::client::Workflows::list_locations] calls.
737    ///
738    /// # Example
739    /// ```no_run
740    /// # use google_cloud_workflows_v1::builder;
741    /// use builder::workflows::ListLocations;
742    /// # tokio_test::block_on(async {
743    /// use gax::paginator::ItemPaginator;
744    ///
745    /// let builder = prepare_request_builder();
746    /// let mut items = builder.by_item();
747    /// while let Some(result) = items.next().await {
748    ///   let item = result?;
749    /// }
750    /// # gax::Result::<()>::Ok(()) });
751    ///
752    /// fn prepare_request_builder() -> ListLocations {
753    ///   # panic!();
754    ///   // ... details omitted ...
755    /// }
756    /// ```
757    #[derive(Clone, Debug)]
758    pub struct ListLocations(RequestBuilder<location::model::ListLocationsRequest>);
759
760    impl ListLocations {
761        pub(crate) fn new(
762            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
763        ) -> Self {
764            Self(RequestBuilder::new(stub))
765        }
766
767        /// Sets the full request, replacing any prior values.
768        pub fn with_request<V: Into<location::model::ListLocationsRequest>>(
769            mut self,
770            v: V,
771        ) -> Self {
772            self.0.request = v.into();
773            self
774        }
775
776        /// Sets all the options, replacing any prior values.
777        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
778            self.0.options = v.into();
779            self
780        }
781
782        /// Sends the request.
783        pub async fn send(self) -> Result<location::model::ListLocationsResponse> {
784            (*self.0.stub)
785                .list_locations(self.0.request, self.0.options)
786                .await
787                .map(gax::response::Response::into_body)
788        }
789
790        /// Streams each page in the collection.
791        pub fn by_page(
792            self,
793        ) -> impl gax::paginator::Paginator<location::model::ListLocationsResponse, gax::error::Error>
794        {
795            use std::clone::Clone;
796            let token = self.0.request.page_token.clone();
797            let execute = move |token: String| {
798                let mut builder = self.clone();
799                builder.0.request = builder.0.request.set_page_token(token);
800                builder.send()
801            };
802            gax::paginator::internal::new_paginator(token, execute)
803        }
804
805        /// Streams each item in the collection.
806        pub fn by_item(
807            self,
808        ) -> impl gax::paginator::ItemPaginator<location::model::ListLocationsResponse, gax::error::Error>
809        {
810            use gax::paginator::Paginator;
811            self.by_page().items()
812        }
813
814        /// Sets the value of [name][location::model::ListLocationsRequest::name].
815        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
816            self.0.request.name = v.into();
817            self
818        }
819
820        /// Sets the value of [filter][location::model::ListLocationsRequest::filter].
821        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
822            self.0.request.filter = v.into();
823            self
824        }
825
826        /// Sets the value of [page_size][location::model::ListLocationsRequest::page_size].
827        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
828            self.0.request.page_size = v.into();
829            self
830        }
831
832        /// Sets the value of [page_token][location::model::ListLocationsRequest::page_token].
833        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
834            self.0.request.page_token = v.into();
835            self
836        }
837    }
838
839    #[doc(hidden)]
840    impl gax::options::internal::RequestBuilder for ListLocations {
841        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
842            &mut self.0.options
843        }
844    }
845
846    /// The request builder for [Workflows::get_location][crate::client::Workflows::get_location] calls.
847    ///
848    /// # Example
849    /// ```no_run
850    /// # use google_cloud_workflows_v1::builder;
851    /// use builder::workflows::GetLocation;
852    /// # tokio_test::block_on(async {
853    ///
854    /// let builder = prepare_request_builder();
855    /// let response = builder.send().await?;
856    /// # gax::Result::<()>::Ok(()) });
857    ///
858    /// fn prepare_request_builder() -> GetLocation {
859    ///   # panic!();
860    ///   // ... details omitted ...
861    /// }
862    /// ```
863    #[derive(Clone, Debug)]
864    pub struct GetLocation(RequestBuilder<location::model::GetLocationRequest>);
865
866    impl GetLocation {
867        pub(crate) fn new(
868            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
869        ) -> Self {
870            Self(RequestBuilder::new(stub))
871        }
872
873        /// Sets the full request, replacing any prior values.
874        pub fn with_request<V: Into<location::model::GetLocationRequest>>(mut self, v: V) -> Self {
875            self.0.request = v.into();
876            self
877        }
878
879        /// Sets all the options, replacing any prior values.
880        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
881            self.0.options = v.into();
882            self
883        }
884
885        /// Sends the request.
886        pub async fn send(self) -> Result<location::model::Location> {
887            (*self.0.stub)
888                .get_location(self.0.request, self.0.options)
889                .await
890                .map(gax::response::Response::into_body)
891        }
892
893        /// Sets the value of [name][location::model::GetLocationRequest::name].
894        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
895            self.0.request.name = v.into();
896            self
897        }
898    }
899
900    #[doc(hidden)]
901    impl gax::options::internal::RequestBuilder for GetLocation {
902        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
903            &mut self.0.options
904        }
905    }
906
907    /// The request builder for [Workflows::list_operations][crate::client::Workflows::list_operations] calls.
908    ///
909    /// # Example
910    /// ```no_run
911    /// # use google_cloud_workflows_v1::builder;
912    /// use builder::workflows::ListOperations;
913    /// # tokio_test::block_on(async {
914    /// use gax::paginator::ItemPaginator;
915    ///
916    /// let builder = prepare_request_builder();
917    /// let mut items = builder.by_item();
918    /// while let Some(result) = items.next().await {
919    ///   let item = result?;
920    /// }
921    /// # gax::Result::<()>::Ok(()) });
922    ///
923    /// fn prepare_request_builder() -> ListOperations {
924    ///   # panic!();
925    ///   // ... details omitted ...
926    /// }
927    /// ```
928    #[derive(Clone, Debug)]
929    pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
930
931    impl ListOperations {
932        pub(crate) fn new(
933            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
934        ) -> Self {
935            Self(RequestBuilder::new(stub))
936        }
937
938        /// Sets the full request, replacing any prior values.
939        pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
940            mut self,
941            v: V,
942        ) -> Self {
943            self.0.request = v.into();
944            self
945        }
946
947        /// Sets all the options, replacing any prior values.
948        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
949            self.0.options = v.into();
950            self
951        }
952
953        /// Sends the request.
954        pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
955            (*self.0.stub)
956                .list_operations(self.0.request, self.0.options)
957                .await
958                .map(gax::response::Response::into_body)
959        }
960
961        /// Streams each page in the collection.
962        pub fn by_page(
963            self,
964        ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
965        {
966            use std::clone::Clone;
967            let token = self.0.request.page_token.clone();
968            let execute = move |token: String| {
969                let mut builder = self.clone();
970                builder.0.request = builder.0.request.set_page_token(token);
971                builder.send()
972            };
973            gax::paginator::internal::new_paginator(token, execute)
974        }
975
976        /// Streams each item in the collection.
977        pub fn by_item(
978            self,
979        ) -> impl gax::paginator::ItemPaginator<
980            longrunning::model::ListOperationsResponse,
981            gax::error::Error,
982        > {
983            use gax::paginator::Paginator;
984            self.by_page().items()
985        }
986
987        /// Sets the value of [name][longrunning::model::ListOperationsRequest::name].
988        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
989            self.0.request.name = v.into();
990            self
991        }
992
993        /// Sets the value of [filter][longrunning::model::ListOperationsRequest::filter].
994        pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
995            self.0.request.filter = v.into();
996            self
997        }
998
999        /// Sets the value of [page_size][longrunning::model::ListOperationsRequest::page_size].
1000        pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1001            self.0.request.page_size = v.into();
1002            self
1003        }
1004
1005        /// Sets the value of [page_token][longrunning::model::ListOperationsRequest::page_token].
1006        pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1007            self.0.request.page_token = v.into();
1008            self
1009        }
1010
1011        /// Sets the value of [return_partial_success][longrunning::model::ListOperationsRequest::return_partial_success].
1012        pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1013            self.0.request.return_partial_success = v.into();
1014            self
1015        }
1016    }
1017
1018    #[doc(hidden)]
1019    impl gax::options::internal::RequestBuilder for ListOperations {
1020        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1021            &mut self.0.options
1022        }
1023    }
1024
1025    /// The request builder for [Workflows::get_operation][crate::client::Workflows::get_operation] calls.
1026    ///
1027    /// # Example
1028    /// ```no_run
1029    /// # use google_cloud_workflows_v1::builder;
1030    /// use builder::workflows::GetOperation;
1031    /// # tokio_test::block_on(async {
1032    ///
1033    /// let builder = prepare_request_builder();
1034    /// let response = builder.send().await?;
1035    /// # gax::Result::<()>::Ok(()) });
1036    ///
1037    /// fn prepare_request_builder() -> GetOperation {
1038    ///   # panic!();
1039    ///   // ... details omitted ...
1040    /// }
1041    /// ```
1042    #[derive(Clone, Debug)]
1043    pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
1044
1045    impl GetOperation {
1046        pub(crate) fn new(
1047            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1048        ) -> Self {
1049            Self(RequestBuilder::new(stub))
1050        }
1051
1052        /// Sets the full request, replacing any prior values.
1053        pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
1054            mut self,
1055            v: V,
1056        ) -> Self {
1057            self.0.request = v.into();
1058            self
1059        }
1060
1061        /// Sets all the options, replacing any prior values.
1062        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1063            self.0.options = v.into();
1064            self
1065        }
1066
1067        /// Sends the request.
1068        pub async fn send(self) -> Result<longrunning::model::Operation> {
1069            (*self.0.stub)
1070                .get_operation(self.0.request, self.0.options)
1071                .await
1072                .map(gax::response::Response::into_body)
1073        }
1074
1075        /// Sets the value of [name][longrunning::model::GetOperationRequest::name].
1076        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1077            self.0.request.name = v.into();
1078            self
1079        }
1080    }
1081
1082    #[doc(hidden)]
1083    impl gax::options::internal::RequestBuilder for GetOperation {
1084        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1085            &mut self.0.options
1086        }
1087    }
1088
1089    /// The request builder for [Workflows::delete_operation][crate::client::Workflows::delete_operation] calls.
1090    ///
1091    /// # Example
1092    /// ```no_run
1093    /// # use google_cloud_workflows_v1::builder;
1094    /// use builder::workflows::DeleteOperation;
1095    /// # tokio_test::block_on(async {
1096    ///
1097    /// let builder = prepare_request_builder();
1098    /// let response = builder.send().await?;
1099    /// # gax::Result::<()>::Ok(()) });
1100    ///
1101    /// fn prepare_request_builder() -> DeleteOperation {
1102    ///   # panic!();
1103    ///   // ... details omitted ...
1104    /// }
1105    /// ```
1106    #[derive(Clone, Debug)]
1107    pub struct DeleteOperation(RequestBuilder<longrunning::model::DeleteOperationRequest>);
1108
1109    impl DeleteOperation {
1110        pub(crate) fn new(
1111            stub: std::sync::Arc<dyn super::super::stub::dynamic::Workflows>,
1112        ) -> Self {
1113            Self(RequestBuilder::new(stub))
1114        }
1115
1116        /// Sets the full request, replacing any prior values.
1117        pub fn with_request<V: Into<longrunning::model::DeleteOperationRequest>>(
1118            mut self,
1119            v: V,
1120        ) -> Self {
1121            self.0.request = v.into();
1122            self
1123        }
1124
1125        /// Sets all the options, replacing any prior values.
1126        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1127            self.0.options = v.into();
1128            self
1129        }
1130
1131        /// Sends the request.
1132        pub async fn send(self) -> Result<()> {
1133            (*self.0.stub)
1134                .delete_operation(self.0.request, self.0.options)
1135                .await
1136                .map(gax::response::Response::into_body)
1137        }
1138
1139        /// Sets the value of [name][longrunning::model::DeleteOperationRequest::name].
1140        pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1141            self.0.request.name = v.into();
1142            self
1143        }
1144    }
1145
1146    #[doc(hidden)]
1147    impl gax::options::internal::RequestBuilder for DeleteOperation {
1148        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1149            &mut self.0.options
1150        }
1151    }
1152}