Skip to main content

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