google_cloud_dataform_v1/builder.rs
1// Copyright 2025 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// https://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14//
15// Code generated by sidekick. DO NOT EDIT.
16
17/// Request and client builders for [Dataform][crate::client::Dataform].
18pub mod dataform {
19 use crate::Result;
20
21 /// A builder for [Dataform][crate::client::Dataform].
22 ///
23 /// ```
24 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
25 /// # use google_cloud_dataform_v1::*;
26 /// # use builder::dataform::ClientBuilder;
27 /// # use client::Dataform;
28 /// let builder : ClientBuilder = Dataform::builder();
29 /// let client = builder
30 /// .with_endpoint("https://dataform.googleapis.com")
31 /// .build().await?;
32 /// # Ok(()) }
33 /// ```
34 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Dataform;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Dataform;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 /// Common implementation for [crate::client::Dataform] 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::Dataform>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 /// The request builder for [Dataform::get_team_folder][crate::client::Dataform::get_team_folder] calls.
73 ///
74 /// # Example
75 /// ```
76 /// # use google_cloud_dataform_v1::builder::dataform::GetTeamFolder;
77 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
78 ///
79 /// let builder = prepare_request_builder();
80 /// let response = builder.send().await?;
81 /// # Ok(()) }
82 ///
83 /// fn prepare_request_builder() -> GetTeamFolder {
84 /// # panic!();
85 /// // ... details omitted ...
86 /// }
87 /// ```
88 #[derive(Clone, Debug)]
89 pub struct GetTeamFolder(RequestBuilder<crate::model::GetTeamFolderRequest>);
90
91 impl GetTeamFolder {
92 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
93 Self(RequestBuilder::new(stub))
94 }
95
96 /// Sets the full request, replacing any prior values.
97 pub fn with_request<V: Into<crate::model::GetTeamFolderRequest>>(mut self, v: V) -> Self {
98 self.0.request = v.into();
99 self
100 }
101
102 /// Sets all the options, replacing any prior values.
103 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
104 self.0.options = v.into();
105 self
106 }
107
108 /// Sends the request.
109 pub async fn send(self) -> Result<crate::model::TeamFolder> {
110 (*self.0.stub)
111 .get_team_folder(self.0.request, self.0.options)
112 .await
113 .map(crate::Response::into_body)
114 }
115
116 /// Sets the value of [name][crate::model::GetTeamFolderRequest::name].
117 ///
118 /// This is a **required** field for requests.
119 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
120 self.0.request.name = v.into();
121 self
122 }
123 }
124
125 #[doc(hidden)]
126 impl crate::RequestBuilder for GetTeamFolder {
127 fn request_options(&mut self) -> &mut crate::RequestOptions {
128 &mut self.0.options
129 }
130 }
131
132 /// The request builder for [Dataform::create_team_folder][crate::client::Dataform::create_team_folder] calls.
133 ///
134 /// # Example
135 /// ```
136 /// # use google_cloud_dataform_v1::builder::dataform::CreateTeamFolder;
137 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
138 ///
139 /// let builder = prepare_request_builder();
140 /// let response = builder.send().await?;
141 /// # Ok(()) }
142 ///
143 /// fn prepare_request_builder() -> CreateTeamFolder {
144 /// # panic!();
145 /// // ... details omitted ...
146 /// }
147 /// ```
148 #[derive(Clone, Debug)]
149 pub struct CreateTeamFolder(RequestBuilder<crate::model::CreateTeamFolderRequest>);
150
151 impl CreateTeamFolder {
152 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
153 Self(RequestBuilder::new(stub))
154 }
155
156 /// Sets the full request, replacing any prior values.
157 pub fn with_request<V: Into<crate::model::CreateTeamFolderRequest>>(
158 mut self,
159 v: V,
160 ) -> Self {
161 self.0.request = v.into();
162 self
163 }
164
165 /// Sets all the options, replacing any prior values.
166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
167 self.0.options = v.into();
168 self
169 }
170
171 /// Sends the request.
172 pub async fn send(self) -> Result<crate::model::TeamFolder> {
173 (*self.0.stub)
174 .create_team_folder(self.0.request, self.0.options)
175 .await
176 .map(crate::Response::into_body)
177 }
178
179 /// Sets the value of [parent][crate::model::CreateTeamFolderRequest::parent].
180 ///
181 /// This is a **required** field for requests.
182 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
183 self.0.request.parent = v.into();
184 self
185 }
186
187 /// Sets the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
188 ///
189 /// This is a **required** field for requests.
190 pub fn set_team_folder<T>(mut self, v: T) -> Self
191 where
192 T: std::convert::Into<crate::model::TeamFolder>,
193 {
194 self.0.request.team_folder = std::option::Option::Some(v.into());
195 self
196 }
197
198 /// Sets or clears the value of [team_folder][crate::model::CreateTeamFolderRequest::team_folder].
199 ///
200 /// This is a **required** field for requests.
201 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
202 where
203 T: std::convert::Into<crate::model::TeamFolder>,
204 {
205 self.0.request.team_folder = v.map(|x| x.into());
206 self
207 }
208 }
209
210 #[doc(hidden)]
211 impl crate::RequestBuilder for CreateTeamFolder {
212 fn request_options(&mut self) -> &mut crate::RequestOptions {
213 &mut self.0.options
214 }
215 }
216
217 /// The request builder for [Dataform::update_team_folder][crate::client::Dataform::update_team_folder] calls.
218 ///
219 /// # Example
220 /// ```
221 /// # use google_cloud_dataform_v1::builder::dataform::UpdateTeamFolder;
222 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
223 ///
224 /// let builder = prepare_request_builder();
225 /// let response = builder.send().await?;
226 /// # Ok(()) }
227 ///
228 /// fn prepare_request_builder() -> UpdateTeamFolder {
229 /// # panic!();
230 /// // ... details omitted ...
231 /// }
232 /// ```
233 #[derive(Clone, Debug)]
234 pub struct UpdateTeamFolder(RequestBuilder<crate::model::UpdateTeamFolderRequest>);
235
236 impl UpdateTeamFolder {
237 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
238 Self(RequestBuilder::new(stub))
239 }
240
241 /// Sets the full request, replacing any prior values.
242 pub fn with_request<V: Into<crate::model::UpdateTeamFolderRequest>>(
243 mut self,
244 v: V,
245 ) -> Self {
246 self.0.request = v.into();
247 self
248 }
249
250 /// Sets all the options, replacing any prior values.
251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
252 self.0.options = v.into();
253 self
254 }
255
256 /// Sends the request.
257 pub async fn send(self) -> Result<crate::model::TeamFolder> {
258 (*self.0.stub)
259 .update_team_folder(self.0.request, self.0.options)
260 .await
261 .map(crate::Response::into_body)
262 }
263
264 /// Sets the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
265 pub fn set_update_mask<T>(mut self, v: T) -> Self
266 where
267 T: std::convert::Into<wkt::FieldMask>,
268 {
269 self.0.request.update_mask = std::option::Option::Some(v.into());
270 self
271 }
272
273 /// Sets or clears the value of [update_mask][crate::model::UpdateTeamFolderRequest::update_mask].
274 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
275 where
276 T: std::convert::Into<wkt::FieldMask>,
277 {
278 self.0.request.update_mask = v.map(|x| x.into());
279 self
280 }
281
282 /// Sets the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
283 ///
284 /// This is a **required** field for requests.
285 pub fn set_team_folder<T>(mut self, v: T) -> Self
286 where
287 T: std::convert::Into<crate::model::TeamFolder>,
288 {
289 self.0.request.team_folder = std::option::Option::Some(v.into());
290 self
291 }
292
293 /// Sets or clears the value of [team_folder][crate::model::UpdateTeamFolderRequest::team_folder].
294 ///
295 /// This is a **required** field for requests.
296 pub fn set_or_clear_team_folder<T>(mut self, v: std::option::Option<T>) -> Self
297 where
298 T: std::convert::Into<crate::model::TeamFolder>,
299 {
300 self.0.request.team_folder = v.map(|x| x.into());
301 self
302 }
303 }
304
305 #[doc(hidden)]
306 impl crate::RequestBuilder for UpdateTeamFolder {
307 fn request_options(&mut self) -> &mut crate::RequestOptions {
308 &mut self.0.options
309 }
310 }
311
312 /// The request builder for [Dataform::delete_team_folder][crate::client::Dataform::delete_team_folder] calls.
313 ///
314 /// # Example
315 /// ```
316 /// # use google_cloud_dataform_v1::builder::dataform::DeleteTeamFolder;
317 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
318 ///
319 /// let builder = prepare_request_builder();
320 /// let response = builder.send().await?;
321 /// # Ok(()) }
322 ///
323 /// fn prepare_request_builder() -> DeleteTeamFolder {
324 /// # panic!();
325 /// // ... details omitted ...
326 /// }
327 /// ```
328 #[derive(Clone, Debug)]
329 pub struct DeleteTeamFolder(RequestBuilder<crate::model::DeleteTeamFolderRequest>);
330
331 impl DeleteTeamFolder {
332 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
333 Self(RequestBuilder::new(stub))
334 }
335
336 /// Sets the full request, replacing any prior values.
337 pub fn with_request<V: Into<crate::model::DeleteTeamFolderRequest>>(
338 mut self,
339 v: V,
340 ) -> Self {
341 self.0.request = v.into();
342 self
343 }
344
345 /// Sets all the options, replacing any prior values.
346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
347 self.0.options = v.into();
348 self
349 }
350
351 /// Sends the request.
352 pub async fn send(self) -> Result<()> {
353 (*self.0.stub)
354 .delete_team_folder(self.0.request, self.0.options)
355 .await
356 .map(crate::Response::into_body)
357 }
358
359 /// Sets the value of [name][crate::model::DeleteTeamFolderRequest::name].
360 ///
361 /// This is a **required** field for requests.
362 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
363 self.0.request.name = v.into();
364 self
365 }
366 }
367
368 #[doc(hidden)]
369 impl crate::RequestBuilder for DeleteTeamFolder {
370 fn request_options(&mut self) -> &mut crate::RequestOptions {
371 &mut self.0.options
372 }
373 }
374
375 /// The request builder for [Dataform::delete_team_folder_tree][crate::client::Dataform::delete_team_folder_tree] calls.
376 ///
377 /// # Example
378 /// ```
379 /// # use google_cloud_dataform_v1::builder::dataform::DeleteTeamFolderTree;
380 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
381 /// use google_cloud_lro::Poller;
382 ///
383 /// let builder = prepare_request_builder();
384 /// let response = builder.poller().until_done().await?;
385 /// # Ok(()) }
386 ///
387 /// fn prepare_request_builder() -> DeleteTeamFolderTree {
388 /// # panic!();
389 /// // ... details omitted ...
390 /// }
391 /// ```
392 #[derive(Clone, Debug)]
393 pub struct DeleteTeamFolderTree(RequestBuilder<crate::model::DeleteTeamFolderTreeRequest>);
394
395 impl DeleteTeamFolderTree {
396 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
397 Self(RequestBuilder::new(stub))
398 }
399
400 /// Sets the full request, replacing any prior values.
401 pub fn with_request<V: Into<crate::model::DeleteTeamFolderTreeRequest>>(
402 mut self,
403 v: V,
404 ) -> Self {
405 self.0.request = v.into();
406 self
407 }
408
409 /// Sets all the options, replacing any prior values.
410 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
411 self.0.options = v.into();
412 self
413 }
414
415 /// Sends the request.
416 ///
417 /// # Long running operations
418 ///
419 /// This starts, but does not poll, a longrunning operation. More information
420 /// on [delete_team_folder_tree][crate::client::Dataform::delete_team_folder_tree].
421 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
422 (*self.0.stub)
423 .delete_team_folder_tree(self.0.request, self.0.options)
424 .await
425 .map(crate::Response::into_body)
426 }
427
428 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_team_folder_tree`.
429 pub fn poller(
430 self,
431 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteFolderTreeMetadata> {
432 type Operation = google_cloud_lro::internal::Operation<
433 wkt::Empty,
434 crate::model::DeleteFolderTreeMetadata,
435 >;
436 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
437 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
438 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
439 if let Some(ref mut details) = poller_options.tracing {
440 details.method_name = "google_cloud_dataform_v1::client::Dataform::delete_team_folder_tree::until_done";
441 }
442
443 let stub = self.0.stub.clone();
444 let mut options = self.0.options.clone();
445 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
446 let query = move |name| {
447 let stub = stub.clone();
448 let options = options.clone();
449 async {
450 let op = GetOperation::new(stub)
451 .set_name(name)
452 .with_options(options)
453 .send()
454 .await?;
455 Ok(Operation::new(op))
456 }
457 };
458
459 let start = move || async {
460 let op = self.send().await?;
461 Ok(Operation::new(op))
462 };
463
464 use google_cloud_lro::internal::PollerExt;
465 {
466 google_cloud_lro::internal::new_unit_response_poller(
467 polling_error_policy,
468 polling_backoff_policy,
469 start,
470 query,
471 )
472 }
473 .with_options(poller_options)
474 }
475
476 /// Sets the value of [name][crate::model::DeleteTeamFolderTreeRequest::name].
477 ///
478 /// This is a **required** field for requests.
479 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
480 self.0.request.name = v.into();
481 self
482 }
483
484 /// Sets the value of [force][crate::model::DeleteTeamFolderTreeRequest::force].
485 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
486 self.0.request.force = v.into();
487 self
488 }
489 }
490
491 #[doc(hidden)]
492 impl crate::RequestBuilder for DeleteTeamFolderTree {
493 fn request_options(&mut self) -> &mut crate::RequestOptions {
494 &mut self.0.options
495 }
496 }
497
498 /// The request builder for [Dataform::query_team_folder_contents][crate::client::Dataform::query_team_folder_contents] calls.
499 ///
500 /// # Example
501 /// ```
502 /// # use google_cloud_dataform_v1::builder::dataform::QueryTeamFolderContents;
503 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
504 /// use google_cloud_gax::paginator::ItemPaginator;
505 ///
506 /// let builder = prepare_request_builder();
507 /// let mut items = builder.by_item();
508 /// while let Some(result) = items.next().await {
509 /// let item = result?;
510 /// }
511 /// # Ok(()) }
512 ///
513 /// fn prepare_request_builder() -> QueryTeamFolderContents {
514 /// # panic!();
515 /// // ... details omitted ...
516 /// }
517 /// ```
518 #[derive(Clone, Debug)]
519 pub struct QueryTeamFolderContents(
520 RequestBuilder<crate::model::QueryTeamFolderContentsRequest>,
521 );
522
523 impl QueryTeamFolderContents {
524 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
525 Self(RequestBuilder::new(stub))
526 }
527
528 /// Sets the full request, replacing any prior values.
529 pub fn with_request<V: Into<crate::model::QueryTeamFolderContentsRequest>>(
530 mut self,
531 v: V,
532 ) -> Self {
533 self.0.request = v.into();
534 self
535 }
536
537 /// Sets all the options, replacing any prior values.
538 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
539 self.0.options = v.into();
540 self
541 }
542
543 /// Sends the request.
544 pub async fn send(self) -> Result<crate::model::QueryTeamFolderContentsResponse> {
545 (*self.0.stub)
546 .query_team_folder_contents(self.0.request, self.0.options)
547 .await
548 .map(crate::Response::into_body)
549 }
550
551 /// Streams each page in the collection.
552 pub fn by_page(
553 self,
554 ) -> impl google_cloud_gax::paginator::Paginator<
555 crate::model::QueryTeamFolderContentsResponse,
556 crate::Error,
557 > {
558 use std::clone::Clone;
559 let token = self.0.request.page_token.clone();
560 let execute = move |token: String| {
561 let mut builder = self.clone();
562 builder.0.request = builder.0.request.set_page_token(token);
563 builder.send()
564 };
565 google_cloud_gax::paginator::internal::new_paginator(token, execute)
566 }
567
568 /// Streams each item in the collection.
569 pub fn by_item(
570 self,
571 ) -> impl google_cloud_gax::paginator::ItemPaginator<
572 crate::model::QueryTeamFolderContentsResponse,
573 crate::Error,
574 > {
575 use google_cloud_gax::paginator::Paginator;
576 self.by_page().items()
577 }
578
579 /// Sets the value of [team_folder][crate::model::QueryTeamFolderContentsRequest::team_folder].
580 ///
581 /// This is a **required** field for requests.
582 pub fn set_team_folder<T: Into<std::string::String>>(mut self, v: T) -> Self {
583 self.0.request.team_folder = v.into();
584 self
585 }
586
587 /// Sets the value of [page_size][crate::model::QueryTeamFolderContentsRequest::page_size].
588 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
589 self.0.request.page_size = v.into();
590 self
591 }
592
593 /// Sets the value of [page_token][crate::model::QueryTeamFolderContentsRequest::page_token].
594 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
595 self.0.request.page_token = v.into();
596 self
597 }
598
599 /// Sets the value of [order_by][crate::model::QueryTeamFolderContentsRequest::order_by].
600 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
601 self.0.request.order_by = v.into();
602 self
603 }
604
605 /// Sets the value of [filter][crate::model::QueryTeamFolderContentsRequest::filter].
606 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
607 self.0.request.filter = v.into();
608 self
609 }
610 }
611
612 #[doc(hidden)]
613 impl crate::RequestBuilder for QueryTeamFolderContents {
614 fn request_options(&mut self) -> &mut crate::RequestOptions {
615 &mut self.0.options
616 }
617 }
618
619 /// The request builder for [Dataform::search_team_folders][crate::client::Dataform::search_team_folders] calls.
620 ///
621 /// # Example
622 /// ```
623 /// # use google_cloud_dataform_v1::builder::dataform::SearchTeamFolders;
624 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
625 /// use google_cloud_gax::paginator::ItemPaginator;
626 ///
627 /// let builder = prepare_request_builder();
628 /// let mut items = builder.by_item();
629 /// while let Some(result) = items.next().await {
630 /// let item = result?;
631 /// }
632 /// # Ok(()) }
633 ///
634 /// fn prepare_request_builder() -> SearchTeamFolders {
635 /// # panic!();
636 /// // ... details omitted ...
637 /// }
638 /// ```
639 #[derive(Clone, Debug)]
640 pub struct SearchTeamFolders(RequestBuilder<crate::model::SearchTeamFoldersRequest>);
641
642 impl SearchTeamFolders {
643 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
644 Self(RequestBuilder::new(stub))
645 }
646
647 /// Sets the full request, replacing any prior values.
648 pub fn with_request<V: Into<crate::model::SearchTeamFoldersRequest>>(
649 mut self,
650 v: V,
651 ) -> Self {
652 self.0.request = v.into();
653 self
654 }
655
656 /// Sets all the options, replacing any prior values.
657 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
658 self.0.options = v.into();
659 self
660 }
661
662 /// Sends the request.
663 pub async fn send(self) -> Result<crate::model::SearchTeamFoldersResponse> {
664 (*self.0.stub)
665 .search_team_folders(self.0.request, self.0.options)
666 .await
667 .map(crate::Response::into_body)
668 }
669
670 /// Streams each page in the collection.
671 pub fn by_page(
672 self,
673 ) -> impl google_cloud_gax::paginator::Paginator<
674 crate::model::SearchTeamFoldersResponse,
675 crate::Error,
676 > {
677 use std::clone::Clone;
678 let token = self.0.request.page_token.clone();
679 let execute = move |token: String| {
680 let mut builder = self.clone();
681 builder.0.request = builder.0.request.set_page_token(token);
682 builder.send()
683 };
684 google_cloud_gax::paginator::internal::new_paginator(token, execute)
685 }
686
687 /// Streams each item in the collection.
688 pub fn by_item(
689 self,
690 ) -> impl google_cloud_gax::paginator::ItemPaginator<
691 crate::model::SearchTeamFoldersResponse,
692 crate::Error,
693 > {
694 use google_cloud_gax::paginator::Paginator;
695 self.by_page().items()
696 }
697
698 /// Sets the value of [location][crate::model::SearchTeamFoldersRequest::location].
699 ///
700 /// This is a **required** field for requests.
701 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
702 self.0.request.location = v.into();
703 self
704 }
705
706 /// Sets the value of [page_size][crate::model::SearchTeamFoldersRequest::page_size].
707 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
708 self.0.request.page_size = v.into();
709 self
710 }
711
712 /// Sets the value of [page_token][crate::model::SearchTeamFoldersRequest::page_token].
713 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
714 self.0.request.page_token = v.into();
715 self
716 }
717
718 /// Sets the value of [order_by][crate::model::SearchTeamFoldersRequest::order_by].
719 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
720 self.0.request.order_by = v.into();
721 self
722 }
723
724 /// Sets the value of [filter][crate::model::SearchTeamFoldersRequest::filter].
725 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
726 self.0.request.filter = v.into();
727 self
728 }
729 }
730
731 #[doc(hidden)]
732 impl crate::RequestBuilder for SearchTeamFolders {
733 fn request_options(&mut self) -> &mut crate::RequestOptions {
734 &mut self.0.options
735 }
736 }
737
738 /// The request builder for [Dataform::get_folder][crate::client::Dataform::get_folder] calls.
739 ///
740 /// # Example
741 /// ```
742 /// # use google_cloud_dataform_v1::builder::dataform::GetFolder;
743 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
744 ///
745 /// let builder = prepare_request_builder();
746 /// let response = builder.send().await?;
747 /// # Ok(()) }
748 ///
749 /// fn prepare_request_builder() -> GetFolder {
750 /// # panic!();
751 /// // ... details omitted ...
752 /// }
753 /// ```
754 #[derive(Clone, Debug)]
755 pub struct GetFolder(RequestBuilder<crate::model::GetFolderRequest>);
756
757 impl GetFolder {
758 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
759 Self(RequestBuilder::new(stub))
760 }
761
762 /// Sets the full request, replacing any prior values.
763 pub fn with_request<V: Into<crate::model::GetFolderRequest>>(mut self, v: V) -> Self {
764 self.0.request = v.into();
765 self
766 }
767
768 /// Sets all the options, replacing any prior values.
769 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
770 self.0.options = v.into();
771 self
772 }
773
774 /// Sends the request.
775 pub async fn send(self) -> Result<crate::model::Folder> {
776 (*self.0.stub)
777 .get_folder(self.0.request, self.0.options)
778 .await
779 .map(crate::Response::into_body)
780 }
781
782 /// Sets the value of [name][crate::model::GetFolderRequest::name].
783 ///
784 /// This is a **required** field for requests.
785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
786 self.0.request.name = v.into();
787 self
788 }
789 }
790
791 #[doc(hidden)]
792 impl crate::RequestBuilder for GetFolder {
793 fn request_options(&mut self) -> &mut crate::RequestOptions {
794 &mut self.0.options
795 }
796 }
797
798 /// The request builder for [Dataform::create_folder][crate::client::Dataform::create_folder] calls.
799 ///
800 /// # Example
801 /// ```
802 /// # use google_cloud_dataform_v1::builder::dataform::CreateFolder;
803 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
804 ///
805 /// let builder = prepare_request_builder();
806 /// let response = builder.send().await?;
807 /// # Ok(()) }
808 ///
809 /// fn prepare_request_builder() -> CreateFolder {
810 /// # panic!();
811 /// // ... details omitted ...
812 /// }
813 /// ```
814 #[derive(Clone, Debug)]
815 pub struct CreateFolder(RequestBuilder<crate::model::CreateFolderRequest>);
816
817 impl CreateFolder {
818 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
819 Self(RequestBuilder::new(stub))
820 }
821
822 /// Sets the full request, replacing any prior values.
823 pub fn with_request<V: Into<crate::model::CreateFolderRequest>>(mut self, v: V) -> Self {
824 self.0.request = v.into();
825 self
826 }
827
828 /// Sets all the options, replacing any prior values.
829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
830 self.0.options = v.into();
831 self
832 }
833
834 /// Sends the request.
835 pub async fn send(self) -> Result<crate::model::Folder> {
836 (*self.0.stub)
837 .create_folder(self.0.request, self.0.options)
838 .await
839 .map(crate::Response::into_body)
840 }
841
842 /// Sets the value of [parent][crate::model::CreateFolderRequest::parent].
843 ///
844 /// This is a **required** field for requests.
845 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
846 self.0.request.parent = v.into();
847 self
848 }
849
850 /// Sets the value of [folder][crate::model::CreateFolderRequest::folder].
851 ///
852 /// This is a **required** field for requests.
853 pub fn set_folder<T>(mut self, v: T) -> Self
854 where
855 T: std::convert::Into<crate::model::Folder>,
856 {
857 self.0.request.folder = std::option::Option::Some(v.into());
858 self
859 }
860
861 /// Sets or clears the value of [folder][crate::model::CreateFolderRequest::folder].
862 ///
863 /// This is a **required** field for requests.
864 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
865 where
866 T: std::convert::Into<crate::model::Folder>,
867 {
868 self.0.request.folder = v.map(|x| x.into());
869 self
870 }
871 }
872
873 #[doc(hidden)]
874 impl crate::RequestBuilder for CreateFolder {
875 fn request_options(&mut self) -> &mut crate::RequestOptions {
876 &mut self.0.options
877 }
878 }
879
880 /// The request builder for [Dataform::update_folder][crate::client::Dataform::update_folder] calls.
881 ///
882 /// # Example
883 /// ```
884 /// # use google_cloud_dataform_v1::builder::dataform::UpdateFolder;
885 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
886 ///
887 /// let builder = prepare_request_builder();
888 /// let response = builder.send().await?;
889 /// # Ok(()) }
890 ///
891 /// fn prepare_request_builder() -> UpdateFolder {
892 /// # panic!();
893 /// // ... details omitted ...
894 /// }
895 /// ```
896 #[derive(Clone, Debug)]
897 pub struct UpdateFolder(RequestBuilder<crate::model::UpdateFolderRequest>);
898
899 impl UpdateFolder {
900 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
901 Self(RequestBuilder::new(stub))
902 }
903
904 /// Sets the full request, replacing any prior values.
905 pub fn with_request<V: Into<crate::model::UpdateFolderRequest>>(mut self, v: V) -> Self {
906 self.0.request = v.into();
907 self
908 }
909
910 /// Sets all the options, replacing any prior values.
911 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
912 self.0.options = v.into();
913 self
914 }
915
916 /// Sends the request.
917 pub async fn send(self) -> Result<crate::model::Folder> {
918 (*self.0.stub)
919 .update_folder(self.0.request, self.0.options)
920 .await
921 .map(crate::Response::into_body)
922 }
923
924 /// Sets the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
925 pub fn set_update_mask<T>(mut self, v: T) -> Self
926 where
927 T: std::convert::Into<wkt::FieldMask>,
928 {
929 self.0.request.update_mask = std::option::Option::Some(v.into());
930 self
931 }
932
933 /// Sets or clears the value of [update_mask][crate::model::UpdateFolderRequest::update_mask].
934 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
935 where
936 T: std::convert::Into<wkt::FieldMask>,
937 {
938 self.0.request.update_mask = v.map(|x| x.into());
939 self
940 }
941
942 /// Sets the value of [folder][crate::model::UpdateFolderRequest::folder].
943 ///
944 /// This is a **required** field for requests.
945 pub fn set_folder<T>(mut self, v: T) -> Self
946 where
947 T: std::convert::Into<crate::model::Folder>,
948 {
949 self.0.request.folder = std::option::Option::Some(v.into());
950 self
951 }
952
953 /// Sets or clears the value of [folder][crate::model::UpdateFolderRequest::folder].
954 ///
955 /// This is a **required** field for requests.
956 pub fn set_or_clear_folder<T>(mut self, v: std::option::Option<T>) -> Self
957 where
958 T: std::convert::Into<crate::model::Folder>,
959 {
960 self.0.request.folder = v.map(|x| x.into());
961 self
962 }
963 }
964
965 #[doc(hidden)]
966 impl crate::RequestBuilder for UpdateFolder {
967 fn request_options(&mut self) -> &mut crate::RequestOptions {
968 &mut self.0.options
969 }
970 }
971
972 /// The request builder for [Dataform::delete_folder][crate::client::Dataform::delete_folder] calls.
973 ///
974 /// # Example
975 /// ```
976 /// # use google_cloud_dataform_v1::builder::dataform::DeleteFolder;
977 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
978 ///
979 /// let builder = prepare_request_builder();
980 /// let response = builder.send().await?;
981 /// # Ok(()) }
982 ///
983 /// fn prepare_request_builder() -> DeleteFolder {
984 /// # panic!();
985 /// // ... details omitted ...
986 /// }
987 /// ```
988 #[derive(Clone, Debug)]
989 pub struct DeleteFolder(RequestBuilder<crate::model::DeleteFolderRequest>);
990
991 impl DeleteFolder {
992 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
993 Self(RequestBuilder::new(stub))
994 }
995
996 /// Sets the full request, replacing any prior values.
997 pub fn with_request<V: Into<crate::model::DeleteFolderRequest>>(mut self, v: V) -> Self {
998 self.0.request = v.into();
999 self
1000 }
1001
1002 /// Sets all the options, replacing any prior values.
1003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1004 self.0.options = v.into();
1005 self
1006 }
1007
1008 /// Sends the request.
1009 pub async fn send(self) -> Result<()> {
1010 (*self.0.stub)
1011 .delete_folder(self.0.request, self.0.options)
1012 .await
1013 .map(crate::Response::into_body)
1014 }
1015
1016 /// Sets the value of [name][crate::model::DeleteFolderRequest::name].
1017 ///
1018 /// This is a **required** field for requests.
1019 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1020 self.0.request.name = v.into();
1021 self
1022 }
1023 }
1024
1025 #[doc(hidden)]
1026 impl crate::RequestBuilder for DeleteFolder {
1027 fn request_options(&mut self) -> &mut crate::RequestOptions {
1028 &mut self.0.options
1029 }
1030 }
1031
1032 /// The request builder for [Dataform::delete_folder_tree][crate::client::Dataform::delete_folder_tree] calls.
1033 ///
1034 /// # Example
1035 /// ```
1036 /// # use google_cloud_dataform_v1::builder::dataform::DeleteFolderTree;
1037 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1038 /// use google_cloud_lro::Poller;
1039 ///
1040 /// let builder = prepare_request_builder();
1041 /// let response = builder.poller().until_done().await?;
1042 /// # Ok(()) }
1043 ///
1044 /// fn prepare_request_builder() -> DeleteFolderTree {
1045 /// # panic!();
1046 /// // ... details omitted ...
1047 /// }
1048 /// ```
1049 #[derive(Clone, Debug)]
1050 pub struct DeleteFolderTree(RequestBuilder<crate::model::DeleteFolderTreeRequest>);
1051
1052 impl DeleteFolderTree {
1053 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1054 Self(RequestBuilder::new(stub))
1055 }
1056
1057 /// Sets the full request, replacing any prior values.
1058 pub fn with_request<V: Into<crate::model::DeleteFolderTreeRequest>>(
1059 mut self,
1060 v: V,
1061 ) -> Self {
1062 self.0.request = v.into();
1063 self
1064 }
1065
1066 /// Sets all the options, replacing any prior values.
1067 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1068 self.0.options = v.into();
1069 self
1070 }
1071
1072 /// Sends the request.
1073 ///
1074 /// # Long running operations
1075 ///
1076 /// This starts, but does not poll, a longrunning operation. More information
1077 /// on [delete_folder_tree][crate::client::Dataform::delete_folder_tree].
1078 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1079 (*self.0.stub)
1080 .delete_folder_tree(self.0.request, self.0.options)
1081 .await
1082 .map(crate::Response::into_body)
1083 }
1084
1085 /// Creates a [Poller][google_cloud_lro::Poller] to work with `delete_folder_tree`.
1086 pub fn poller(
1087 self,
1088 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteFolderTreeMetadata> {
1089 type Operation = google_cloud_lro::internal::Operation<
1090 wkt::Empty,
1091 crate::model::DeleteFolderTreeMetadata,
1092 >;
1093 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1094 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1095 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1096 if let Some(ref mut details) = poller_options.tracing {
1097 details.method_name =
1098 "google_cloud_dataform_v1::client::Dataform::delete_folder_tree::until_done";
1099 }
1100
1101 let stub = self.0.stub.clone();
1102 let mut options = self.0.options.clone();
1103 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1104 let query = move |name| {
1105 let stub = stub.clone();
1106 let options = options.clone();
1107 async {
1108 let op = GetOperation::new(stub)
1109 .set_name(name)
1110 .with_options(options)
1111 .send()
1112 .await?;
1113 Ok(Operation::new(op))
1114 }
1115 };
1116
1117 let start = move || async {
1118 let op = self.send().await?;
1119 Ok(Operation::new(op))
1120 };
1121
1122 use google_cloud_lro::internal::PollerExt;
1123 {
1124 google_cloud_lro::internal::new_unit_response_poller(
1125 polling_error_policy,
1126 polling_backoff_policy,
1127 start,
1128 query,
1129 )
1130 }
1131 .with_options(poller_options)
1132 }
1133
1134 /// Sets the value of [name][crate::model::DeleteFolderTreeRequest::name].
1135 ///
1136 /// This is a **required** field for requests.
1137 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1138 self.0.request.name = v.into();
1139 self
1140 }
1141
1142 /// Sets the value of [force][crate::model::DeleteFolderTreeRequest::force].
1143 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1144 self.0.request.force = v.into();
1145 self
1146 }
1147 }
1148
1149 #[doc(hidden)]
1150 impl crate::RequestBuilder for DeleteFolderTree {
1151 fn request_options(&mut self) -> &mut crate::RequestOptions {
1152 &mut self.0.options
1153 }
1154 }
1155
1156 /// The request builder for [Dataform::query_folder_contents][crate::client::Dataform::query_folder_contents] calls.
1157 ///
1158 /// # Example
1159 /// ```
1160 /// # use google_cloud_dataform_v1::builder::dataform::QueryFolderContents;
1161 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1162 /// use google_cloud_gax::paginator::ItemPaginator;
1163 ///
1164 /// let builder = prepare_request_builder();
1165 /// let mut items = builder.by_item();
1166 /// while let Some(result) = items.next().await {
1167 /// let item = result?;
1168 /// }
1169 /// # Ok(()) }
1170 ///
1171 /// fn prepare_request_builder() -> QueryFolderContents {
1172 /// # panic!();
1173 /// // ... details omitted ...
1174 /// }
1175 /// ```
1176 #[derive(Clone, Debug)]
1177 pub struct QueryFolderContents(RequestBuilder<crate::model::QueryFolderContentsRequest>);
1178
1179 impl QueryFolderContents {
1180 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1181 Self(RequestBuilder::new(stub))
1182 }
1183
1184 /// Sets the full request, replacing any prior values.
1185 pub fn with_request<V: Into<crate::model::QueryFolderContentsRequest>>(
1186 mut self,
1187 v: V,
1188 ) -> Self {
1189 self.0.request = v.into();
1190 self
1191 }
1192
1193 /// Sets all the options, replacing any prior values.
1194 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1195 self.0.options = v.into();
1196 self
1197 }
1198
1199 /// Sends the request.
1200 pub async fn send(self) -> Result<crate::model::QueryFolderContentsResponse> {
1201 (*self.0.stub)
1202 .query_folder_contents(self.0.request, self.0.options)
1203 .await
1204 .map(crate::Response::into_body)
1205 }
1206
1207 /// Streams each page in the collection.
1208 pub fn by_page(
1209 self,
1210 ) -> impl google_cloud_gax::paginator::Paginator<
1211 crate::model::QueryFolderContentsResponse,
1212 crate::Error,
1213 > {
1214 use std::clone::Clone;
1215 let token = self.0.request.page_token.clone();
1216 let execute = move |token: String| {
1217 let mut builder = self.clone();
1218 builder.0.request = builder.0.request.set_page_token(token);
1219 builder.send()
1220 };
1221 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1222 }
1223
1224 /// Streams each item in the collection.
1225 pub fn by_item(
1226 self,
1227 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1228 crate::model::QueryFolderContentsResponse,
1229 crate::Error,
1230 > {
1231 use google_cloud_gax::paginator::Paginator;
1232 self.by_page().items()
1233 }
1234
1235 /// Sets the value of [folder][crate::model::QueryFolderContentsRequest::folder].
1236 ///
1237 /// This is a **required** field for requests.
1238 pub fn set_folder<T: Into<std::string::String>>(mut self, v: T) -> Self {
1239 self.0.request.folder = v.into();
1240 self
1241 }
1242
1243 /// Sets the value of [page_size][crate::model::QueryFolderContentsRequest::page_size].
1244 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1245 self.0.request.page_size = v.into();
1246 self
1247 }
1248
1249 /// Sets the value of [page_token][crate::model::QueryFolderContentsRequest::page_token].
1250 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1251 self.0.request.page_token = v.into();
1252 self
1253 }
1254
1255 /// Sets the value of [order_by][crate::model::QueryFolderContentsRequest::order_by].
1256 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1257 self.0.request.order_by = v.into();
1258 self
1259 }
1260
1261 /// Sets the value of [filter][crate::model::QueryFolderContentsRequest::filter].
1262 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1263 self.0.request.filter = v.into();
1264 self
1265 }
1266 }
1267
1268 #[doc(hidden)]
1269 impl crate::RequestBuilder for QueryFolderContents {
1270 fn request_options(&mut self) -> &mut crate::RequestOptions {
1271 &mut self.0.options
1272 }
1273 }
1274
1275 /// The request builder for [Dataform::query_user_root_contents][crate::client::Dataform::query_user_root_contents] calls.
1276 ///
1277 /// # Example
1278 /// ```
1279 /// # use google_cloud_dataform_v1::builder::dataform::QueryUserRootContents;
1280 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1281 /// use google_cloud_gax::paginator::ItemPaginator;
1282 ///
1283 /// let builder = prepare_request_builder();
1284 /// let mut items = builder.by_item();
1285 /// while let Some(result) = items.next().await {
1286 /// let item = result?;
1287 /// }
1288 /// # Ok(()) }
1289 ///
1290 /// fn prepare_request_builder() -> QueryUserRootContents {
1291 /// # panic!();
1292 /// // ... details omitted ...
1293 /// }
1294 /// ```
1295 #[derive(Clone, Debug)]
1296 pub struct QueryUserRootContents(RequestBuilder<crate::model::QueryUserRootContentsRequest>);
1297
1298 impl QueryUserRootContents {
1299 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1300 Self(RequestBuilder::new(stub))
1301 }
1302
1303 /// Sets the full request, replacing any prior values.
1304 pub fn with_request<V: Into<crate::model::QueryUserRootContentsRequest>>(
1305 mut self,
1306 v: V,
1307 ) -> Self {
1308 self.0.request = v.into();
1309 self
1310 }
1311
1312 /// Sets all the options, replacing any prior values.
1313 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1314 self.0.options = v.into();
1315 self
1316 }
1317
1318 /// Sends the request.
1319 pub async fn send(self) -> Result<crate::model::QueryUserRootContentsResponse> {
1320 (*self.0.stub)
1321 .query_user_root_contents(self.0.request, self.0.options)
1322 .await
1323 .map(crate::Response::into_body)
1324 }
1325
1326 /// Streams each page in the collection.
1327 pub fn by_page(
1328 self,
1329 ) -> impl google_cloud_gax::paginator::Paginator<
1330 crate::model::QueryUserRootContentsResponse,
1331 crate::Error,
1332 > {
1333 use std::clone::Clone;
1334 let token = self.0.request.page_token.clone();
1335 let execute = move |token: String| {
1336 let mut builder = self.clone();
1337 builder.0.request = builder.0.request.set_page_token(token);
1338 builder.send()
1339 };
1340 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1341 }
1342
1343 /// Streams each item in the collection.
1344 pub fn by_item(
1345 self,
1346 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1347 crate::model::QueryUserRootContentsResponse,
1348 crate::Error,
1349 > {
1350 use google_cloud_gax::paginator::Paginator;
1351 self.by_page().items()
1352 }
1353
1354 /// Sets the value of [location][crate::model::QueryUserRootContentsRequest::location].
1355 ///
1356 /// This is a **required** field for requests.
1357 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1358 self.0.request.location = v.into();
1359 self
1360 }
1361
1362 /// Sets the value of [page_size][crate::model::QueryUserRootContentsRequest::page_size].
1363 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1364 self.0.request.page_size = v.into();
1365 self
1366 }
1367
1368 /// Sets the value of [page_token][crate::model::QueryUserRootContentsRequest::page_token].
1369 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1370 self.0.request.page_token = v.into();
1371 self
1372 }
1373
1374 /// Sets the value of [order_by][crate::model::QueryUserRootContentsRequest::order_by].
1375 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1376 self.0.request.order_by = v.into();
1377 self
1378 }
1379
1380 /// Sets the value of [filter][crate::model::QueryUserRootContentsRequest::filter].
1381 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1382 self.0.request.filter = v.into();
1383 self
1384 }
1385 }
1386
1387 #[doc(hidden)]
1388 impl crate::RequestBuilder for QueryUserRootContents {
1389 fn request_options(&mut self) -> &mut crate::RequestOptions {
1390 &mut self.0.options
1391 }
1392 }
1393
1394 /// The request builder for [Dataform::move_folder][crate::client::Dataform::move_folder] calls.
1395 ///
1396 /// # Example
1397 /// ```
1398 /// # use google_cloud_dataform_v1::builder::dataform::MoveFolder;
1399 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1400 /// use google_cloud_lro::Poller;
1401 ///
1402 /// let builder = prepare_request_builder();
1403 /// let response = builder.poller().until_done().await?;
1404 /// # Ok(()) }
1405 ///
1406 /// fn prepare_request_builder() -> MoveFolder {
1407 /// # panic!();
1408 /// // ... details omitted ...
1409 /// }
1410 /// ```
1411 #[derive(Clone, Debug)]
1412 pub struct MoveFolder(RequestBuilder<crate::model::MoveFolderRequest>);
1413
1414 impl MoveFolder {
1415 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1416 Self(RequestBuilder::new(stub))
1417 }
1418
1419 /// Sets the full request, replacing any prior values.
1420 pub fn with_request<V: Into<crate::model::MoveFolderRequest>>(mut self, v: V) -> Self {
1421 self.0.request = v.into();
1422 self
1423 }
1424
1425 /// Sets all the options, replacing any prior values.
1426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1427 self.0.options = v.into();
1428 self
1429 }
1430
1431 /// Sends the request.
1432 ///
1433 /// # Long running operations
1434 ///
1435 /// This starts, but does not poll, a longrunning operation. More information
1436 /// on [move_folder][crate::client::Dataform::move_folder].
1437 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1438 (*self.0.stub)
1439 .move_folder(self.0.request, self.0.options)
1440 .await
1441 .map(crate::Response::into_body)
1442 }
1443
1444 /// Creates a [Poller][google_cloud_lro::Poller] to work with `move_folder`.
1445 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::MoveFolderMetadata> {
1446 type Operation =
1447 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::MoveFolderMetadata>;
1448 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1449 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1450 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
1451 if let Some(ref mut details) = poller_options.tracing {
1452 details.method_name =
1453 "google_cloud_dataform_v1::client::Dataform::move_folder::until_done";
1454 }
1455
1456 let stub = self.0.stub.clone();
1457 let mut options = self.0.options.clone();
1458 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1459 let query = move |name| {
1460 let stub = stub.clone();
1461 let options = options.clone();
1462 async {
1463 let op = GetOperation::new(stub)
1464 .set_name(name)
1465 .with_options(options)
1466 .send()
1467 .await?;
1468 Ok(Operation::new(op))
1469 }
1470 };
1471
1472 let start = move || async {
1473 let op = self.send().await?;
1474 Ok(Operation::new(op))
1475 };
1476
1477 use google_cloud_lro::internal::PollerExt;
1478 {
1479 google_cloud_lro::internal::new_unit_response_poller(
1480 polling_error_policy,
1481 polling_backoff_policy,
1482 start,
1483 query,
1484 )
1485 }
1486 .with_options(poller_options)
1487 }
1488
1489 /// Sets the value of [name][crate::model::MoveFolderRequest::name].
1490 ///
1491 /// This is a **required** field for requests.
1492 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1493 self.0.request.name = v.into();
1494 self
1495 }
1496
1497 /// Sets the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
1498 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
1499 where
1500 T: std::convert::Into<std::string::String>,
1501 {
1502 self.0.request.destination_containing_folder = std::option::Option::Some(v.into());
1503 self
1504 }
1505
1506 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveFolderRequest::destination_containing_folder].
1507 pub fn set_or_clear_destination_containing_folder<T>(
1508 mut self,
1509 v: std::option::Option<T>,
1510 ) -> Self
1511 where
1512 T: std::convert::Into<std::string::String>,
1513 {
1514 self.0.request.destination_containing_folder = v.map(|x| x.into());
1515 self
1516 }
1517 }
1518
1519 #[doc(hidden)]
1520 impl crate::RequestBuilder for MoveFolder {
1521 fn request_options(&mut self) -> &mut crate::RequestOptions {
1522 &mut self.0.options
1523 }
1524 }
1525
1526 /// The request builder for [Dataform::list_repositories][crate::client::Dataform::list_repositories] calls.
1527 ///
1528 /// # Example
1529 /// ```
1530 /// # use google_cloud_dataform_v1::builder::dataform::ListRepositories;
1531 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1532 /// use google_cloud_gax::paginator::ItemPaginator;
1533 ///
1534 /// let builder = prepare_request_builder();
1535 /// let mut items = builder.by_item();
1536 /// while let Some(result) = items.next().await {
1537 /// let item = result?;
1538 /// }
1539 /// # Ok(()) }
1540 ///
1541 /// fn prepare_request_builder() -> ListRepositories {
1542 /// # panic!();
1543 /// // ... details omitted ...
1544 /// }
1545 /// ```
1546 #[derive(Clone, Debug)]
1547 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
1548
1549 impl ListRepositories {
1550 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1551 Self(RequestBuilder::new(stub))
1552 }
1553
1554 /// Sets the full request, replacing any prior values.
1555 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
1556 mut self,
1557 v: V,
1558 ) -> Self {
1559 self.0.request = v.into();
1560 self
1561 }
1562
1563 /// Sets all the options, replacing any prior values.
1564 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1565 self.0.options = v.into();
1566 self
1567 }
1568
1569 /// Sends the request.
1570 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
1571 (*self.0.stub)
1572 .list_repositories(self.0.request, self.0.options)
1573 .await
1574 .map(crate::Response::into_body)
1575 }
1576
1577 /// Streams each page in the collection.
1578 pub fn by_page(
1579 self,
1580 ) -> impl google_cloud_gax::paginator::Paginator<
1581 crate::model::ListRepositoriesResponse,
1582 crate::Error,
1583 > {
1584 use std::clone::Clone;
1585 let token = self.0.request.page_token.clone();
1586 let execute = move |token: String| {
1587 let mut builder = self.clone();
1588 builder.0.request = builder.0.request.set_page_token(token);
1589 builder.send()
1590 };
1591 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1592 }
1593
1594 /// Streams each item in the collection.
1595 pub fn by_item(
1596 self,
1597 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1598 crate::model::ListRepositoriesResponse,
1599 crate::Error,
1600 > {
1601 use google_cloud_gax::paginator::Paginator;
1602 self.by_page().items()
1603 }
1604
1605 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
1606 ///
1607 /// This is a **required** field for requests.
1608 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1609 self.0.request.parent = v.into();
1610 self
1611 }
1612
1613 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
1614 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1615 self.0.request.page_size = v.into();
1616 self
1617 }
1618
1619 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
1620 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1621 self.0.request.page_token = v.into();
1622 self
1623 }
1624
1625 /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
1626 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1627 self.0.request.order_by = v.into();
1628 self
1629 }
1630
1631 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
1632 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1633 self.0.request.filter = v.into();
1634 self
1635 }
1636 }
1637
1638 #[doc(hidden)]
1639 impl crate::RequestBuilder for ListRepositories {
1640 fn request_options(&mut self) -> &mut crate::RequestOptions {
1641 &mut self.0.options
1642 }
1643 }
1644
1645 /// The request builder for [Dataform::get_repository][crate::client::Dataform::get_repository] calls.
1646 ///
1647 /// # Example
1648 /// ```
1649 /// # use google_cloud_dataform_v1::builder::dataform::GetRepository;
1650 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1651 ///
1652 /// let builder = prepare_request_builder();
1653 /// let response = builder.send().await?;
1654 /// # Ok(()) }
1655 ///
1656 /// fn prepare_request_builder() -> GetRepository {
1657 /// # panic!();
1658 /// // ... details omitted ...
1659 /// }
1660 /// ```
1661 #[derive(Clone, Debug)]
1662 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
1663
1664 impl GetRepository {
1665 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1666 Self(RequestBuilder::new(stub))
1667 }
1668
1669 /// Sets the full request, replacing any prior values.
1670 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
1671 self.0.request = v.into();
1672 self
1673 }
1674
1675 /// Sets all the options, replacing any prior values.
1676 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1677 self.0.options = v.into();
1678 self
1679 }
1680
1681 /// Sends the request.
1682 pub async fn send(self) -> Result<crate::model::Repository> {
1683 (*self.0.stub)
1684 .get_repository(self.0.request, self.0.options)
1685 .await
1686 .map(crate::Response::into_body)
1687 }
1688
1689 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
1690 ///
1691 /// This is a **required** field for requests.
1692 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1693 self.0.request.name = v.into();
1694 self
1695 }
1696 }
1697
1698 #[doc(hidden)]
1699 impl crate::RequestBuilder for GetRepository {
1700 fn request_options(&mut self) -> &mut crate::RequestOptions {
1701 &mut self.0.options
1702 }
1703 }
1704
1705 /// The request builder for [Dataform::create_repository][crate::client::Dataform::create_repository] calls.
1706 ///
1707 /// # Example
1708 /// ```
1709 /// # use google_cloud_dataform_v1::builder::dataform::CreateRepository;
1710 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1711 ///
1712 /// let builder = prepare_request_builder();
1713 /// let response = builder.send().await?;
1714 /// # Ok(()) }
1715 ///
1716 /// fn prepare_request_builder() -> CreateRepository {
1717 /// # panic!();
1718 /// // ... details omitted ...
1719 /// }
1720 /// ```
1721 #[derive(Clone, Debug)]
1722 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
1723
1724 impl CreateRepository {
1725 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1726 Self(RequestBuilder::new(stub))
1727 }
1728
1729 /// Sets the full request, replacing any prior values.
1730 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
1731 mut self,
1732 v: V,
1733 ) -> Self {
1734 self.0.request = v.into();
1735 self
1736 }
1737
1738 /// Sets all the options, replacing any prior values.
1739 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1740 self.0.options = v.into();
1741 self
1742 }
1743
1744 /// Sends the request.
1745 pub async fn send(self) -> Result<crate::model::Repository> {
1746 (*self.0.stub)
1747 .create_repository(self.0.request, self.0.options)
1748 .await
1749 .map(crate::Response::into_body)
1750 }
1751
1752 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
1753 ///
1754 /// This is a **required** field for requests.
1755 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1756 self.0.request.parent = v.into();
1757 self
1758 }
1759
1760 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
1761 ///
1762 /// This is a **required** field for requests.
1763 pub fn set_repository<T>(mut self, v: T) -> Self
1764 where
1765 T: std::convert::Into<crate::model::Repository>,
1766 {
1767 self.0.request.repository = std::option::Option::Some(v.into());
1768 self
1769 }
1770
1771 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
1772 ///
1773 /// This is a **required** field for requests.
1774 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1775 where
1776 T: std::convert::Into<crate::model::Repository>,
1777 {
1778 self.0.request.repository = v.map(|x| x.into());
1779 self
1780 }
1781
1782 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
1783 ///
1784 /// This is a **required** field for requests.
1785 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1786 self.0.request.repository_id = v.into();
1787 self
1788 }
1789 }
1790
1791 #[doc(hidden)]
1792 impl crate::RequestBuilder for CreateRepository {
1793 fn request_options(&mut self) -> &mut crate::RequestOptions {
1794 &mut self.0.options
1795 }
1796 }
1797
1798 /// The request builder for [Dataform::update_repository][crate::client::Dataform::update_repository] calls.
1799 ///
1800 /// # Example
1801 /// ```
1802 /// # use google_cloud_dataform_v1::builder::dataform::UpdateRepository;
1803 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1804 ///
1805 /// let builder = prepare_request_builder();
1806 /// let response = builder.send().await?;
1807 /// # Ok(()) }
1808 ///
1809 /// fn prepare_request_builder() -> UpdateRepository {
1810 /// # panic!();
1811 /// // ... details omitted ...
1812 /// }
1813 /// ```
1814 #[derive(Clone, Debug)]
1815 pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
1816
1817 impl UpdateRepository {
1818 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1819 Self(RequestBuilder::new(stub))
1820 }
1821
1822 /// Sets the full request, replacing any prior values.
1823 pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
1824 mut self,
1825 v: V,
1826 ) -> Self {
1827 self.0.request = v.into();
1828 self
1829 }
1830
1831 /// Sets all the options, replacing any prior values.
1832 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1833 self.0.options = v.into();
1834 self
1835 }
1836
1837 /// Sends the request.
1838 pub async fn send(self) -> Result<crate::model::Repository> {
1839 (*self.0.stub)
1840 .update_repository(self.0.request, self.0.options)
1841 .await
1842 .map(crate::Response::into_body)
1843 }
1844
1845 /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1846 pub fn set_update_mask<T>(mut self, v: T) -> Self
1847 where
1848 T: std::convert::Into<wkt::FieldMask>,
1849 {
1850 self.0.request.update_mask = std::option::Option::Some(v.into());
1851 self
1852 }
1853
1854 /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
1855 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1856 where
1857 T: std::convert::Into<wkt::FieldMask>,
1858 {
1859 self.0.request.update_mask = v.map(|x| x.into());
1860 self
1861 }
1862
1863 /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1864 ///
1865 /// This is a **required** field for requests.
1866 pub fn set_repository<T>(mut self, v: T) -> Self
1867 where
1868 T: std::convert::Into<crate::model::Repository>,
1869 {
1870 self.0.request.repository = std::option::Option::Some(v.into());
1871 self
1872 }
1873
1874 /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
1875 ///
1876 /// This is a **required** field for requests.
1877 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
1878 where
1879 T: std::convert::Into<crate::model::Repository>,
1880 {
1881 self.0.request.repository = v.map(|x| x.into());
1882 self
1883 }
1884 }
1885
1886 #[doc(hidden)]
1887 impl crate::RequestBuilder for UpdateRepository {
1888 fn request_options(&mut self) -> &mut crate::RequestOptions {
1889 &mut self.0.options
1890 }
1891 }
1892
1893 /// The request builder for [Dataform::delete_repository][crate::client::Dataform::delete_repository] calls.
1894 ///
1895 /// # Example
1896 /// ```
1897 /// # use google_cloud_dataform_v1::builder::dataform::DeleteRepository;
1898 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1899 ///
1900 /// let builder = prepare_request_builder();
1901 /// let response = builder.send().await?;
1902 /// # Ok(()) }
1903 ///
1904 /// fn prepare_request_builder() -> DeleteRepository {
1905 /// # panic!();
1906 /// // ... details omitted ...
1907 /// }
1908 /// ```
1909 #[derive(Clone, Debug)]
1910 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
1911
1912 impl DeleteRepository {
1913 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1914 Self(RequestBuilder::new(stub))
1915 }
1916
1917 /// Sets the full request, replacing any prior values.
1918 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
1919 mut self,
1920 v: V,
1921 ) -> Self {
1922 self.0.request = v.into();
1923 self
1924 }
1925
1926 /// Sets all the options, replacing any prior values.
1927 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1928 self.0.options = v.into();
1929 self
1930 }
1931
1932 /// Sends the request.
1933 pub async fn send(self) -> Result<()> {
1934 (*self.0.stub)
1935 .delete_repository(self.0.request, self.0.options)
1936 .await
1937 .map(crate::Response::into_body)
1938 }
1939
1940 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
1941 ///
1942 /// This is a **required** field for requests.
1943 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.name = v.into();
1945 self
1946 }
1947
1948 /// Sets the value of [force][crate::model::DeleteRepositoryRequest::force].
1949 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1950 self.0.request.force = v.into();
1951 self
1952 }
1953 }
1954
1955 #[doc(hidden)]
1956 impl crate::RequestBuilder for DeleteRepository {
1957 fn request_options(&mut self) -> &mut crate::RequestOptions {
1958 &mut self.0.options
1959 }
1960 }
1961
1962 /// The request builder for [Dataform::move_repository][crate::client::Dataform::move_repository] calls.
1963 ///
1964 /// # Example
1965 /// ```
1966 /// # use google_cloud_dataform_v1::builder::dataform::MoveRepository;
1967 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1968 /// use google_cloud_lro::Poller;
1969 ///
1970 /// let builder = prepare_request_builder();
1971 /// let response = builder.poller().until_done().await?;
1972 /// # Ok(()) }
1973 ///
1974 /// fn prepare_request_builder() -> MoveRepository {
1975 /// # panic!();
1976 /// // ... details omitted ...
1977 /// }
1978 /// ```
1979 #[derive(Clone, Debug)]
1980 pub struct MoveRepository(RequestBuilder<crate::model::MoveRepositoryRequest>);
1981
1982 impl MoveRepository {
1983 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1984 Self(RequestBuilder::new(stub))
1985 }
1986
1987 /// Sets the full request, replacing any prior values.
1988 pub fn with_request<V: Into<crate::model::MoveRepositoryRequest>>(mut self, v: V) -> Self {
1989 self.0.request = v.into();
1990 self
1991 }
1992
1993 /// Sets all the options, replacing any prior values.
1994 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1995 self.0.options = v.into();
1996 self
1997 }
1998
1999 /// Sends the request.
2000 ///
2001 /// # Long running operations
2002 ///
2003 /// This starts, but does not poll, a longrunning operation. More information
2004 /// on [move_repository][crate::client::Dataform::move_repository].
2005 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2006 (*self.0.stub)
2007 .move_repository(self.0.request, self.0.options)
2008 .await
2009 .map(crate::Response::into_body)
2010 }
2011
2012 /// Creates a [Poller][google_cloud_lro::Poller] to work with `move_repository`.
2013 pub fn poller(
2014 self,
2015 ) -> impl google_cloud_lro::Poller<(), crate::model::MoveRepositoryMetadata> {
2016 type Operation = google_cloud_lro::internal::Operation<
2017 wkt::Empty,
2018 crate::model::MoveRepositoryMetadata,
2019 >;
2020 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2021 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2022 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2023 if let Some(ref mut details) = poller_options.tracing {
2024 details.method_name =
2025 "google_cloud_dataform_v1::client::Dataform::move_repository::until_done";
2026 }
2027
2028 let stub = self.0.stub.clone();
2029 let mut options = self.0.options.clone();
2030 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2031 let query = move |name| {
2032 let stub = stub.clone();
2033 let options = options.clone();
2034 async {
2035 let op = GetOperation::new(stub)
2036 .set_name(name)
2037 .with_options(options)
2038 .send()
2039 .await?;
2040 Ok(Operation::new(op))
2041 }
2042 };
2043
2044 let start = move || async {
2045 let op = self.send().await?;
2046 Ok(Operation::new(op))
2047 };
2048
2049 use google_cloud_lro::internal::PollerExt;
2050 {
2051 google_cloud_lro::internal::new_unit_response_poller(
2052 polling_error_policy,
2053 polling_backoff_policy,
2054 start,
2055 query,
2056 )
2057 }
2058 .with_options(poller_options)
2059 }
2060
2061 /// Sets the value of [name][crate::model::MoveRepositoryRequest::name].
2062 ///
2063 /// This is a **required** field for requests.
2064 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2065 self.0.request.name = v.into();
2066 self
2067 }
2068
2069 /// Sets the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
2070 pub fn set_destination_containing_folder<T>(mut self, v: T) -> Self
2071 where
2072 T: std::convert::Into<std::string::String>,
2073 {
2074 self.0.request.destination_containing_folder = std::option::Option::Some(v.into());
2075 self
2076 }
2077
2078 /// Sets or clears the value of [destination_containing_folder][crate::model::MoveRepositoryRequest::destination_containing_folder].
2079 pub fn set_or_clear_destination_containing_folder<T>(
2080 mut self,
2081 v: std::option::Option<T>,
2082 ) -> Self
2083 where
2084 T: std::convert::Into<std::string::String>,
2085 {
2086 self.0.request.destination_containing_folder = v.map(|x| x.into());
2087 self
2088 }
2089 }
2090
2091 #[doc(hidden)]
2092 impl crate::RequestBuilder for MoveRepository {
2093 fn request_options(&mut self) -> &mut crate::RequestOptions {
2094 &mut self.0.options
2095 }
2096 }
2097
2098 /// The request builder for [Dataform::commit_repository_changes][crate::client::Dataform::commit_repository_changes] calls.
2099 ///
2100 /// # Example
2101 /// ```
2102 /// # use google_cloud_dataform_v1::builder::dataform::CommitRepositoryChanges;
2103 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2104 ///
2105 /// let builder = prepare_request_builder();
2106 /// let response = builder.send().await?;
2107 /// # Ok(()) }
2108 ///
2109 /// fn prepare_request_builder() -> CommitRepositoryChanges {
2110 /// # panic!();
2111 /// // ... details omitted ...
2112 /// }
2113 /// ```
2114 #[derive(Clone, Debug)]
2115 pub struct CommitRepositoryChanges(
2116 RequestBuilder<crate::model::CommitRepositoryChangesRequest>,
2117 );
2118
2119 impl CommitRepositoryChanges {
2120 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2121 Self(RequestBuilder::new(stub))
2122 }
2123
2124 /// Sets the full request, replacing any prior values.
2125 pub fn with_request<V: Into<crate::model::CommitRepositoryChangesRequest>>(
2126 mut self,
2127 v: V,
2128 ) -> Self {
2129 self.0.request = v.into();
2130 self
2131 }
2132
2133 /// Sets all the options, replacing any prior values.
2134 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2135 self.0.options = v.into();
2136 self
2137 }
2138
2139 /// Sends the request.
2140 pub async fn send(self) -> Result<crate::model::CommitRepositoryChangesResponse> {
2141 (*self.0.stub)
2142 .commit_repository_changes(self.0.request, self.0.options)
2143 .await
2144 .map(crate::Response::into_body)
2145 }
2146
2147 /// Sets the value of [name][crate::model::CommitRepositoryChangesRequest::name].
2148 ///
2149 /// This is a **required** field for requests.
2150 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2151 self.0.request.name = v.into();
2152 self
2153 }
2154
2155 /// Sets the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
2156 ///
2157 /// This is a **required** field for requests.
2158 pub fn set_commit_metadata<T>(mut self, v: T) -> Self
2159 where
2160 T: std::convert::Into<crate::model::CommitMetadata>,
2161 {
2162 self.0.request.commit_metadata = std::option::Option::Some(v.into());
2163 self
2164 }
2165
2166 /// Sets or clears the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
2167 ///
2168 /// This is a **required** field for requests.
2169 pub fn set_or_clear_commit_metadata<T>(mut self, v: std::option::Option<T>) -> Self
2170 where
2171 T: std::convert::Into<crate::model::CommitMetadata>,
2172 {
2173 self.0.request.commit_metadata = v.map(|x| x.into());
2174 self
2175 }
2176
2177 /// Sets the value of [required_head_commit_sha][crate::model::CommitRepositoryChangesRequest::required_head_commit_sha].
2178 pub fn set_required_head_commit_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
2179 self.0.request.required_head_commit_sha = v.into();
2180 self
2181 }
2182
2183 /// Sets the value of [file_operations][crate::model::CommitRepositoryChangesRequest::file_operations].
2184 pub fn set_file_operations<T, K, V>(mut self, v: T) -> Self
2185 where
2186 T: std::iter::IntoIterator<Item = (K, V)>,
2187 K: std::convert::Into<std::string::String>,
2188 V: std::convert::Into<crate::model::commit_repository_changes_request::FileOperation>,
2189 {
2190 self.0.request.file_operations =
2191 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
2192 self
2193 }
2194 }
2195
2196 #[doc(hidden)]
2197 impl crate::RequestBuilder for CommitRepositoryChanges {
2198 fn request_options(&mut self) -> &mut crate::RequestOptions {
2199 &mut self.0.options
2200 }
2201 }
2202
2203 /// The request builder for [Dataform::read_repository_file][crate::client::Dataform::read_repository_file] calls.
2204 ///
2205 /// # Example
2206 /// ```
2207 /// # use google_cloud_dataform_v1::builder::dataform::ReadRepositoryFile;
2208 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2209 ///
2210 /// let builder = prepare_request_builder();
2211 /// let response = builder.send().await?;
2212 /// # Ok(()) }
2213 ///
2214 /// fn prepare_request_builder() -> ReadRepositoryFile {
2215 /// # panic!();
2216 /// // ... details omitted ...
2217 /// }
2218 /// ```
2219 #[derive(Clone, Debug)]
2220 pub struct ReadRepositoryFile(RequestBuilder<crate::model::ReadRepositoryFileRequest>);
2221
2222 impl ReadRepositoryFile {
2223 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2224 Self(RequestBuilder::new(stub))
2225 }
2226
2227 /// Sets the full request, replacing any prior values.
2228 pub fn with_request<V: Into<crate::model::ReadRepositoryFileRequest>>(
2229 mut self,
2230 v: V,
2231 ) -> Self {
2232 self.0.request = v.into();
2233 self
2234 }
2235
2236 /// Sets all the options, replacing any prior values.
2237 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2238 self.0.options = v.into();
2239 self
2240 }
2241
2242 /// Sends the request.
2243 pub async fn send(self) -> Result<crate::model::ReadRepositoryFileResponse> {
2244 (*self.0.stub)
2245 .read_repository_file(self.0.request, self.0.options)
2246 .await
2247 .map(crate::Response::into_body)
2248 }
2249
2250 /// Sets the value of [name][crate::model::ReadRepositoryFileRequest::name].
2251 ///
2252 /// This is a **required** field for requests.
2253 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2254 self.0.request.name = v.into();
2255 self
2256 }
2257
2258 /// Sets the value of [commit_sha][crate::model::ReadRepositoryFileRequest::commit_sha].
2259 pub fn set_commit_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
2260 self.0.request.commit_sha = v.into();
2261 self
2262 }
2263
2264 /// Sets the value of [path][crate::model::ReadRepositoryFileRequest::path].
2265 ///
2266 /// This is a **required** field for requests.
2267 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2268 self.0.request.path = v.into();
2269 self
2270 }
2271 }
2272
2273 #[doc(hidden)]
2274 impl crate::RequestBuilder for ReadRepositoryFile {
2275 fn request_options(&mut self) -> &mut crate::RequestOptions {
2276 &mut self.0.options
2277 }
2278 }
2279
2280 /// The request builder for [Dataform::query_repository_directory_contents][crate::client::Dataform::query_repository_directory_contents] calls.
2281 ///
2282 /// # Example
2283 /// ```
2284 /// # use google_cloud_dataform_v1::builder::dataform::QueryRepositoryDirectoryContents;
2285 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2286 /// use google_cloud_gax::paginator::ItemPaginator;
2287 ///
2288 /// let builder = prepare_request_builder();
2289 /// let mut items = builder.by_item();
2290 /// while let Some(result) = items.next().await {
2291 /// let item = result?;
2292 /// }
2293 /// # Ok(()) }
2294 ///
2295 /// fn prepare_request_builder() -> QueryRepositoryDirectoryContents {
2296 /// # panic!();
2297 /// // ... details omitted ...
2298 /// }
2299 /// ```
2300 #[derive(Clone, Debug)]
2301 pub struct QueryRepositoryDirectoryContents(
2302 RequestBuilder<crate::model::QueryRepositoryDirectoryContentsRequest>,
2303 );
2304
2305 impl QueryRepositoryDirectoryContents {
2306 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2307 Self(RequestBuilder::new(stub))
2308 }
2309
2310 /// Sets the full request, replacing any prior values.
2311 pub fn with_request<V: Into<crate::model::QueryRepositoryDirectoryContentsRequest>>(
2312 mut self,
2313 v: V,
2314 ) -> Self {
2315 self.0.request = v.into();
2316 self
2317 }
2318
2319 /// Sets all the options, replacing any prior values.
2320 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2321 self.0.options = v.into();
2322 self
2323 }
2324
2325 /// Sends the request.
2326 pub async fn send(self) -> Result<crate::model::QueryRepositoryDirectoryContentsResponse> {
2327 (*self.0.stub)
2328 .query_repository_directory_contents(self.0.request, self.0.options)
2329 .await
2330 .map(crate::Response::into_body)
2331 }
2332
2333 /// Streams each page in the collection.
2334 pub fn by_page(
2335 self,
2336 ) -> impl google_cloud_gax::paginator::Paginator<
2337 crate::model::QueryRepositoryDirectoryContentsResponse,
2338 crate::Error,
2339 > {
2340 use std::clone::Clone;
2341 let token = self.0.request.page_token.clone();
2342 let execute = move |token: String| {
2343 let mut builder = self.clone();
2344 builder.0.request = builder.0.request.set_page_token(token);
2345 builder.send()
2346 };
2347 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2348 }
2349
2350 /// Streams each item in the collection.
2351 pub fn by_item(
2352 self,
2353 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2354 crate::model::QueryRepositoryDirectoryContentsResponse,
2355 crate::Error,
2356 > {
2357 use google_cloud_gax::paginator::Paginator;
2358 self.by_page().items()
2359 }
2360
2361 /// Sets the value of [name][crate::model::QueryRepositoryDirectoryContentsRequest::name].
2362 ///
2363 /// This is a **required** field for requests.
2364 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2365 self.0.request.name = v.into();
2366 self
2367 }
2368
2369 /// Sets the value of [commit_sha][crate::model::QueryRepositoryDirectoryContentsRequest::commit_sha].
2370 pub fn set_commit_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
2371 self.0.request.commit_sha = v.into();
2372 self
2373 }
2374
2375 /// Sets the value of [path][crate::model::QueryRepositoryDirectoryContentsRequest::path].
2376 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377 self.0.request.path = v.into();
2378 self
2379 }
2380
2381 /// Sets the value of [page_size][crate::model::QueryRepositoryDirectoryContentsRequest::page_size].
2382 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2383 self.0.request.page_size = v.into();
2384 self
2385 }
2386
2387 /// Sets the value of [page_token][crate::model::QueryRepositoryDirectoryContentsRequest::page_token].
2388 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2389 self.0.request.page_token = v.into();
2390 self
2391 }
2392 }
2393
2394 #[doc(hidden)]
2395 impl crate::RequestBuilder for QueryRepositoryDirectoryContents {
2396 fn request_options(&mut self) -> &mut crate::RequestOptions {
2397 &mut self.0.options
2398 }
2399 }
2400
2401 /// The request builder for [Dataform::fetch_repository_history][crate::client::Dataform::fetch_repository_history] calls.
2402 ///
2403 /// # Example
2404 /// ```
2405 /// # use google_cloud_dataform_v1::builder::dataform::FetchRepositoryHistory;
2406 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2407 /// use google_cloud_gax::paginator::ItemPaginator;
2408 ///
2409 /// let builder = prepare_request_builder();
2410 /// let mut items = builder.by_item();
2411 /// while let Some(result) = items.next().await {
2412 /// let item = result?;
2413 /// }
2414 /// # Ok(()) }
2415 ///
2416 /// fn prepare_request_builder() -> FetchRepositoryHistory {
2417 /// # panic!();
2418 /// // ... details omitted ...
2419 /// }
2420 /// ```
2421 #[derive(Clone, Debug)]
2422 pub struct FetchRepositoryHistory(RequestBuilder<crate::model::FetchRepositoryHistoryRequest>);
2423
2424 impl FetchRepositoryHistory {
2425 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2426 Self(RequestBuilder::new(stub))
2427 }
2428
2429 /// Sets the full request, replacing any prior values.
2430 pub fn with_request<V: Into<crate::model::FetchRepositoryHistoryRequest>>(
2431 mut self,
2432 v: V,
2433 ) -> Self {
2434 self.0.request = v.into();
2435 self
2436 }
2437
2438 /// Sets all the options, replacing any prior values.
2439 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2440 self.0.options = v.into();
2441 self
2442 }
2443
2444 /// Sends the request.
2445 pub async fn send(self) -> Result<crate::model::FetchRepositoryHistoryResponse> {
2446 (*self.0.stub)
2447 .fetch_repository_history(self.0.request, self.0.options)
2448 .await
2449 .map(crate::Response::into_body)
2450 }
2451
2452 /// Streams each page in the collection.
2453 pub fn by_page(
2454 self,
2455 ) -> impl google_cloud_gax::paginator::Paginator<
2456 crate::model::FetchRepositoryHistoryResponse,
2457 crate::Error,
2458 > {
2459 use std::clone::Clone;
2460 let token = self.0.request.page_token.clone();
2461 let execute = move |token: String| {
2462 let mut builder = self.clone();
2463 builder.0.request = builder.0.request.set_page_token(token);
2464 builder.send()
2465 };
2466 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2467 }
2468
2469 /// Streams each item in the collection.
2470 pub fn by_item(
2471 self,
2472 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2473 crate::model::FetchRepositoryHistoryResponse,
2474 crate::Error,
2475 > {
2476 use google_cloud_gax::paginator::Paginator;
2477 self.by_page().items()
2478 }
2479
2480 /// Sets the value of [name][crate::model::FetchRepositoryHistoryRequest::name].
2481 ///
2482 /// This is a **required** field for requests.
2483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2484 self.0.request.name = v.into();
2485 self
2486 }
2487
2488 /// Sets the value of [page_size][crate::model::FetchRepositoryHistoryRequest::page_size].
2489 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2490 self.0.request.page_size = v.into();
2491 self
2492 }
2493
2494 /// Sets the value of [page_token][crate::model::FetchRepositoryHistoryRequest::page_token].
2495 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2496 self.0.request.page_token = v.into();
2497 self
2498 }
2499 }
2500
2501 #[doc(hidden)]
2502 impl crate::RequestBuilder for FetchRepositoryHistory {
2503 fn request_options(&mut self) -> &mut crate::RequestOptions {
2504 &mut self.0.options
2505 }
2506 }
2507
2508 /// The request builder for [Dataform::compute_repository_access_token_status][crate::client::Dataform::compute_repository_access_token_status] calls.
2509 ///
2510 /// # Example
2511 /// ```
2512 /// # use google_cloud_dataform_v1::builder::dataform::ComputeRepositoryAccessTokenStatus;
2513 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2514 ///
2515 /// let builder = prepare_request_builder();
2516 /// let response = builder.send().await?;
2517 /// # Ok(()) }
2518 ///
2519 /// fn prepare_request_builder() -> ComputeRepositoryAccessTokenStatus {
2520 /// # panic!();
2521 /// // ... details omitted ...
2522 /// }
2523 /// ```
2524 #[derive(Clone, Debug)]
2525 pub struct ComputeRepositoryAccessTokenStatus(
2526 RequestBuilder<crate::model::ComputeRepositoryAccessTokenStatusRequest>,
2527 );
2528
2529 impl ComputeRepositoryAccessTokenStatus {
2530 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2531 Self(RequestBuilder::new(stub))
2532 }
2533
2534 /// Sets the full request, replacing any prior values.
2535 pub fn with_request<V: Into<crate::model::ComputeRepositoryAccessTokenStatusRequest>>(
2536 mut self,
2537 v: V,
2538 ) -> Self {
2539 self.0.request = v.into();
2540 self
2541 }
2542
2543 /// Sets all the options, replacing any prior values.
2544 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2545 self.0.options = v.into();
2546 self
2547 }
2548
2549 /// Sends the request.
2550 pub async fn send(
2551 self,
2552 ) -> Result<crate::model::ComputeRepositoryAccessTokenStatusResponse> {
2553 (*self.0.stub)
2554 .compute_repository_access_token_status(self.0.request, self.0.options)
2555 .await
2556 .map(crate::Response::into_body)
2557 }
2558
2559 /// Sets the value of [name][crate::model::ComputeRepositoryAccessTokenStatusRequest::name].
2560 ///
2561 /// This is a **required** field for requests.
2562 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2563 self.0.request.name = v.into();
2564 self
2565 }
2566 }
2567
2568 #[doc(hidden)]
2569 impl crate::RequestBuilder for ComputeRepositoryAccessTokenStatus {
2570 fn request_options(&mut self) -> &mut crate::RequestOptions {
2571 &mut self.0.options
2572 }
2573 }
2574
2575 /// The request builder for [Dataform::fetch_remote_branches][crate::client::Dataform::fetch_remote_branches] calls.
2576 ///
2577 /// # Example
2578 /// ```
2579 /// # use google_cloud_dataform_v1::builder::dataform::FetchRemoteBranches;
2580 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2581 ///
2582 /// let builder = prepare_request_builder();
2583 /// let response = builder.send().await?;
2584 /// # Ok(()) }
2585 ///
2586 /// fn prepare_request_builder() -> FetchRemoteBranches {
2587 /// # panic!();
2588 /// // ... details omitted ...
2589 /// }
2590 /// ```
2591 #[derive(Clone, Debug)]
2592 pub struct FetchRemoteBranches(RequestBuilder<crate::model::FetchRemoteBranchesRequest>);
2593
2594 impl FetchRemoteBranches {
2595 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2596 Self(RequestBuilder::new(stub))
2597 }
2598
2599 /// Sets the full request, replacing any prior values.
2600 pub fn with_request<V: Into<crate::model::FetchRemoteBranchesRequest>>(
2601 mut self,
2602 v: V,
2603 ) -> Self {
2604 self.0.request = v.into();
2605 self
2606 }
2607
2608 /// Sets all the options, replacing any prior values.
2609 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2610 self.0.options = v.into();
2611 self
2612 }
2613
2614 /// Sends the request.
2615 pub async fn send(self) -> Result<crate::model::FetchRemoteBranchesResponse> {
2616 (*self.0.stub)
2617 .fetch_remote_branches(self.0.request, self.0.options)
2618 .await
2619 .map(crate::Response::into_body)
2620 }
2621
2622 /// Sets the value of [name][crate::model::FetchRemoteBranchesRequest::name].
2623 ///
2624 /// This is a **required** field for requests.
2625 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2626 self.0.request.name = v.into();
2627 self
2628 }
2629 }
2630
2631 #[doc(hidden)]
2632 impl crate::RequestBuilder for FetchRemoteBranches {
2633 fn request_options(&mut self) -> &mut crate::RequestOptions {
2634 &mut self.0.options
2635 }
2636 }
2637
2638 /// The request builder for [Dataform::list_workspaces][crate::client::Dataform::list_workspaces] calls.
2639 ///
2640 /// # Example
2641 /// ```
2642 /// # use google_cloud_dataform_v1::builder::dataform::ListWorkspaces;
2643 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2644 /// use google_cloud_gax::paginator::ItemPaginator;
2645 ///
2646 /// let builder = prepare_request_builder();
2647 /// let mut items = builder.by_item();
2648 /// while let Some(result) = items.next().await {
2649 /// let item = result?;
2650 /// }
2651 /// # Ok(()) }
2652 ///
2653 /// fn prepare_request_builder() -> ListWorkspaces {
2654 /// # panic!();
2655 /// // ... details omitted ...
2656 /// }
2657 /// ```
2658 #[derive(Clone, Debug)]
2659 pub struct ListWorkspaces(RequestBuilder<crate::model::ListWorkspacesRequest>);
2660
2661 impl ListWorkspaces {
2662 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2663 Self(RequestBuilder::new(stub))
2664 }
2665
2666 /// Sets the full request, replacing any prior values.
2667 pub fn with_request<V: Into<crate::model::ListWorkspacesRequest>>(mut self, v: V) -> Self {
2668 self.0.request = v.into();
2669 self
2670 }
2671
2672 /// Sets all the options, replacing any prior values.
2673 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2674 self.0.options = v.into();
2675 self
2676 }
2677
2678 /// Sends the request.
2679 pub async fn send(self) -> Result<crate::model::ListWorkspacesResponse> {
2680 (*self.0.stub)
2681 .list_workspaces(self.0.request, self.0.options)
2682 .await
2683 .map(crate::Response::into_body)
2684 }
2685
2686 /// Streams each page in the collection.
2687 pub fn by_page(
2688 self,
2689 ) -> impl google_cloud_gax::paginator::Paginator<
2690 crate::model::ListWorkspacesResponse,
2691 crate::Error,
2692 > {
2693 use std::clone::Clone;
2694 let token = self.0.request.page_token.clone();
2695 let execute = move |token: String| {
2696 let mut builder = self.clone();
2697 builder.0.request = builder.0.request.set_page_token(token);
2698 builder.send()
2699 };
2700 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2701 }
2702
2703 /// Streams each item in the collection.
2704 pub fn by_item(
2705 self,
2706 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2707 crate::model::ListWorkspacesResponse,
2708 crate::Error,
2709 > {
2710 use google_cloud_gax::paginator::Paginator;
2711 self.by_page().items()
2712 }
2713
2714 /// Sets the value of [parent][crate::model::ListWorkspacesRequest::parent].
2715 ///
2716 /// This is a **required** field for requests.
2717 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2718 self.0.request.parent = v.into();
2719 self
2720 }
2721
2722 /// Sets the value of [page_size][crate::model::ListWorkspacesRequest::page_size].
2723 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2724 self.0.request.page_size = v.into();
2725 self
2726 }
2727
2728 /// Sets the value of [page_token][crate::model::ListWorkspacesRequest::page_token].
2729 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2730 self.0.request.page_token = v.into();
2731 self
2732 }
2733
2734 /// Sets the value of [order_by][crate::model::ListWorkspacesRequest::order_by].
2735 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2736 self.0.request.order_by = v.into();
2737 self
2738 }
2739
2740 /// Sets the value of [filter][crate::model::ListWorkspacesRequest::filter].
2741 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2742 self.0.request.filter = v.into();
2743 self
2744 }
2745 }
2746
2747 #[doc(hidden)]
2748 impl crate::RequestBuilder for ListWorkspaces {
2749 fn request_options(&mut self) -> &mut crate::RequestOptions {
2750 &mut self.0.options
2751 }
2752 }
2753
2754 /// The request builder for [Dataform::get_workspace][crate::client::Dataform::get_workspace] calls.
2755 ///
2756 /// # Example
2757 /// ```
2758 /// # use google_cloud_dataform_v1::builder::dataform::GetWorkspace;
2759 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2760 ///
2761 /// let builder = prepare_request_builder();
2762 /// let response = builder.send().await?;
2763 /// # Ok(()) }
2764 ///
2765 /// fn prepare_request_builder() -> GetWorkspace {
2766 /// # panic!();
2767 /// // ... details omitted ...
2768 /// }
2769 /// ```
2770 #[derive(Clone, Debug)]
2771 pub struct GetWorkspace(RequestBuilder<crate::model::GetWorkspaceRequest>);
2772
2773 impl GetWorkspace {
2774 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2775 Self(RequestBuilder::new(stub))
2776 }
2777
2778 /// Sets the full request, replacing any prior values.
2779 pub fn with_request<V: Into<crate::model::GetWorkspaceRequest>>(mut self, v: V) -> Self {
2780 self.0.request = v.into();
2781 self
2782 }
2783
2784 /// Sets all the options, replacing any prior values.
2785 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2786 self.0.options = v.into();
2787 self
2788 }
2789
2790 /// Sends the request.
2791 pub async fn send(self) -> Result<crate::model::Workspace> {
2792 (*self.0.stub)
2793 .get_workspace(self.0.request, self.0.options)
2794 .await
2795 .map(crate::Response::into_body)
2796 }
2797
2798 /// Sets the value of [name][crate::model::GetWorkspaceRequest::name].
2799 ///
2800 /// This is a **required** field for requests.
2801 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2802 self.0.request.name = v.into();
2803 self
2804 }
2805 }
2806
2807 #[doc(hidden)]
2808 impl crate::RequestBuilder for GetWorkspace {
2809 fn request_options(&mut self) -> &mut crate::RequestOptions {
2810 &mut self.0.options
2811 }
2812 }
2813
2814 /// The request builder for [Dataform::create_workspace][crate::client::Dataform::create_workspace] calls.
2815 ///
2816 /// # Example
2817 /// ```
2818 /// # use google_cloud_dataform_v1::builder::dataform::CreateWorkspace;
2819 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2820 ///
2821 /// let builder = prepare_request_builder();
2822 /// let response = builder.send().await?;
2823 /// # Ok(()) }
2824 ///
2825 /// fn prepare_request_builder() -> CreateWorkspace {
2826 /// # panic!();
2827 /// // ... details omitted ...
2828 /// }
2829 /// ```
2830 #[derive(Clone, Debug)]
2831 pub struct CreateWorkspace(RequestBuilder<crate::model::CreateWorkspaceRequest>);
2832
2833 impl CreateWorkspace {
2834 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2835 Self(RequestBuilder::new(stub))
2836 }
2837
2838 /// Sets the full request, replacing any prior values.
2839 pub fn with_request<V: Into<crate::model::CreateWorkspaceRequest>>(mut self, v: V) -> Self {
2840 self.0.request = v.into();
2841 self
2842 }
2843
2844 /// Sets all the options, replacing any prior values.
2845 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2846 self.0.options = v.into();
2847 self
2848 }
2849
2850 /// Sends the request.
2851 pub async fn send(self) -> Result<crate::model::Workspace> {
2852 (*self.0.stub)
2853 .create_workspace(self.0.request, self.0.options)
2854 .await
2855 .map(crate::Response::into_body)
2856 }
2857
2858 /// Sets the value of [parent][crate::model::CreateWorkspaceRequest::parent].
2859 ///
2860 /// This is a **required** field for requests.
2861 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2862 self.0.request.parent = v.into();
2863 self
2864 }
2865
2866 /// Sets the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
2867 ///
2868 /// This is a **required** field for requests.
2869 pub fn set_workspace<T>(mut self, v: T) -> Self
2870 where
2871 T: std::convert::Into<crate::model::Workspace>,
2872 {
2873 self.0.request.workspace = std::option::Option::Some(v.into());
2874 self
2875 }
2876
2877 /// Sets or clears the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
2878 ///
2879 /// This is a **required** field for requests.
2880 pub fn set_or_clear_workspace<T>(mut self, v: std::option::Option<T>) -> Self
2881 where
2882 T: std::convert::Into<crate::model::Workspace>,
2883 {
2884 self.0.request.workspace = v.map(|x| x.into());
2885 self
2886 }
2887
2888 /// Sets the value of [workspace_id][crate::model::CreateWorkspaceRequest::workspace_id].
2889 ///
2890 /// This is a **required** field for requests.
2891 pub fn set_workspace_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2892 self.0.request.workspace_id = v.into();
2893 self
2894 }
2895 }
2896
2897 #[doc(hidden)]
2898 impl crate::RequestBuilder for CreateWorkspace {
2899 fn request_options(&mut self) -> &mut crate::RequestOptions {
2900 &mut self.0.options
2901 }
2902 }
2903
2904 /// The request builder for [Dataform::delete_workspace][crate::client::Dataform::delete_workspace] calls.
2905 ///
2906 /// # Example
2907 /// ```
2908 /// # use google_cloud_dataform_v1::builder::dataform::DeleteWorkspace;
2909 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2910 ///
2911 /// let builder = prepare_request_builder();
2912 /// let response = builder.send().await?;
2913 /// # Ok(()) }
2914 ///
2915 /// fn prepare_request_builder() -> DeleteWorkspace {
2916 /// # panic!();
2917 /// // ... details omitted ...
2918 /// }
2919 /// ```
2920 #[derive(Clone, Debug)]
2921 pub struct DeleteWorkspace(RequestBuilder<crate::model::DeleteWorkspaceRequest>);
2922
2923 impl DeleteWorkspace {
2924 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2925 Self(RequestBuilder::new(stub))
2926 }
2927
2928 /// Sets the full request, replacing any prior values.
2929 pub fn with_request<V: Into<crate::model::DeleteWorkspaceRequest>>(mut self, v: V) -> Self {
2930 self.0.request = v.into();
2931 self
2932 }
2933
2934 /// Sets all the options, replacing any prior values.
2935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2936 self.0.options = v.into();
2937 self
2938 }
2939
2940 /// Sends the request.
2941 pub async fn send(self) -> Result<()> {
2942 (*self.0.stub)
2943 .delete_workspace(self.0.request, self.0.options)
2944 .await
2945 .map(crate::Response::into_body)
2946 }
2947
2948 /// Sets the value of [name][crate::model::DeleteWorkspaceRequest::name].
2949 ///
2950 /// This is a **required** field for requests.
2951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2952 self.0.request.name = v.into();
2953 self
2954 }
2955 }
2956
2957 #[doc(hidden)]
2958 impl crate::RequestBuilder for DeleteWorkspace {
2959 fn request_options(&mut self) -> &mut crate::RequestOptions {
2960 &mut self.0.options
2961 }
2962 }
2963
2964 /// The request builder for [Dataform::install_npm_packages][crate::client::Dataform::install_npm_packages] calls.
2965 ///
2966 /// # Example
2967 /// ```
2968 /// # use google_cloud_dataform_v1::builder::dataform::InstallNpmPackages;
2969 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2970 ///
2971 /// let builder = prepare_request_builder();
2972 /// let response = builder.send().await?;
2973 /// # Ok(()) }
2974 ///
2975 /// fn prepare_request_builder() -> InstallNpmPackages {
2976 /// # panic!();
2977 /// // ... details omitted ...
2978 /// }
2979 /// ```
2980 #[derive(Clone, Debug)]
2981 pub struct InstallNpmPackages(RequestBuilder<crate::model::InstallNpmPackagesRequest>);
2982
2983 impl InstallNpmPackages {
2984 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2985 Self(RequestBuilder::new(stub))
2986 }
2987
2988 /// Sets the full request, replacing any prior values.
2989 pub fn with_request<V: Into<crate::model::InstallNpmPackagesRequest>>(
2990 mut self,
2991 v: V,
2992 ) -> Self {
2993 self.0.request = v.into();
2994 self
2995 }
2996
2997 /// Sets all the options, replacing any prior values.
2998 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2999 self.0.options = v.into();
3000 self
3001 }
3002
3003 /// Sends the request.
3004 pub async fn send(self) -> Result<crate::model::InstallNpmPackagesResponse> {
3005 (*self.0.stub)
3006 .install_npm_packages(self.0.request, self.0.options)
3007 .await
3008 .map(crate::Response::into_body)
3009 }
3010
3011 /// Sets the value of [workspace][crate::model::InstallNpmPackagesRequest::workspace].
3012 ///
3013 /// This is a **required** field for requests.
3014 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3015 self.0.request.workspace = v.into();
3016 self
3017 }
3018 }
3019
3020 #[doc(hidden)]
3021 impl crate::RequestBuilder for InstallNpmPackages {
3022 fn request_options(&mut self) -> &mut crate::RequestOptions {
3023 &mut self.0.options
3024 }
3025 }
3026
3027 /// The request builder for [Dataform::pull_git_commits][crate::client::Dataform::pull_git_commits] calls.
3028 ///
3029 /// # Example
3030 /// ```
3031 /// # use google_cloud_dataform_v1::builder::dataform::PullGitCommits;
3032 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3033 ///
3034 /// let builder = prepare_request_builder();
3035 /// let response = builder.send().await?;
3036 /// # Ok(()) }
3037 ///
3038 /// fn prepare_request_builder() -> PullGitCommits {
3039 /// # panic!();
3040 /// // ... details omitted ...
3041 /// }
3042 /// ```
3043 #[derive(Clone, Debug)]
3044 pub struct PullGitCommits(RequestBuilder<crate::model::PullGitCommitsRequest>);
3045
3046 impl PullGitCommits {
3047 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3048 Self(RequestBuilder::new(stub))
3049 }
3050
3051 /// Sets the full request, replacing any prior values.
3052 pub fn with_request<V: Into<crate::model::PullGitCommitsRequest>>(mut self, v: V) -> Self {
3053 self.0.request = v.into();
3054 self
3055 }
3056
3057 /// Sets all the options, replacing any prior values.
3058 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3059 self.0.options = v.into();
3060 self
3061 }
3062
3063 /// Sends the request.
3064 pub async fn send(self) -> Result<crate::model::PullGitCommitsResponse> {
3065 (*self.0.stub)
3066 .pull_git_commits(self.0.request, self.0.options)
3067 .await
3068 .map(crate::Response::into_body)
3069 }
3070
3071 /// Sets the value of [name][crate::model::PullGitCommitsRequest::name].
3072 ///
3073 /// This is a **required** field for requests.
3074 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3075 self.0.request.name = v.into();
3076 self
3077 }
3078
3079 /// Sets the value of [remote_branch][crate::model::PullGitCommitsRequest::remote_branch].
3080 pub fn set_remote_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
3081 self.0.request.remote_branch = v.into();
3082 self
3083 }
3084
3085 /// Sets the value of [author][crate::model::PullGitCommitsRequest::author].
3086 ///
3087 /// This is a **required** field for requests.
3088 pub fn set_author<T>(mut self, v: T) -> Self
3089 where
3090 T: std::convert::Into<crate::model::CommitAuthor>,
3091 {
3092 self.0.request.author = std::option::Option::Some(v.into());
3093 self
3094 }
3095
3096 /// Sets or clears the value of [author][crate::model::PullGitCommitsRequest::author].
3097 ///
3098 /// This is a **required** field for requests.
3099 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
3100 where
3101 T: std::convert::Into<crate::model::CommitAuthor>,
3102 {
3103 self.0.request.author = v.map(|x| x.into());
3104 self
3105 }
3106 }
3107
3108 #[doc(hidden)]
3109 impl crate::RequestBuilder for PullGitCommits {
3110 fn request_options(&mut self) -> &mut crate::RequestOptions {
3111 &mut self.0.options
3112 }
3113 }
3114
3115 /// The request builder for [Dataform::push_git_commits][crate::client::Dataform::push_git_commits] calls.
3116 ///
3117 /// # Example
3118 /// ```
3119 /// # use google_cloud_dataform_v1::builder::dataform::PushGitCommits;
3120 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3121 ///
3122 /// let builder = prepare_request_builder();
3123 /// let response = builder.send().await?;
3124 /// # Ok(()) }
3125 ///
3126 /// fn prepare_request_builder() -> PushGitCommits {
3127 /// # panic!();
3128 /// // ... details omitted ...
3129 /// }
3130 /// ```
3131 #[derive(Clone, Debug)]
3132 pub struct PushGitCommits(RequestBuilder<crate::model::PushGitCommitsRequest>);
3133
3134 impl PushGitCommits {
3135 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3136 Self(RequestBuilder::new(stub))
3137 }
3138
3139 /// Sets the full request, replacing any prior values.
3140 pub fn with_request<V: Into<crate::model::PushGitCommitsRequest>>(mut self, v: V) -> Self {
3141 self.0.request = v.into();
3142 self
3143 }
3144
3145 /// Sets all the options, replacing any prior values.
3146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3147 self.0.options = v.into();
3148 self
3149 }
3150
3151 /// Sends the request.
3152 pub async fn send(self) -> Result<crate::model::PushGitCommitsResponse> {
3153 (*self.0.stub)
3154 .push_git_commits(self.0.request, self.0.options)
3155 .await
3156 .map(crate::Response::into_body)
3157 }
3158
3159 /// Sets the value of [name][crate::model::PushGitCommitsRequest::name].
3160 ///
3161 /// This is a **required** field for requests.
3162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3163 self.0.request.name = v.into();
3164 self
3165 }
3166
3167 /// Sets the value of [remote_branch][crate::model::PushGitCommitsRequest::remote_branch].
3168 pub fn set_remote_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
3169 self.0.request.remote_branch = v.into();
3170 self
3171 }
3172 }
3173
3174 #[doc(hidden)]
3175 impl crate::RequestBuilder for PushGitCommits {
3176 fn request_options(&mut self) -> &mut crate::RequestOptions {
3177 &mut self.0.options
3178 }
3179 }
3180
3181 /// The request builder for [Dataform::fetch_file_git_statuses][crate::client::Dataform::fetch_file_git_statuses] calls.
3182 ///
3183 /// # Example
3184 /// ```
3185 /// # use google_cloud_dataform_v1::builder::dataform::FetchFileGitStatuses;
3186 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3187 ///
3188 /// let builder = prepare_request_builder();
3189 /// let response = builder.send().await?;
3190 /// # Ok(()) }
3191 ///
3192 /// fn prepare_request_builder() -> FetchFileGitStatuses {
3193 /// # panic!();
3194 /// // ... details omitted ...
3195 /// }
3196 /// ```
3197 #[derive(Clone, Debug)]
3198 pub struct FetchFileGitStatuses(RequestBuilder<crate::model::FetchFileGitStatusesRequest>);
3199
3200 impl FetchFileGitStatuses {
3201 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3202 Self(RequestBuilder::new(stub))
3203 }
3204
3205 /// Sets the full request, replacing any prior values.
3206 pub fn with_request<V: Into<crate::model::FetchFileGitStatusesRequest>>(
3207 mut self,
3208 v: V,
3209 ) -> Self {
3210 self.0.request = v.into();
3211 self
3212 }
3213
3214 /// Sets all the options, replacing any prior values.
3215 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216 self.0.options = v.into();
3217 self
3218 }
3219
3220 /// Sends the request.
3221 pub async fn send(self) -> Result<crate::model::FetchFileGitStatusesResponse> {
3222 (*self.0.stub)
3223 .fetch_file_git_statuses(self.0.request, self.0.options)
3224 .await
3225 .map(crate::Response::into_body)
3226 }
3227
3228 /// Sets the value of [name][crate::model::FetchFileGitStatusesRequest::name].
3229 ///
3230 /// This is a **required** field for requests.
3231 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3232 self.0.request.name = v.into();
3233 self
3234 }
3235 }
3236
3237 #[doc(hidden)]
3238 impl crate::RequestBuilder for FetchFileGitStatuses {
3239 fn request_options(&mut self) -> &mut crate::RequestOptions {
3240 &mut self.0.options
3241 }
3242 }
3243
3244 /// The request builder for [Dataform::fetch_git_ahead_behind][crate::client::Dataform::fetch_git_ahead_behind] calls.
3245 ///
3246 /// # Example
3247 /// ```
3248 /// # use google_cloud_dataform_v1::builder::dataform::FetchGitAheadBehind;
3249 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3250 ///
3251 /// let builder = prepare_request_builder();
3252 /// let response = builder.send().await?;
3253 /// # Ok(()) }
3254 ///
3255 /// fn prepare_request_builder() -> FetchGitAheadBehind {
3256 /// # panic!();
3257 /// // ... details omitted ...
3258 /// }
3259 /// ```
3260 #[derive(Clone, Debug)]
3261 pub struct FetchGitAheadBehind(RequestBuilder<crate::model::FetchGitAheadBehindRequest>);
3262
3263 impl FetchGitAheadBehind {
3264 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3265 Self(RequestBuilder::new(stub))
3266 }
3267
3268 /// Sets the full request, replacing any prior values.
3269 pub fn with_request<V: Into<crate::model::FetchGitAheadBehindRequest>>(
3270 mut self,
3271 v: V,
3272 ) -> Self {
3273 self.0.request = v.into();
3274 self
3275 }
3276
3277 /// Sets all the options, replacing any prior values.
3278 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3279 self.0.options = v.into();
3280 self
3281 }
3282
3283 /// Sends the request.
3284 pub async fn send(self) -> Result<crate::model::FetchGitAheadBehindResponse> {
3285 (*self.0.stub)
3286 .fetch_git_ahead_behind(self.0.request, self.0.options)
3287 .await
3288 .map(crate::Response::into_body)
3289 }
3290
3291 /// Sets the value of [name][crate::model::FetchGitAheadBehindRequest::name].
3292 ///
3293 /// This is a **required** field for requests.
3294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3295 self.0.request.name = v.into();
3296 self
3297 }
3298
3299 /// Sets the value of [remote_branch][crate::model::FetchGitAheadBehindRequest::remote_branch].
3300 pub fn set_remote_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
3301 self.0.request.remote_branch = v.into();
3302 self
3303 }
3304 }
3305
3306 #[doc(hidden)]
3307 impl crate::RequestBuilder for FetchGitAheadBehind {
3308 fn request_options(&mut self) -> &mut crate::RequestOptions {
3309 &mut self.0.options
3310 }
3311 }
3312
3313 /// The request builder for [Dataform::commit_workspace_changes][crate::client::Dataform::commit_workspace_changes] calls.
3314 ///
3315 /// # Example
3316 /// ```
3317 /// # use google_cloud_dataform_v1::builder::dataform::CommitWorkspaceChanges;
3318 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3319 ///
3320 /// let builder = prepare_request_builder();
3321 /// let response = builder.send().await?;
3322 /// # Ok(()) }
3323 ///
3324 /// fn prepare_request_builder() -> CommitWorkspaceChanges {
3325 /// # panic!();
3326 /// // ... details omitted ...
3327 /// }
3328 /// ```
3329 #[derive(Clone, Debug)]
3330 pub struct CommitWorkspaceChanges(RequestBuilder<crate::model::CommitWorkspaceChangesRequest>);
3331
3332 impl CommitWorkspaceChanges {
3333 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3334 Self(RequestBuilder::new(stub))
3335 }
3336
3337 /// Sets the full request, replacing any prior values.
3338 pub fn with_request<V: Into<crate::model::CommitWorkspaceChangesRequest>>(
3339 mut self,
3340 v: V,
3341 ) -> Self {
3342 self.0.request = v.into();
3343 self
3344 }
3345
3346 /// Sets all the options, replacing any prior values.
3347 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3348 self.0.options = v.into();
3349 self
3350 }
3351
3352 /// Sends the request.
3353 pub async fn send(self) -> Result<crate::model::CommitWorkspaceChangesResponse> {
3354 (*self.0.stub)
3355 .commit_workspace_changes(self.0.request, self.0.options)
3356 .await
3357 .map(crate::Response::into_body)
3358 }
3359
3360 /// Sets the value of [name][crate::model::CommitWorkspaceChangesRequest::name].
3361 ///
3362 /// This is a **required** field for requests.
3363 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3364 self.0.request.name = v.into();
3365 self
3366 }
3367
3368 /// Sets the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
3369 ///
3370 /// This is a **required** field for requests.
3371 pub fn set_author<T>(mut self, v: T) -> Self
3372 where
3373 T: std::convert::Into<crate::model::CommitAuthor>,
3374 {
3375 self.0.request.author = std::option::Option::Some(v.into());
3376 self
3377 }
3378
3379 /// Sets or clears the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
3380 ///
3381 /// This is a **required** field for requests.
3382 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
3383 where
3384 T: std::convert::Into<crate::model::CommitAuthor>,
3385 {
3386 self.0.request.author = v.map(|x| x.into());
3387 self
3388 }
3389
3390 /// Sets the value of [commit_message][crate::model::CommitWorkspaceChangesRequest::commit_message].
3391 pub fn set_commit_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3392 self.0.request.commit_message = v.into();
3393 self
3394 }
3395
3396 /// Sets the value of [paths][crate::model::CommitWorkspaceChangesRequest::paths].
3397 pub fn set_paths<T, V>(mut self, v: T) -> Self
3398 where
3399 T: std::iter::IntoIterator<Item = V>,
3400 V: std::convert::Into<std::string::String>,
3401 {
3402 use std::iter::Iterator;
3403 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
3404 self
3405 }
3406 }
3407
3408 #[doc(hidden)]
3409 impl crate::RequestBuilder for CommitWorkspaceChanges {
3410 fn request_options(&mut self) -> &mut crate::RequestOptions {
3411 &mut self.0.options
3412 }
3413 }
3414
3415 /// The request builder for [Dataform::reset_workspace_changes][crate::client::Dataform::reset_workspace_changes] calls.
3416 ///
3417 /// # Example
3418 /// ```
3419 /// # use google_cloud_dataform_v1::builder::dataform::ResetWorkspaceChanges;
3420 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3421 ///
3422 /// let builder = prepare_request_builder();
3423 /// let response = builder.send().await?;
3424 /// # Ok(()) }
3425 ///
3426 /// fn prepare_request_builder() -> ResetWorkspaceChanges {
3427 /// # panic!();
3428 /// // ... details omitted ...
3429 /// }
3430 /// ```
3431 #[derive(Clone, Debug)]
3432 pub struct ResetWorkspaceChanges(RequestBuilder<crate::model::ResetWorkspaceChangesRequest>);
3433
3434 impl ResetWorkspaceChanges {
3435 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3436 Self(RequestBuilder::new(stub))
3437 }
3438
3439 /// Sets the full request, replacing any prior values.
3440 pub fn with_request<V: Into<crate::model::ResetWorkspaceChangesRequest>>(
3441 mut self,
3442 v: V,
3443 ) -> Self {
3444 self.0.request = v.into();
3445 self
3446 }
3447
3448 /// Sets all the options, replacing any prior values.
3449 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3450 self.0.options = v.into();
3451 self
3452 }
3453
3454 /// Sends the request.
3455 pub async fn send(self) -> Result<crate::model::ResetWorkspaceChangesResponse> {
3456 (*self.0.stub)
3457 .reset_workspace_changes(self.0.request, self.0.options)
3458 .await
3459 .map(crate::Response::into_body)
3460 }
3461
3462 /// Sets the value of [name][crate::model::ResetWorkspaceChangesRequest::name].
3463 ///
3464 /// This is a **required** field for requests.
3465 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.name = v.into();
3467 self
3468 }
3469
3470 /// Sets the value of [paths][crate::model::ResetWorkspaceChangesRequest::paths].
3471 pub fn set_paths<T, V>(mut self, v: T) -> Self
3472 where
3473 T: std::iter::IntoIterator<Item = V>,
3474 V: std::convert::Into<std::string::String>,
3475 {
3476 use std::iter::Iterator;
3477 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
3478 self
3479 }
3480
3481 /// Sets the value of [clean][crate::model::ResetWorkspaceChangesRequest::clean].
3482 pub fn set_clean<T: Into<bool>>(mut self, v: T) -> Self {
3483 self.0.request.clean = v.into();
3484 self
3485 }
3486 }
3487
3488 #[doc(hidden)]
3489 impl crate::RequestBuilder for ResetWorkspaceChanges {
3490 fn request_options(&mut self) -> &mut crate::RequestOptions {
3491 &mut self.0.options
3492 }
3493 }
3494
3495 /// The request builder for [Dataform::fetch_file_diff][crate::client::Dataform::fetch_file_diff] calls.
3496 ///
3497 /// # Example
3498 /// ```
3499 /// # use google_cloud_dataform_v1::builder::dataform::FetchFileDiff;
3500 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3501 ///
3502 /// let builder = prepare_request_builder();
3503 /// let response = builder.send().await?;
3504 /// # Ok(()) }
3505 ///
3506 /// fn prepare_request_builder() -> FetchFileDiff {
3507 /// # panic!();
3508 /// // ... details omitted ...
3509 /// }
3510 /// ```
3511 #[derive(Clone, Debug)]
3512 pub struct FetchFileDiff(RequestBuilder<crate::model::FetchFileDiffRequest>);
3513
3514 impl FetchFileDiff {
3515 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3516 Self(RequestBuilder::new(stub))
3517 }
3518
3519 /// Sets the full request, replacing any prior values.
3520 pub fn with_request<V: Into<crate::model::FetchFileDiffRequest>>(mut self, v: V) -> Self {
3521 self.0.request = v.into();
3522 self
3523 }
3524
3525 /// Sets all the options, replacing any prior values.
3526 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3527 self.0.options = v.into();
3528 self
3529 }
3530
3531 /// Sends the request.
3532 pub async fn send(self) -> Result<crate::model::FetchFileDiffResponse> {
3533 (*self.0.stub)
3534 .fetch_file_diff(self.0.request, self.0.options)
3535 .await
3536 .map(crate::Response::into_body)
3537 }
3538
3539 /// Sets the value of [workspace][crate::model::FetchFileDiffRequest::workspace].
3540 ///
3541 /// This is a **required** field for requests.
3542 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3543 self.0.request.workspace = v.into();
3544 self
3545 }
3546
3547 /// Sets the value of [path][crate::model::FetchFileDiffRequest::path].
3548 ///
3549 /// This is a **required** field for requests.
3550 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
3551 self.0.request.path = v.into();
3552 self
3553 }
3554 }
3555
3556 #[doc(hidden)]
3557 impl crate::RequestBuilder for FetchFileDiff {
3558 fn request_options(&mut self) -> &mut crate::RequestOptions {
3559 &mut self.0.options
3560 }
3561 }
3562
3563 /// The request builder for [Dataform::query_directory_contents][crate::client::Dataform::query_directory_contents] calls.
3564 ///
3565 /// # Example
3566 /// ```
3567 /// # use google_cloud_dataform_v1::builder::dataform::QueryDirectoryContents;
3568 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3569 /// use google_cloud_gax::paginator::ItemPaginator;
3570 ///
3571 /// let builder = prepare_request_builder();
3572 /// let mut items = builder.by_item();
3573 /// while let Some(result) = items.next().await {
3574 /// let item = result?;
3575 /// }
3576 /// # Ok(()) }
3577 ///
3578 /// fn prepare_request_builder() -> QueryDirectoryContents {
3579 /// # panic!();
3580 /// // ... details omitted ...
3581 /// }
3582 /// ```
3583 #[derive(Clone, Debug)]
3584 pub struct QueryDirectoryContents(RequestBuilder<crate::model::QueryDirectoryContentsRequest>);
3585
3586 impl QueryDirectoryContents {
3587 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3588 Self(RequestBuilder::new(stub))
3589 }
3590
3591 /// Sets the full request, replacing any prior values.
3592 pub fn with_request<V: Into<crate::model::QueryDirectoryContentsRequest>>(
3593 mut self,
3594 v: V,
3595 ) -> Self {
3596 self.0.request = v.into();
3597 self
3598 }
3599
3600 /// Sets all the options, replacing any prior values.
3601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3602 self.0.options = v.into();
3603 self
3604 }
3605
3606 /// Sends the request.
3607 pub async fn send(self) -> Result<crate::model::QueryDirectoryContentsResponse> {
3608 (*self.0.stub)
3609 .query_directory_contents(self.0.request, self.0.options)
3610 .await
3611 .map(crate::Response::into_body)
3612 }
3613
3614 /// Streams each page in the collection.
3615 pub fn by_page(
3616 self,
3617 ) -> impl google_cloud_gax::paginator::Paginator<
3618 crate::model::QueryDirectoryContentsResponse,
3619 crate::Error,
3620 > {
3621 use std::clone::Clone;
3622 let token = self.0.request.page_token.clone();
3623 let execute = move |token: String| {
3624 let mut builder = self.clone();
3625 builder.0.request = builder.0.request.set_page_token(token);
3626 builder.send()
3627 };
3628 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3629 }
3630
3631 /// Streams each item in the collection.
3632 pub fn by_item(
3633 self,
3634 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3635 crate::model::QueryDirectoryContentsResponse,
3636 crate::Error,
3637 > {
3638 use google_cloud_gax::paginator::Paginator;
3639 self.by_page().items()
3640 }
3641
3642 /// Sets the value of [workspace][crate::model::QueryDirectoryContentsRequest::workspace].
3643 ///
3644 /// This is a **required** field for requests.
3645 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3646 self.0.request.workspace = v.into();
3647 self
3648 }
3649
3650 /// Sets the value of [path][crate::model::QueryDirectoryContentsRequest::path].
3651 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
3652 self.0.request.path = v.into();
3653 self
3654 }
3655
3656 /// Sets the value of [page_size][crate::model::QueryDirectoryContentsRequest::page_size].
3657 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3658 self.0.request.page_size = v.into();
3659 self
3660 }
3661
3662 /// Sets the value of [page_token][crate::model::QueryDirectoryContentsRequest::page_token].
3663 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3664 self.0.request.page_token = v.into();
3665 self
3666 }
3667
3668 /// Sets the value of [view][crate::model::QueryDirectoryContentsRequest::view].
3669 pub fn set_view<T: Into<crate::model::DirectoryContentsView>>(mut self, v: T) -> Self {
3670 self.0.request.view = v.into();
3671 self
3672 }
3673 }
3674
3675 #[doc(hidden)]
3676 impl crate::RequestBuilder for QueryDirectoryContents {
3677 fn request_options(&mut self) -> &mut crate::RequestOptions {
3678 &mut self.0.options
3679 }
3680 }
3681
3682 /// The request builder for [Dataform::search_files][crate::client::Dataform::search_files] calls.
3683 ///
3684 /// # Example
3685 /// ```
3686 /// # use google_cloud_dataform_v1::builder::dataform::SearchFiles;
3687 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3688 /// use google_cloud_gax::paginator::ItemPaginator;
3689 ///
3690 /// let builder = prepare_request_builder();
3691 /// let mut items = builder.by_item();
3692 /// while let Some(result) = items.next().await {
3693 /// let item = result?;
3694 /// }
3695 /// # Ok(()) }
3696 ///
3697 /// fn prepare_request_builder() -> SearchFiles {
3698 /// # panic!();
3699 /// // ... details omitted ...
3700 /// }
3701 /// ```
3702 #[derive(Clone, Debug)]
3703 pub struct SearchFiles(RequestBuilder<crate::model::SearchFilesRequest>);
3704
3705 impl SearchFiles {
3706 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3707 Self(RequestBuilder::new(stub))
3708 }
3709
3710 /// Sets the full request, replacing any prior values.
3711 pub fn with_request<V: Into<crate::model::SearchFilesRequest>>(mut self, v: V) -> Self {
3712 self.0.request = v.into();
3713 self
3714 }
3715
3716 /// Sets all the options, replacing any prior values.
3717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3718 self.0.options = v.into();
3719 self
3720 }
3721
3722 /// Sends the request.
3723 pub async fn send(self) -> Result<crate::model::SearchFilesResponse> {
3724 (*self.0.stub)
3725 .search_files(self.0.request, self.0.options)
3726 .await
3727 .map(crate::Response::into_body)
3728 }
3729
3730 /// Streams each page in the collection.
3731 pub fn by_page(
3732 self,
3733 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchFilesResponse, crate::Error>
3734 {
3735 use std::clone::Clone;
3736 let token = self.0.request.page_token.clone();
3737 let execute = move |token: String| {
3738 let mut builder = self.clone();
3739 builder.0.request = builder.0.request.set_page_token(token);
3740 builder.send()
3741 };
3742 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3743 }
3744
3745 /// Streams each item in the collection.
3746 pub fn by_item(
3747 self,
3748 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3749 crate::model::SearchFilesResponse,
3750 crate::Error,
3751 > {
3752 use google_cloud_gax::paginator::Paginator;
3753 self.by_page().items()
3754 }
3755
3756 /// Sets the value of [workspace][crate::model::SearchFilesRequest::workspace].
3757 ///
3758 /// This is a **required** field for requests.
3759 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3760 self.0.request.workspace = v.into();
3761 self
3762 }
3763
3764 /// Sets the value of [page_size][crate::model::SearchFilesRequest::page_size].
3765 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3766 self.0.request.page_size = v.into();
3767 self
3768 }
3769
3770 /// Sets the value of [page_token][crate::model::SearchFilesRequest::page_token].
3771 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3772 self.0.request.page_token = v.into();
3773 self
3774 }
3775
3776 /// Sets the value of [filter][crate::model::SearchFilesRequest::filter].
3777 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3778 self.0.request.filter = v.into();
3779 self
3780 }
3781 }
3782
3783 #[doc(hidden)]
3784 impl crate::RequestBuilder for SearchFiles {
3785 fn request_options(&mut self) -> &mut crate::RequestOptions {
3786 &mut self.0.options
3787 }
3788 }
3789
3790 /// The request builder for [Dataform::make_directory][crate::client::Dataform::make_directory] calls.
3791 ///
3792 /// # Example
3793 /// ```
3794 /// # use google_cloud_dataform_v1::builder::dataform::MakeDirectory;
3795 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3796 ///
3797 /// let builder = prepare_request_builder();
3798 /// let response = builder.send().await?;
3799 /// # Ok(()) }
3800 ///
3801 /// fn prepare_request_builder() -> MakeDirectory {
3802 /// # panic!();
3803 /// // ... details omitted ...
3804 /// }
3805 /// ```
3806 #[derive(Clone, Debug)]
3807 pub struct MakeDirectory(RequestBuilder<crate::model::MakeDirectoryRequest>);
3808
3809 impl MakeDirectory {
3810 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3811 Self(RequestBuilder::new(stub))
3812 }
3813
3814 /// Sets the full request, replacing any prior values.
3815 pub fn with_request<V: Into<crate::model::MakeDirectoryRequest>>(mut self, v: V) -> Self {
3816 self.0.request = v.into();
3817 self
3818 }
3819
3820 /// Sets all the options, replacing any prior values.
3821 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3822 self.0.options = v.into();
3823 self
3824 }
3825
3826 /// Sends the request.
3827 pub async fn send(self) -> Result<crate::model::MakeDirectoryResponse> {
3828 (*self.0.stub)
3829 .make_directory(self.0.request, self.0.options)
3830 .await
3831 .map(crate::Response::into_body)
3832 }
3833
3834 /// Sets the value of [workspace][crate::model::MakeDirectoryRequest::workspace].
3835 ///
3836 /// This is a **required** field for requests.
3837 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3838 self.0.request.workspace = v.into();
3839 self
3840 }
3841
3842 /// Sets the value of [path][crate::model::MakeDirectoryRequest::path].
3843 ///
3844 /// This is a **required** field for requests.
3845 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
3846 self.0.request.path = v.into();
3847 self
3848 }
3849 }
3850
3851 #[doc(hidden)]
3852 impl crate::RequestBuilder for MakeDirectory {
3853 fn request_options(&mut self) -> &mut crate::RequestOptions {
3854 &mut self.0.options
3855 }
3856 }
3857
3858 /// The request builder for [Dataform::remove_directory][crate::client::Dataform::remove_directory] calls.
3859 ///
3860 /// # Example
3861 /// ```
3862 /// # use google_cloud_dataform_v1::builder::dataform::RemoveDirectory;
3863 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3864 ///
3865 /// let builder = prepare_request_builder();
3866 /// let response = builder.send().await?;
3867 /// # Ok(()) }
3868 ///
3869 /// fn prepare_request_builder() -> RemoveDirectory {
3870 /// # panic!();
3871 /// // ... details omitted ...
3872 /// }
3873 /// ```
3874 #[derive(Clone, Debug)]
3875 pub struct RemoveDirectory(RequestBuilder<crate::model::RemoveDirectoryRequest>);
3876
3877 impl RemoveDirectory {
3878 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3879 Self(RequestBuilder::new(stub))
3880 }
3881
3882 /// Sets the full request, replacing any prior values.
3883 pub fn with_request<V: Into<crate::model::RemoveDirectoryRequest>>(mut self, v: V) -> Self {
3884 self.0.request = v.into();
3885 self
3886 }
3887
3888 /// Sets all the options, replacing any prior values.
3889 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3890 self.0.options = v.into();
3891 self
3892 }
3893
3894 /// Sends the request.
3895 pub async fn send(self) -> Result<crate::model::RemoveDirectoryResponse> {
3896 (*self.0.stub)
3897 .remove_directory(self.0.request, self.0.options)
3898 .await
3899 .map(crate::Response::into_body)
3900 }
3901
3902 /// Sets the value of [workspace][crate::model::RemoveDirectoryRequest::workspace].
3903 ///
3904 /// This is a **required** field for requests.
3905 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3906 self.0.request.workspace = v.into();
3907 self
3908 }
3909
3910 /// Sets the value of [path][crate::model::RemoveDirectoryRequest::path].
3911 ///
3912 /// This is a **required** field for requests.
3913 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
3914 self.0.request.path = v.into();
3915 self
3916 }
3917 }
3918
3919 #[doc(hidden)]
3920 impl crate::RequestBuilder for RemoveDirectory {
3921 fn request_options(&mut self) -> &mut crate::RequestOptions {
3922 &mut self.0.options
3923 }
3924 }
3925
3926 /// The request builder for [Dataform::move_directory][crate::client::Dataform::move_directory] calls.
3927 ///
3928 /// # Example
3929 /// ```
3930 /// # use google_cloud_dataform_v1::builder::dataform::MoveDirectory;
3931 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3932 ///
3933 /// let builder = prepare_request_builder();
3934 /// let response = builder.send().await?;
3935 /// # Ok(()) }
3936 ///
3937 /// fn prepare_request_builder() -> MoveDirectory {
3938 /// # panic!();
3939 /// // ... details omitted ...
3940 /// }
3941 /// ```
3942 #[derive(Clone, Debug)]
3943 pub struct MoveDirectory(RequestBuilder<crate::model::MoveDirectoryRequest>);
3944
3945 impl MoveDirectory {
3946 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3947 Self(RequestBuilder::new(stub))
3948 }
3949
3950 /// Sets the full request, replacing any prior values.
3951 pub fn with_request<V: Into<crate::model::MoveDirectoryRequest>>(mut self, v: V) -> Self {
3952 self.0.request = v.into();
3953 self
3954 }
3955
3956 /// Sets all the options, replacing any prior values.
3957 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3958 self.0.options = v.into();
3959 self
3960 }
3961
3962 /// Sends the request.
3963 pub async fn send(self) -> Result<crate::model::MoveDirectoryResponse> {
3964 (*self.0.stub)
3965 .move_directory(self.0.request, self.0.options)
3966 .await
3967 .map(crate::Response::into_body)
3968 }
3969
3970 /// Sets the value of [workspace][crate::model::MoveDirectoryRequest::workspace].
3971 ///
3972 /// This is a **required** field for requests.
3973 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
3974 self.0.request.workspace = v.into();
3975 self
3976 }
3977
3978 /// Sets the value of [path][crate::model::MoveDirectoryRequest::path].
3979 ///
3980 /// This is a **required** field for requests.
3981 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
3982 self.0.request.path = v.into();
3983 self
3984 }
3985
3986 /// Sets the value of [new_path][crate::model::MoveDirectoryRequest::new_path].
3987 ///
3988 /// This is a **required** field for requests.
3989 pub fn set_new_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
3990 self.0.request.new_path = v.into();
3991 self
3992 }
3993 }
3994
3995 #[doc(hidden)]
3996 impl crate::RequestBuilder for MoveDirectory {
3997 fn request_options(&mut self) -> &mut crate::RequestOptions {
3998 &mut self.0.options
3999 }
4000 }
4001
4002 /// The request builder for [Dataform::read_file][crate::client::Dataform::read_file] calls.
4003 ///
4004 /// # Example
4005 /// ```
4006 /// # use google_cloud_dataform_v1::builder::dataform::ReadFile;
4007 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4008 ///
4009 /// let builder = prepare_request_builder();
4010 /// let response = builder.send().await?;
4011 /// # Ok(()) }
4012 ///
4013 /// fn prepare_request_builder() -> ReadFile {
4014 /// # panic!();
4015 /// // ... details omitted ...
4016 /// }
4017 /// ```
4018 #[derive(Clone, Debug)]
4019 pub struct ReadFile(RequestBuilder<crate::model::ReadFileRequest>);
4020
4021 impl ReadFile {
4022 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4023 Self(RequestBuilder::new(stub))
4024 }
4025
4026 /// Sets the full request, replacing any prior values.
4027 pub fn with_request<V: Into<crate::model::ReadFileRequest>>(mut self, v: V) -> Self {
4028 self.0.request = v.into();
4029 self
4030 }
4031
4032 /// Sets all the options, replacing any prior values.
4033 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4034 self.0.options = v.into();
4035 self
4036 }
4037
4038 /// Sends the request.
4039 pub async fn send(self) -> Result<crate::model::ReadFileResponse> {
4040 (*self.0.stub)
4041 .read_file(self.0.request, self.0.options)
4042 .await
4043 .map(crate::Response::into_body)
4044 }
4045
4046 /// Sets the value of [workspace][crate::model::ReadFileRequest::workspace].
4047 ///
4048 /// This is a **required** field for requests.
4049 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4050 self.0.request.workspace = v.into();
4051 self
4052 }
4053
4054 /// Sets the value of [path][crate::model::ReadFileRequest::path].
4055 ///
4056 /// This is a **required** field for requests.
4057 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
4058 self.0.request.path = v.into();
4059 self
4060 }
4061
4062 /// Sets the value of [revision][crate::model::ReadFileRequest::revision].
4063 pub fn set_revision<T: Into<std::string::String>>(mut self, v: T) -> Self {
4064 self.0.request.revision = v.into();
4065 self
4066 }
4067 }
4068
4069 #[doc(hidden)]
4070 impl crate::RequestBuilder for ReadFile {
4071 fn request_options(&mut self) -> &mut crate::RequestOptions {
4072 &mut self.0.options
4073 }
4074 }
4075
4076 /// The request builder for [Dataform::remove_file][crate::client::Dataform::remove_file] calls.
4077 ///
4078 /// # Example
4079 /// ```
4080 /// # use google_cloud_dataform_v1::builder::dataform::RemoveFile;
4081 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4082 ///
4083 /// let builder = prepare_request_builder();
4084 /// let response = builder.send().await?;
4085 /// # Ok(()) }
4086 ///
4087 /// fn prepare_request_builder() -> RemoveFile {
4088 /// # panic!();
4089 /// // ... details omitted ...
4090 /// }
4091 /// ```
4092 #[derive(Clone, Debug)]
4093 pub struct RemoveFile(RequestBuilder<crate::model::RemoveFileRequest>);
4094
4095 impl RemoveFile {
4096 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4097 Self(RequestBuilder::new(stub))
4098 }
4099
4100 /// Sets the full request, replacing any prior values.
4101 pub fn with_request<V: Into<crate::model::RemoveFileRequest>>(mut self, v: V) -> Self {
4102 self.0.request = v.into();
4103 self
4104 }
4105
4106 /// Sets all the options, replacing any prior values.
4107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4108 self.0.options = v.into();
4109 self
4110 }
4111
4112 /// Sends the request.
4113 pub async fn send(self) -> Result<crate::model::RemoveFileResponse> {
4114 (*self.0.stub)
4115 .remove_file(self.0.request, self.0.options)
4116 .await
4117 .map(crate::Response::into_body)
4118 }
4119
4120 /// Sets the value of [workspace][crate::model::RemoveFileRequest::workspace].
4121 ///
4122 /// This is a **required** field for requests.
4123 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4124 self.0.request.workspace = v.into();
4125 self
4126 }
4127
4128 /// Sets the value of [path][crate::model::RemoveFileRequest::path].
4129 ///
4130 /// This is a **required** field for requests.
4131 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
4132 self.0.request.path = v.into();
4133 self
4134 }
4135 }
4136
4137 #[doc(hidden)]
4138 impl crate::RequestBuilder for RemoveFile {
4139 fn request_options(&mut self) -> &mut crate::RequestOptions {
4140 &mut self.0.options
4141 }
4142 }
4143
4144 /// The request builder for [Dataform::move_file][crate::client::Dataform::move_file] calls.
4145 ///
4146 /// # Example
4147 /// ```
4148 /// # use google_cloud_dataform_v1::builder::dataform::MoveFile;
4149 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4150 ///
4151 /// let builder = prepare_request_builder();
4152 /// let response = builder.send().await?;
4153 /// # Ok(()) }
4154 ///
4155 /// fn prepare_request_builder() -> MoveFile {
4156 /// # panic!();
4157 /// // ... details omitted ...
4158 /// }
4159 /// ```
4160 #[derive(Clone, Debug)]
4161 pub struct MoveFile(RequestBuilder<crate::model::MoveFileRequest>);
4162
4163 impl MoveFile {
4164 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4165 Self(RequestBuilder::new(stub))
4166 }
4167
4168 /// Sets the full request, replacing any prior values.
4169 pub fn with_request<V: Into<crate::model::MoveFileRequest>>(mut self, v: V) -> Self {
4170 self.0.request = v.into();
4171 self
4172 }
4173
4174 /// Sets all the options, replacing any prior values.
4175 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4176 self.0.options = v.into();
4177 self
4178 }
4179
4180 /// Sends the request.
4181 pub async fn send(self) -> Result<crate::model::MoveFileResponse> {
4182 (*self.0.stub)
4183 .move_file(self.0.request, self.0.options)
4184 .await
4185 .map(crate::Response::into_body)
4186 }
4187
4188 /// Sets the value of [workspace][crate::model::MoveFileRequest::workspace].
4189 ///
4190 /// This is a **required** field for requests.
4191 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4192 self.0.request.workspace = v.into();
4193 self
4194 }
4195
4196 /// Sets the value of [path][crate::model::MoveFileRequest::path].
4197 ///
4198 /// This is a **required** field for requests.
4199 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200 self.0.request.path = v.into();
4201 self
4202 }
4203
4204 /// Sets the value of [new_path][crate::model::MoveFileRequest::new_path].
4205 ///
4206 /// This is a **required** field for requests.
4207 pub fn set_new_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
4208 self.0.request.new_path = v.into();
4209 self
4210 }
4211 }
4212
4213 #[doc(hidden)]
4214 impl crate::RequestBuilder for MoveFile {
4215 fn request_options(&mut self) -> &mut crate::RequestOptions {
4216 &mut self.0.options
4217 }
4218 }
4219
4220 /// The request builder for [Dataform::write_file][crate::client::Dataform::write_file] calls.
4221 ///
4222 /// # Example
4223 /// ```
4224 /// # use google_cloud_dataform_v1::builder::dataform::WriteFile;
4225 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4226 ///
4227 /// let builder = prepare_request_builder();
4228 /// let response = builder.send().await?;
4229 /// # Ok(()) }
4230 ///
4231 /// fn prepare_request_builder() -> WriteFile {
4232 /// # panic!();
4233 /// // ... details omitted ...
4234 /// }
4235 /// ```
4236 #[derive(Clone, Debug)]
4237 pub struct WriteFile(RequestBuilder<crate::model::WriteFileRequest>);
4238
4239 impl WriteFile {
4240 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4241 Self(RequestBuilder::new(stub))
4242 }
4243
4244 /// Sets the full request, replacing any prior values.
4245 pub fn with_request<V: Into<crate::model::WriteFileRequest>>(mut self, v: V) -> Self {
4246 self.0.request = v.into();
4247 self
4248 }
4249
4250 /// Sets all the options, replacing any prior values.
4251 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4252 self.0.options = v.into();
4253 self
4254 }
4255
4256 /// Sends the request.
4257 pub async fn send(self) -> Result<crate::model::WriteFileResponse> {
4258 (*self.0.stub)
4259 .write_file(self.0.request, self.0.options)
4260 .await
4261 .map(crate::Response::into_body)
4262 }
4263
4264 /// Sets the value of [workspace][crate::model::WriteFileRequest::workspace].
4265 ///
4266 /// This is a **required** field for requests.
4267 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
4268 self.0.request.workspace = v.into();
4269 self
4270 }
4271
4272 /// Sets the value of [path][crate::model::WriteFileRequest::path].
4273 ///
4274 /// This is a **required** field for requests.
4275 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
4276 self.0.request.path = v.into();
4277 self
4278 }
4279
4280 /// Sets the value of [contents][crate::model::WriteFileRequest::contents].
4281 ///
4282 /// This is a **required** field for requests.
4283 pub fn set_contents<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
4284 self.0.request.contents = v.into();
4285 self
4286 }
4287 }
4288
4289 #[doc(hidden)]
4290 impl crate::RequestBuilder for WriteFile {
4291 fn request_options(&mut self) -> &mut crate::RequestOptions {
4292 &mut self.0.options
4293 }
4294 }
4295
4296 /// The request builder for [Dataform::list_release_configs][crate::client::Dataform::list_release_configs] calls.
4297 ///
4298 /// # Example
4299 /// ```
4300 /// # use google_cloud_dataform_v1::builder::dataform::ListReleaseConfigs;
4301 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4302 /// use google_cloud_gax::paginator::ItemPaginator;
4303 ///
4304 /// let builder = prepare_request_builder();
4305 /// let mut items = builder.by_item();
4306 /// while let Some(result) = items.next().await {
4307 /// let item = result?;
4308 /// }
4309 /// # Ok(()) }
4310 ///
4311 /// fn prepare_request_builder() -> ListReleaseConfigs {
4312 /// # panic!();
4313 /// // ... details omitted ...
4314 /// }
4315 /// ```
4316 #[derive(Clone, Debug)]
4317 pub struct ListReleaseConfigs(RequestBuilder<crate::model::ListReleaseConfigsRequest>);
4318
4319 impl ListReleaseConfigs {
4320 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4321 Self(RequestBuilder::new(stub))
4322 }
4323
4324 /// Sets the full request, replacing any prior values.
4325 pub fn with_request<V: Into<crate::model::ListReleaseConfigsRequest>>(
4326 mut self,
4327 v: V,
4328 ) -> Self {
4329 self.0.request = v.into();
4330 self
4331 }
4332
4333 /// Sets all the options, replacing any prior values.
4334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4335 self.0.options = v.into();
4336 self
4337 }
4338
4339 /// Sends the request.
4340 pub async fn send(self) -> Result<crate::model::ListReleaseConfigsResponse> {
4341 (*self.0.stub)
4342 .list_release_configs(self.0.request, self.0.options)
4343 .await
4344 .map(crate::Response::into_body)
4345 }
4346
4347 /// Streams each page in the collection.
4348 pub fn by_page(
4349 self,
4350 ) -> impl google_cloud_gax::paginator::Paginator<
4351 crate::model::ListReleaseConfigsResponse,
4352 crate::Error,
4353 > {
4354 use std::clone::Clone;
4355 let token = self.0.request.page_token.clone();
4356 let execute = move |token: String| {
4357 let mut builder = self.clone();
4358 builder.0.request = builder.0.request.set_page_token(token);
4359 builder.send()
4360 };
4361 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4362 }
4363
4364 /// Streams each item in the collection.
4365 pub fn by_item(
4366 self,
4367 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4368 crate::model::ListReleaseConfigsResponse,
4369 crate::Error,
4370 > {
4371 use google_cloud_gax::paginator::Paginator;
4372 self.by_page().items()
4373 }
4374
4375 /// Sets the value of [parent][crate::model::ListReleaseConfigsRequest::parent].
4376 ///
4377 /// This is a **required** field for requests.
4378 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4379 self.0.request.parent = v.into();
4380 self
4381 }
4382
4383 /// Sets the value of [page_size][crate::model::ListReleaseConfigsRequest::page_size].
4384 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4385 self.0.request.page_size = v.into();
4386 self
4387 }
4388
4389 /// Sets the value of [page_token][crate::model::ListReleaseConfigsRequest::page_token].
4390 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4391 self.0.request.page_token = v.into();
4392 self
4393 }
4394 }
4395
4396 #[doc(hidden)]
4397 impl crate::RequestBuilder for ListReleaseConfigs {
4398 fn request_options(&mut self) -> &mut crate::RequestOptions {
4399 &mut self.0.options
4400 }
4401 }
4402
4403 /// The request builder for [Dataform::get_release_config][crate::client::Dataform::get_release_config] calls.
4404 ///
4405 /// # Example
4406 /// ```
4407 /// # use google_cloud_dataform_v1::builder::dataform::GetReleaseConfig;
4408 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4409 ///
4410 /// let builder = prepare_request_builder();
4411 /// let response = builder.send().await?;
4412 /// # Ok(()) }
4413 ///
4414 /// fn prepare_request_builder() -> GetReleaseConfig {
4415 /// # panic!();
4416 /// // ... details omitted ...
4417 /// }
4418 /// ```
4419 #[derive(Clone, Debug)]
4420 pub struct GetReleaseConfig(RequestBuilder<crate::model::GetReleaseConfigRequest>);
4421
4422 impl GetReleaseConfig {
4423 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4424 Self(RequestBuilder::new(stub))
4425 }
4426
4427 /// Sets the full request, replacing any prior values.
4428 pub fn with_request<V: Into<crate::model::GetReleaseConfigRequest>>(
4429 mut self,
4430 v: V,
4431 ) -> Self {
4432 self.0.request = v.into();
4433 self
4434 }
4435
4436 /// Sets all the options, replacing any prior values.
4437 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4438 self.0.options = v.into();
4439 self
4440 }
4441
4442 /// Sends the request.
4443 pub async fn send(self) -> Result<crate::model::ReleaseConfig> {
4444 (*self.0.stub)
4445 .get_release_config(self.0.request, self.0.options)
4446 .await
4447 .map(crate::Response::into_body)
4448 }
4449
4450 /// Sets the value of [name][crate::model::GetReleaseConfigRequest::name].
4451 ///
4452 /// This is a **required** field for requests.
4453 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4454 self.0.request.name = v.into();
4455 self
4456 }
4457 }
4458
4459 #[doc(hidden)]
4460 impl crate::RequestBuilder for GetReleaseConfig {
4461 fn request_options(&mut self) -> &mut crate::RequestOptions {
4462 &mut self.0.options
4463 }
4464 }
4465
4466 /// The request builder for [Dataform::create_release_config][crate::client::Dataform::create_release_config] calls.
4467 ///
4468 /// # Example
4469 /// ```
4470 /// # use google_cloud_dataform_v1::builder::dataform::CreateReleaseConfig;
4471 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4472 ///
4473 /// let builder = prepare_request_builder();
4474 /// let response = builder.send().await?;
4475 /// # Ok(()) }
4476 ///
4477 /// fn prepare_request_builder() -> CreateReleaseConfig {
4478 /// # panic!();
4479 /// // ... details omitted ...
4480 /// }
4481 /// ```
4482 #[derive(Clone, Debug)]
4483 pub struct CreateReleaseConfig(RequestBuilder<crate::model::CreateReleaseConfigRequest>);
4484
4485 impl CreateReleaseConfig {
4486 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4487 Self(RequestBuilder::new(stub))
4488 }
4489
4490 /// Sets the full request, replacing any prior values.
4491 pub fn with_request<V: Into<crate::model::CreateReleaseConfigRequest>>(
4492 mut self,
4493 v: V,
4494 ) -> Self {
4495 self.0.request = v.into();
4496 self
4497 }
4498
4499 /// Sets all the options, replacing any prior values.
4500 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4501 self.0.options = v.into();
4502 self
4503 }
4504
4505 /// Sends the request.
4506 pub async fn send(self) -> Result<crate::model::ReleaseConfig> {
4507 (*self.0.stub)
4508 .create_release_config(self.0.request, self.0.options)
4509 .await
4510 .map(crate::Response::into_body)
4511 }
4512
4513 /// Sets the value of [parent][crate::model::CreateReleaseConfigRequest::parent].
4514 ///
4515 /// This is a **required** field for requests.
4516 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4517 self.0.request.parent = v.into();
4518 self
4519 }
4520
4521 /// Sets the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
4522 ///
4523 /// This is a **required** field for requests.
4524 pub fn set_release_config<T>(mut self, v: T) -> Self
4525 where
4526 T: std::convert::Into<crate::model::ReleaseConfig>,
4527 {
4528 self.0.request.release_config = std::option::Option::Some(v.into());
4529 self
4530 }
4531
4532 /// Sets or clears the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
4533 ///
4534 /// This is a **required** field for requests.
4535 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
4536 where
4537 T: std::convert::Into<crate::model::ReleaseConfig>,
4538 {
4539 self.0.request.release_config = v.map(|x| x.into());
4540 self
4541 }
4542
4543 /// Sets the value of [release_config_id][crate::model::CreateReleaseConfigRequest::release_config_id].
4544 ///
4545 /// This is a **required** field for requests.
4546 pub fn set_release_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4547 self.0.request.release_config_id = v.into();
4548 self
4549 }
4550 }
4551
4552 #[doc(hidden)]
4553 impl crate::RequestBuilder for CreateReleaseConfig {
4554 fn request_options(&mut self) -> &mut crate::RequestOptions {
4555 &mut self.0.options
4556 }
4557 }
4558
4559 /// The request builder for [Dataform::update_release_config][crate::client::Dataform::update_release_config] calls.
4560 ///
4561 /// # Example
4562 /// ```
4563 /// # use google_cloud_dataform_v1::builder::dataform::UpdateReleaseConfig;
4564 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4565 ///
4566 /// let builder = prepare_request_builder();
4567 /// let response = builder.send().await?;
4568 /// # Ok(()) }
4569 ///
4570 /// fn prepare_request_builder() -> UpdateReleaseConfig {
4571 /// # panic!();
4572 /// // ... details omitted ...
4573 /// }
4574 /// ```
4575 #[derive(Clone, Debug)]
4576 pub struct UpdateReleaseConfig(RequestBuilder<crate::model::UpdateReleaseConfigRequest>);
4577
4578 impl UpdateReleaseConfig {
4579 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4580 Self(RequestBuilder::new(stub))
4581 }
4582
4583 /// Sets the full request, replacing any prior values.
4584 pub fn with_request<V: Into<crate::model::UpdateReleaseConfigRequest>>(
4585 mut self,
4586 v: V,
4587 ) -> Self {
4588 self.0.request = v.into();
4589 self
4590 }
4591
4592 /// Sets all the options, replacing any prior values.
4593 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4594 self.0.options = v.into();
4595 self
4596 }
4597
4598 /// Sends the request.
4599 pub async fn send(self) -> Result<crate::model::ReleaseConfig> {
4600 (*self.0.stub)
4601 .update_release_config(self.0.request, self.0.options)
4602 .await
4603 .map(crate::Response::into_body)
4604 }
4605
4606 /// Sets the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
4607 pub fn set_update_mask<T>(mut self, v: T) -> Self
4608 where
4609 T: std::convert::Into<wkt::FieldMask>,
4610 {
4611 self.0.request.update_mask = std::option::Option::Some(v.into());
4612 self
4613 }
4614
4615 /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
4616 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4617 where
4618 T: std::convert::Into<wkt::FieldMask>,
4619 {
4620 self.0.request.update_mask = v.map(|x| x.into());
4621 self
4622 }
4623
4624 /// Sets the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
4625 ///
4626 /// This is a **required** field for requests.
4627 pub fn set_release_config<T>(mut self, v: T) -> Self
4628 where
4629 T: std::convert::Into<crate::model::ReleaseConfig>,
4630 {
4631 self.0.request.release_config = std::option::Option::Some(v.into());
4632 self
4633 }
4634
4635 /// Sets or clears the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
4636 ///
4637 /// This is a **required** field for requests.
4638 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
4639 where
4640 T: std::convert::Into<crate::model::ReleaseConfig>,
4641 {
4642 self.0.request.release_config = v.map(|x| x.into());
4643 self
4644 }
4645 }
4646
4647 #[doc(hidden)]
4648 impl crate::RequestBuilder for UpdateReleaseConfig {
4649 fn request_options(&mut self) -> &mut crate::RequestOptions {
4650 &mut self.0.options
4651 }
4652 }
4653
4654 /// The request builder for [Dataform::delete_release_config][crate::client::Dataform::delete_release_config] calls.
4655 ///
4656 /// # Example
4657 /// ```
4658 /// # use google_cloud_dataform_v1::builder::dataform::DeleteReleaseConfig;
4659 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4660 ///
4661 /// let builder = prepare_request_builder();
4662 /// let response = builder.send().await?;
4663 /// # Ok(()) }
4664 ///
4665 /// fn prepare_request_builder() -> DeleteReleaseConfig {
4666 /// # panic!();
4667 /// // ... details omitted ...
4668 /// }
4669 /// ```
4670 #[derive(Clone, Debug)]
4671 pub struct DeleteReleaseConfig(RequestBuilder<crate::model::DeleteReleaseConfigRequest>);
4672
4673 impl DeleteReleaseConfig {
4674 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4675 Self(RequestBuilder::new(stub))
4676 }
4677
4678 /// Sets the full request, replacing any prior values.
4679 pub fn with_request<V: Into<crate::model::DeleteReleaseConfigRequest>>(
4680 mut self,
4681 v: V,
4682 ) -> Self {
4683 self.0.request = v.into();
4684 self
4685 }
4686
4687 /// Sets all the options, replacing any prior values.
4688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4689 self.0.options = v.into();
4690 self
4691 }
4692
4693 /// Sends the request.
4694 pub async fn send(self) -> Result<()> {
4695 (*self.0.stub)
4696 .delete_release_config(self.0.request, self.0.options)
4697 .await
4698 .map(crate::Response::into_body)
4699 }
4700
4701 /// Sets the value of [name][crate::model::DeleteReleaseConfigRequest::name].
4702 ///
4703 /// This is a **required** field for requests.
4704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4705 self.0.request.name = v.into();
4706 self
4707 }
4708 }
4709
4710 #[doc(hidden)]
4711 impl crate::RequestBuilder for DeleteReleaseConfig {
4712 fn request_options(&mut self) -> &mut crate::RequestOptions {
4713 &mut self.0.options
4714 }
4715 }
4716
4717 /// The request builder for [Dataform::list_compilation_results][crate::client::Dataform::list_compilation_results] calls.
4718 ///
4719 /// # Example
4720 /// ```
4721 /// # use google_cloud_dataform_v1::builder::dataform::ListCompilationResults;
4722 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4723 /// use google_cloud_gax::paginator::ItemPaginator;
4724 ///
4725 /// let builder = prepare_request_builder();
4726 /// let mut items = builder.by_item();
4727 /// while let Some(result) = items.next().await {
4728 /// let item = result?;
4729 /// }
4730 /// # Ok(()) }
4731 ///
4732 /// fn prepare_request_builder() -> ListCompilationResults {
4733 /// # panic!();
4734 /// // ... details omitted ...
4735 /// }
4736 /// ```
4737 #[derive(Clone, Debug)]
4738 pub struct ListCompilationResults(RequestBuilder<crate::model::ListCompilationResultsRequest>);
4739
4740 impl ListCompilationResults {
4741 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4742 Self(RequestBuilder::new(stub))
4743 }
4744
4745 /// Sets the full request, replacing any prior values.
4746 pub fn with_request<V: Into<crate::model::ListCompilationResultsRequest>>(
4747 mut self,
4748 v: V,
4749 ) -> Self {
4750 self.0.request = v.into();
4751 self
4752 }
4753
4754 /// Sets all the options, replacing any prior values.
4755 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4756 self.0.options = v.into();
4757 self
4758 }
4759
4760 /// Sends the request.
4761 pub async fn send(self) -> Result<crate::model::ListCompilationResultsResponse> {
4762 (*self.0.stub)
4763 .list_compilation_results(self.0.request, self.0.options)
4764 .await
4765 .map(crate::Response::into_body)
4766 }
4767
4768 /// Streams each page in the collection.
4769 pub fn by_page(
4770 self,
4771 ) -> impl google_cloud_gax::paginator::Paginator<
4772 crate::model::ListCompilationResultsResponse,
4773 crate::Error,
4774 > {
4775 use std::clone::Clone;
4776 let token = self.0.request.page_token.clone();
4777 let execute = move |token: String| {
4778 let mut builder = self.clone();
4779 builder.0.request = builder.0.request.set_page_token(token);
4780 builder.send()
4781 };
4782 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4783 }
4784
4785 /// Streams each item in the collection.
4786 pub fn by_item(
4787 self,
4788 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4789 crate::model::ListCompilationResultsResponse,
4790 crate::Error,
4791 > {
4792 use google_cloud_gax::paginator::Paginator;
4793 self.by_page().items()
4794 }
4795
4796 /// Sets the value of [parent][crate::model::ListCompilationResultsRequest::parent].
4797 ///
4798 /// This is a **required** field for requests.
4799 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4800 self.0.request.parent = v.into();
4801 self
4802 }
4803
4804 /// Sets the value of [page_size][crate::model::ListCompilationResultsRequest::page_size].
4805 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4806 self.0.request.page_size = v.into();
4807 self
4808 }
4809
4810 /// Sets the value of [page_token][crate::model::ListCompilationResultsRequest::page_token].
4811 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4812 self.0.request.page_token = v.into();
4813 self
4814 }
4815
4816 /// Sets the value of [order_by][crate::model::ListCompilationResultsRequest::order_by].
4817 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4818 self.0.request.order_by = v.into();
4819 self
4820 }
4821
4822 /// Sets the value of [filter][crate::model::ListCompilationResultsRequest::filter].
4823 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4824 self.0.request.filter = v.into();
4825 self
4826 }
4827 }
4828
4829 #[doc(hidden)]
4830 impl crate::RequestBuilder for ListCompilationResults {
4831 fn request_options(&mut self) -> &mut crate::RequestOptions {
4832 &mut self.0.options
4833 }
4834 }
4835
4836 /// The request builder for [Dataform::get_compilation_result][crate::client::Dataform::get_compilation_result] calls.
4837 ///
4838 /// # Example
4839 /// ```
4840 /// # use google_cloud_dataform_v1::builder::dataform::GetCompilationResult;
4841 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4842 ///
4843 /// let builder = prepare_request_builder();
4844 /// let response = builder.send().await?;
4845 /// # Ok(()) }
4846 ///
4847 /// fn prepare_request_builder() -> GetCompilationResult {
4848 /// # panic!();
4849 /// // ... details omitted ...
4850 /// }
4851 /// ```
4852 #[derive(Clone, Debug)]
4853 pub struct GetCompilationResult(RequestBuilder<crate::model::GetCompilationResultRequest>);
4854
4855 impl GetCompilationResult {
4856 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4857 Self(RequestBuilder::new(stub))
4858 }
4859
4860 /// Sets the full request, replacing any prior values.
4861 pub fn with_request<V: Into<crate::model::GetCompilationResultRequest>>(
4862 mut self,
4863 v: V,
4864 ) -> Self {
4865 self.0.request = v.into();
4866 self
4867 }
4868
4869 /// Sets all the options, replacing any prior values.
4870 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4871 self.0.options = v.into();
4872 self
4873 }
4874
4875 /// Sends the request.
4876 pub async fn send(self) -> Result<crate::model::CompilationResult> {
4877 (*self.0.stub)
4878 .get_compilation_result(self.0.request, self.0.options)
4879 .await
4880 .map(crate::Response::into_body)
4881 }
4882
4883 /// Sets the value of [name][crate::model::GetCompilationResultRequest::name].
4884 ///
4885 /// This is a **required** field for requests.
4886 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4887 self.0.request.name = v.into();
4888 self
4889 }
4890 }
4891
4892 #[doc(hidden)]
4893 impl crate::RequestBuilder for GetCompilationResult {
4894 fn request_options(&mut self) -> &mut crate::RequestOptions {
4895 &mut self.0.options
4896 }
4897 }
4898
4899 /// The request builder for [Dataform::create_compilation_result][crate::client::Dataform::create_compilation_result] calls.
4900 ///
4901 /// # Example
4902 /// ```
4903 /// # use google_cloud_dataform_v1::builder::dataform::CreateCompilationResult;
4904 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4905 ///
4906 /// let builder = prepare_request_builder();
4907 /// let response = builder.send().await?;
4908 /// # Ok(()) }
4909 ///
4910 /// fn prepare_request_builder() -> CreateCompilationResult {
4911 /// # panic!();
4912 /// // ... details omitted ...
4913 /// }
4914 /// ```
4915 #[derive(Clone, Debug)]
4916 pub struct CreateCompilationResult(
4917 RequestBuilder<crate::model::CreateCompilationResultRequest>,
4918 );
4919
4920 impl CreateCompilationResult {
4921 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4922 Self(RequestBuilder::new(stub))
4923 }
4924
4925 /// Sets the full request, replacing any prior values.
4926 pub fn with_request<V: Into<crate::model::CreateCompilationResultRequest>>(
4927 mut self,
4928 v: V,
4929 ) -> Self {
4930 self.0.request = v.into();
4931 self
4932 }
4933
4934 /// Sets all the options, replacing any prior values.
4935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4936 self.0.options = v.into();
4937 self
4938 }
4939
4940 /// Sends the request.
4941 pub async fn send(self) -> Result<crate::model::CompilationResult> {
4942 (*self.0.stub)
4943 .create_compilation_result(self.0.request, self.0.options)
4944 .await
4945 .map(crate::Response::into_body)
4946 }
4947
4948 /// Sets the value of [parent][crate::model::CreateCompilationResultRequest::parent].
4949 ///
4950 /// This is a **required** field for requests.
4951 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4952 self.0.request.parent = v.into();
4953 self
4954 }
4955
4956 /// Sets the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
4957 ///
4958 /// This is a **required** field for requests.
4959 pub fn set_compilation_result<T>(mut self, v: T) -> Self
4960 where
4961 T: std::convert::Into<crate::model::CompilationResult>,
4962 {
4963 self.0.request.compilation_result = std::option::Option::Some(v.into());
4964 self
4965 }
4966
4967 /// Sets or clears the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
4968 ///
4969 /// This is a **required** field for requests.
4970 pub fn set_or_clear_compilation_result<T>(mut self, v: std::option::Option<T>) -> Self
4971 where
4972 T: std::convert::Into<crate::model::CompilationResult>,
4973 {
4974 self.0.request.compilation_result = v.map(|x| x.into());
4975 self
4976 }
4977 }
4978
4979 #[doc(hidden)]
4980 impl crate::RequestBuilder for CreateCompilationResult {
4981 fn request_options(&mut self) -> &mut crate::RequestOptions {
4982 &mut self.0.options
4983 }
4984 }
4985
4986 /// The request builder for [Dataform::query_compilation_result_actions][crate::client::Dataform::query_compilation_result_actions] calls.
4987 ///
4988 /// # Example
4989 /// ```
4990 /// # use google_cloud_dataform_v1::builder::dataform::QueryCompilationResultActions;
4991 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4992 /// use google_cloud_gax::paginator::ItemPaginator;
4993 ///
4994 /// let builder = prepare_request_builder();
4995 /// let mut items = builder.by_item();
4996 /// while let Some(result) = items.next().await {
4997 /// let item = result?;
4998 /// }
4999 /// # Ok(()) }
5000 ///
5001 /// fn prepare_request_builder() -> QueryCompilationResultActions {
5002 /// # panic!();
5003 /// // ... details omitted ...
5004 /// }
5005 /// ```
5006 #[derive(Clone, Debug)]
5007 pub struct QueryCompilationResultActions(
5008 RequestBuilder<crate::model::QueryCompilationResultActionsRequest>,
5009 );
5010
5011 impl QueryCompilationResultActions {
5012 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5013 Self(RequestBuilder::new(stub))
5014 }
5015
5016 /// Sets the full request, replacing any prior values.
5017 pub fn with_request<V: Into<crate::model::QueryCompilationResultActionsRequest>>(
5018 mut self,
5019 v: V,
5020 ) -> Self {
5021 self.0.request = v.into();
5022 self
5023 }
5024
5025 /// Sets all the options, replacing any prior values.
5026 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5027 self.0.options = v.into();
5028 self
5029 }
5030
5031 /// Sends the request.
5032 pub async fn send(self) -> Result<crate::model::QueryCompilationResultActionsResponse> {
5033 (*self.0.stub)
5034 .query_compilation_result_actions(self.0.request, self.0.options)
5035 .await
5036 .map(crate::Response::into_body)
5037 }
5038
5039 /// Streams each page in the collection.
5040 pub fn by_page(
5041 self,
5042 ) -> impl google_cloud_gax::paginator::Paginator<
5043 crate::model::QueryCompilationResultActionsResponse,
5044 crate::Error,
5045 > {
5046 use std::clone::Clone;
5047 let token = self.0.request.page_token.clone();
5048 let execute = move |token: String| {
5049 let mut builder = self.clone();
5050 builder.0.request = builder.0.request.set_page_token(token);
5051 builder.send()
5052 };
5053 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5054 }
5055
5056 /// Streams each item in the collection.
5057 pub fn by_item(
5058 self,
5059 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5060 crate::model::QueryCompilationResultActionsResponse,
5061 crate::Error,
5062 > {
5063 use google_cloud_gax::paginator::Paginator;
5064 self.by_page().items()
5065 }
5066
5067 /// Sets the value of [name][crate::model::QueryCompilationResultActionsRequest::name].
5068 ///
5069 /// This is a **required** field for requests.
5070 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5071 self.0.request.name = v.into();
5072 self
5073 }
5074
5075 /// Sets the value of [page_size][crate::model::QueryCompilationResultActionsRequest::page_size].
5076 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5077 self.0.request.page_size = v.into();
5078 self
5079 }
5080
5081 /// Sets the value of [page_token][crate::model::QueryCompilationResultActionsRequest::page_token].
5082 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5083 self.0.request.page_token = v.into();
5084 self
5085 }
5086
5087 /// Sets the value of [filter][crate::model::QueryCompilationResultActionsRequest::filter].
5088 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5089 self.0.request.filter = v.into();
5090 self
5091 }
5092 }
5093
5094 #[doc(hidden)]
5095 impl crate::RequestBuilder for QueryCompilationResultActions {
5096 fn request_options(&mut self) -> &mut crate::RequestOptions {
5097 &mut self.0.options
5098 }
5099 }
5100
5101 /// The request builder for [Dataform::list_workflow_configs][crate::client::Dataform::list_workflow_configs] calls.
5102 ///
5103 /// # Example
5104 /// ```
5105 /// # use google_cloud_dataform_v1::builder::dataform::ListWorkflowConfigs;
5106 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5107 /// use google_cloud_gax::paginator::ItemPaginator;
5108 ///
5109 /// let builder = prepare_request_builder();
5110 /// let mut items = builder.by_item();
5111 /// while let Some(result) = items.next().await {
5112 /// let item = result?;
5113 /// }
5114 /// # Ok(()) }
5115 ///
5116 /// fn prepare_request_builder() -> ListWorkflowConfigs {
5117 /// # panic!();
5118 /// // ... details omitted ...
5119 /// }
5120 /// ```
5121 #[derive(Clone, Debug)]
5122 pub struct ListWorkflowConfigs(RequestBuilder<crate::model::ListWorkflowConfigsRequest>);
5123
5124 impl ListWorkflowConfigs {
5125 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5126 Self(RequestBuilder::new(stub))
5127 }
5128
5129 /// Sets the full request, replacing any prior values.
5130 pub fn with_request<V: Into<crate::model::ListWorkflowConfigsRequest>>(
5131 mut self,
5132 v: V,
5133 ) -> Self {
5134 self.0.request = v.into();
5135 self
5136 }
5137
5138 /// Sets all the options, replacing any prior values.
5139 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5140 self.0.options = v.into();
5141 self
5142 }
5143
5144 /// Sends the request.
5145 pub async fn send(self) -> Result<crate::model::ListWorkflowConfigsResponse> {
5146 (*self.0.stub)
5147 .list_workflow_configs(self.0.request, self.0.options)
5148 .await
5149 .map(crate::Response::into_body)
5150 }
5151
5152 /// Streams each page in the collection.
5153 pub fn by_page(
5154 self,
5155 ) -> impl google_cloud_gax::paginator::Paginator<
5156 crate::model::ListWorkflowConfigsResponse,
5157 crate::Error,
5158 > {
5159 use std::clone::Clone;
5160 let token = self.0.request.page_token.clone();
5161 let execute = move |token: String| {
5162 let mut builder = self.clone();
5163 builder.0.request = builder.0.request.set_page_token(token);
5164 builder.send()
5165 };
5166 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5167 }
5168
5169 /// Streams each item in the collection.
5170 pub fn by_item(
5171 self,
5172 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5173 crate::model::ListWorkflowConfigsResponse,
5174 crate::Error,
5175 > {
5176 use google_cloud_gax::paginator::Paginator;
5177 self.by_page().items()
5178 }
5179
5180 /// Sets the value of [parent][crate::model::ListWorkflowConfigsRequest::parent].
5181 ///
5182 /// This is a **required** field for requests.
5183 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5184 self.0.request.parent = v.into();
5185 self
5186 }
5187
5188 /// Sets the value of [page_size][crate::model::ListWorkflowConfigsRequest::page_size].
5189 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5190 self.0.request.page_size = v.into();
5191 self
5192 }
5193
5194 /// Sets the value of [page_token][crate::model::ListWorkflowConfigsRequest::page_token].
5195 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5196 self.0.request.page_token = v.into();
5197 self
5198 }
5199 }
5200
5201 #[doc(hidden)]
5202 impl crate::RequestBuilder for ListWorkflowConfigs {
5203 fn request_options(&mut self) -> &mut crate::RequestOptions {
5204 &mut self.0.options
5205 }
5206 }
5207
5208 /// The request builder for [Dataform::get_workflow_config][crate::client::Dataform::get_workflow_config] calls.
5209 ///
5210 /// # Example
5211 /// ```
5212 /// # use google_cloud_dataform_v1::builder::dataform::GetWorkflowConfig;
5213 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5214 ///
5215 /// let builder = prepare_request_builder();
5216 /// let response = builder.send().await?;
5217 /// # Ok(()) }
5218 ///
5219 /// fn prepare_request_builder() -> GetWorkflowConfig {
5220 /// # panic!();
5221 /// // ... details omitted ...
5222 /// }
5223 /// ```
5224 #[derive(Clone, Debug)]
5225 pub struct GetWorkflowConfig(RequestBuilder<crate::model::GetWorkflowConfigRequest>);
5226
5227 impl GetWorkflowConfig {
5228 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5229 Self(RequestBuilder::new(stub))
5230 }
5231
5232 /// Sets the full request, replacing any prior values.
5233 pub fn with_request<V: Into<crate::model::GetWorkflowConfigRequest>>(
5234 mut self,
5235 v: V,
5236 ) -> Self {
5237 self.0.request = v.into();
5238 self
5239 }
5240
5241 /// Sets all the options, replacing any prior values.
5242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5243 self.0.options = v.into();
5244 self
5245 }
5246
5247 /// Sends the request.
5248 pub async fn send(self) -> Result<crate::model::WorkflowConfig> {
5249 (*self.0.stub)
5250 .get_workflow_config(self.0.request, self.0.options)
5251 .await
5252 .map(crate::Response::into_body)
5253 }
5254
5255 /// Sets the value of [name][crate::model::GetWorkflowConfigRequest::name].
5256 ///
5257 /// This is a **required** field for requests.
5258 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5259 self.0.request.name = v.into();
5260 self
5261 }
5262 }
5263
5264 #[doc(hidden)]
5265 impl crate::RequestBuilder for GetWorkflowConfig {
5266 fn request_options(&mut self) -> &mut crate::RequestOptions {
5267 &mut self.0.options
5268 }
5269 }
5270
5271 /// The request builder for [Dataform::create_workflow_config][crate::client::Dataform::create_workflow_config] calls.
5272 ///
5273 /// # Example
5274 /// ```
5275 /// # use google_cloud_dataform_v1::builder::dataform::CreateWorkflowConfig;
5276 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5277 ///
5278 /// let builder = prepare_request_builder();
5279 /// let response = builder.send().await?;
5280 /// # Ok(()) }
5281 ///
5282 /// fn prepare_request_builder() -> CreateWorkflowConfig {
5283 /// # panic!();
5284 /// // ... details omitted ...
5285 /// }
5286 /// ```
5287 #[derive(Clone, Debug)]
5288 pub struct CreateWorkflowConfig(RequestBuilder<crate::model::CreateWorkflowConfigRequest>);
5289
5290 impl CreateWorkflowConfig {
5291 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5292 Self(RequestBuilder::new(stub))
5293 }
5294
5295 /// Sets the full request, replacing any prior values.
5296 pub fn with_request<V: Into<crate::model::CreateWorkflowConfigRequest>>(
5297 mut self,
5298 v: V,
5299 ) -> Self {
5300 self.0.request = v.into();
5301 self
5302 }
5303
5304 /// Sets all the options, replacing any prior values.
5305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5306 self.0.options = v.into();
5307 self
5308 }
5309
5310 /// Sends the request.
5311 pub async fn send(self) -> Result<crate::model::WorkflowConfig> {
5312 (*self.0.stub)
5313 .create_workflow_config(self.0.request, self.0.options)
5314 .await
5315 .map(crate::Response::into_body)
5316 }
5317
5318 /// Sets the value of [parent][crate::model::CreateWorkflowConfigRequest::parent].
5319 ///
5320 /// This is a **required** field for requests.
5321 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5322 self.0.request.parent = v.into();
5323 self
5324 }
5325
5326 /// Sets the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
5327 ///
5328 /// This is a **required** field for requests.
5329 pub fn set_workflow_config<T>(mut self, v: T) -> Self
5330 where
5331 T: std::convert::Into<crate::model::WorkflowConfig>,
5332 {
5333 self.0.request.workflow_config = std::option::Option::Some(v.into());
5334 self
5335 }
5336
5337 /// Sets or clears the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
5338 ///
5339 /// This is a **required** field for requests.
5340 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
5341 where
5342 T: std::convert::Into<crate::model::WorkflowConfig>,
5343 {
5344 self.0.request.workflow_config = v.map(|x| x.into());
5345 self
5346 }
5347
5348 /// Sets the value of [workflow_config_id][crate::model::CreateWorkflowConfigRequest::workflow_config_id].
5349 ///
5350 /// This is a **required** field for requests.
5351 pub fn set_workflow_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
5352 self.0.request.workflow_config_id = v.into();
5353 self
5354 }
5355 }
5356
5357 #[doc(hidden)]
5358 impl crate::RequestBuilder for CreateWorkflowConfig {
5359 fn request_options(&mut self) -> &mut crate::RequestOptions {
5360 &mut self.0.options
5361 }
5362 }
5363
5364 /// The request builder for [Dataform::update_workflow_config][crate::client::Dataform::update_workflow_config] calls.
5365 ///
5366 /// # Example
5367 /// ```
5368 /// # use google_cloud_dataform_v1::builder::dataform::UpdateWorkflowConfig;
5369 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5370 ///
5371 /// let builder = prepare_request_builder();
5372 /// let response = builder.send().await?;
5373 /// # Ok(()) }
5374 ///
5375 /// fn prepare_request_builder() -> UpdateWorkflowConfig {
5376 /// # panic!();
5377 /// // ... details omitted ...
5378 /// }
5379 /// ```
5380 #[derive(Clone, Debug)]
5381 pub struct UpdateWorkflowConfig(RequestBuilder<crate::model::UpdateWorkflowConfigRequest>);
5382
5383 impl UpdateWorkflowConfig {
5384 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5385 Self(RequestBuilder::new(stub))
5386 }
5387
5388 /// Sets the full request, replacing any prior values.
5389 pub fn with_request<V: Into<crate::model::UpdateWorkflowConfigRequest>>(
5390 mut self,
5391 v: V,
5392 ) -> Self {
5393 self.0.request = v.into();
5394 self
5395 }
5396
5397 /// Sets all the options, replacing any prior values.
5398 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5399 self.0.options = v.into();
5400 self
5401 }
5402
5403 /// Sends the request.
5404 pub async fn send(self) -> Result<crate::model::WorkflowConfig> {
5405 (*self.0.stub)
5406 .update_workflow_config(self.0.request, self.0.options)
5407 .await
5408 .map(crate::Response::into_body)
5409 }
5410
5411 /// Sets the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
5412 pub fn set_update_mask<T>(mut self, v: T) -> Self
5413 where
5414 T: std::convert::Into<wkt::FieldMask>,
5415 {
5416 self.0.request.update_mask = std::option::Option::Some(v.into());
5417 self
5418 }
5419
5420 /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
5421 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5422 where
5423 T: std::convert::Into<wkt::FieldMask>,
5424 {
5425 self.0.request.update_mask = v.map(|x| x.into());
5426 self
5427 }
5428
5429 /// Sets the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
5430 ///
5431 /// This is a **required** field for requests.
5432 pub fn set_workflow_config<T>(mut self, v: T) -> Self
5433 where
5434 T: std::convert::Into<crate::model::WorkflowConfig>,
5435 {
5436 self.0.request.workflow_config = std::option::Option::Some(v.into());
5437 self
5438 }
5439
5440 /// Sets or clears the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
5441 ///
5442 /// This is a **required** field for requests.
5443 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
5444 where
5445 T: std::convert::Into<crate::model::WorkflowConfig>,
5446 {
5447 self.0.request.workflow_config = v.map(|x| x.into());
5448 self
5449 }
5450 }
5451
5452 #[doc(hidden)]
5453 impl crate::RequestBuilder for UpdateWorkflowConfig {
5454 fn request_options(&mut self) -> &mut crate::RequestOptions {
5455 &mut self.0.options
5456 }
5457 }
5458
5459 /// The request builder for [Dataform::delete_workflow_config][crate::client::Dataform::delete_workflow_config] calls.
5460 ///
5461 /// # Example
5462 /// ```
5463 /// # use google_cloud_dataform_v1::builder::dataform::DeleteWorkflowConfig;
5464 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5465 ///
5466 /// let builder = prepare_request_builder();
5467 /// let response = builder.send().await?;
5468 /// # Ok(()) }
5469 ///
5470 /// fn prepare_request_builder() -> DeleteWorkflowConfig {
5471 /// # panic!();
5472 /// // ... details omitted ...
5473 /// }
5474 /// ```
5475 #[derive(Clone, Debug)]
5476 pub struct DeleteWorkflowConfig(RequestBuilder<crate::model::DeleteWorkflowConfigRequest>);
5477
5478 impl DeleteWorkflowConfig {
5479 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5480 Self(RequestBuilder::new(stub))
5481 }
5482
5483 /// Sets the full request, replacing any prior values.
5484 pub fn with_request<V: Into<crate::model::DeleteWorkflowConfigRequest>>(
5485 mut self,
5486 v: V,
5487 ) -> Self {
5488 self.0.request = v.into();
5489 self
5490 }
5491
5492 /// Sets all the options, replacing any prior values.
5493 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5494 self.0.options = v.into();
5495 self
5496 }
5497
5498 /// Sends the request.
5499 pub async fn send(self) -> Result<()> {
5500 (*self.0.stub)
5501 .delete_workflow_config(self.0.request, self.0.options)
5502 .await
5503 .map(crate::Response::into_body)
5504 }
5505
5506 /// Sets the value of [name][crate::model::DeleteWorkflowConfigRequest::name].
5507 ///
5508 /// This is a **required** field for requests.
5509 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5510 self.0.request.name = v.into();
5511 self
5512 }
5513 }
5514
5515 #[doc(hidden)]
5516 impl crate::RequestBuilder for DeleteWorkflowConfig {
5517 fn request_options(&mut self) -> &mut crate::RequestOptions {
5518 &mut self.0.options
5519 }
5520 }
5521
5522 /// The request builder for [Dataform::list_workflow_invocations][crate::client::Dataform::list_workflow_invocations] calls.
5523 ///
5524 /// # Example
5525 /// ```
5526 /// # use google_cloud_dataform_v1::builder::dataform::ListWorkflowInvocations;
5527 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5528 /// use google_cloud_gax::paginator::ItemPaginator;
5529 ///
5530 /// let builder = prepare_request_builder();
5531 /// let mut items = builder.by_item();
5532 /// while let Some(result) = items.next().await {
5533 /// let item = result?;
5534 /// }
5535 /// # Ok(()) }
5536 ///
5537 /// fn prepare_request_builder() -> ListWorkflowInvocations {
5538 /// # panic!();
5539 /// // ... details omitted ...
5540 /// }
5541 /// ```
5542 #[derive(Clone, Debug)]
5543 pub struct ListWorkflowInvocations(
5544 RequestBuilder<crate::model::ListWorkflowInvocationsRequest>,
5545 );
5546
5547 impl ListWorkflowInvocations {
5548 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5549 Self(RequestBuilder::new(stub))
5550 }
5551
5552 /// Sets the full request, replacing any prior values.
5553 pub fn with_request<V: Into<crate::model::ListWorkflowInvocationsRequest>>(
5554 mut self,
5555 v: V,
5556 ) -> Self {
5557 self.0.request = v.into();
5558 self
5559 }
5560
5561 /// Sets all the options, replacing any prior values.
5562 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5563 self.0.options = v.into();
5564 self
5565 }
5566
5567 /// Sends the request.
5568 pub async fn send(self) -> Result<crate::model::ListWorkflowInvocationsResponse> {
5569 (*self.0.stub)
5570 .list_workflow_invocations(self.0.request, self.0.options)
5571 .await
5572 .map(crate::Response::into_body)
5573 }
5574
5575 /// Streams each page in the collection.
5576 pub fn by_page(
5577 self,
5578 ) -> impl google_cloud_gax::paginator::Paginator<
5579 crate::model::ListWorkflowInvocationsResponse,
5580 crate::Error,
5581 > {
5582 use std::clone::Clone;
5583 let token = self.0.request.page_token.clone();
5584 let execute = move |token: String| {
5585 let mut builder = self.clone();
5586 builder.0.request = builder.0.request.set_page_token(token);
5587 builder.send()
5588 };
5589 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5590 }
5591
5592 /// Streams each item in the collection.
5593 pub fn by_item(
5594 self,
5595 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5596 crate::model::ListWorkflowInvocationsResponse,
5597 crate::Error,
5598 > {
5599 use google_cloud_gax::paginator::Paginator;
5600 self.by_page().items()
5601 }
5602
5603 /// Sets the value of [parent][crate::model::ListWorkflowInvocationsRequest::parent].
5604 ///
5605 /// This is a **required** field for requests.
5606 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5607 self.0.request.parent = v.into();
5608 self
5609 }
5610
5611 /// Sets the value of [page_size][crate::model::ListWorkflowInvocationsRequest::page_size].
5612 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5613 self.0.request.page_size = v.into();
5614 self
5615 }
5616
5617 /// Sets the value of [page_token][crate::model::ListWorkflowInvocationsRequest::page_token].
5618 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5619 self.0.request.page_token = v.into();
5620 self
5621 }
5622
5623 /// Sets the value of [order_by][crate::model::ListWorkflowInvocationsRequest::order_by].
5624 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
5625 self.0.request.order_by = v.into();
5626 self
5627 }
5628
5629 /// Sets the value of [filter][crate::model::ListWorkflowInvocationsRequest::filter].
5630 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5631 self.0.request.filter = v.into();
5632 self
5633 }
5634 }
5635
5636 #[doc(hidden)]
5637 impl crate::RequestBuilder for ListWorkflowInvocations {
5638 fn request_options(&mut self) -> &mut crate::RequestOptions {
5639 &mut self.0.options
5640 }
5641 }
5642
5643 /// The request builder for [Dataform::get_workflow_invocation][crate::client::Dataform::get_workflow_invocation] calls.
5644 ///
5645 /// # Example
5646 /// ```
5647 /// # use google_cloud_dataform_v1::builder::dataform::GetWorkflowInvocation;
5648 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5649 ///
5650 /// let builder = prepare_request_builder();
5651 /// let response = builder.send().await?;
5652 /// # Ok(()) }
5653 ///
5654 /// fn prepare_request_builder() -> GetWorkflowInvocation {
5655 /// # panic!();
5656 /// // ... details omitted ...
5657 /// }
5658 /// ```
5659 #[derive(Clone, Debug)]
5660 pub struct GetWorkflowInvocation(RequestBuilder<crate::model::GetWorkflowInvocationRequest>);
5661
5662 impl GetWorkflowInvocation {
5663 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5664 Self(RequestBuilder::new(stub))
5665 }
5666
5667 /// Sets the full request, replacing any prior values.
5668 pub fn with_request<V: Into<crate::model::GetWorkflowInvocationRequest>>(
5669 mut self,
5670 v: V,
5671 ) -> Self {
5672 self.0.request = v.into();
5673 self
5674 }
5675
5676 /// Sets all the options, replacing any prior values.
5677 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5678 self.0.options = v.into();
5679 self
5680 }
5681
5682 /// Sends the request.
5683 pub async fn send(self) -> Result<crate::model::WorkflowInvocation> {
5684 (*self.0.stub)
5685 .get_workflow_invocation(self.0.request, self.0.options)
5686 .await
5687 .map(crate::Response::into_body)
5688 }
5689
5690 /// Sets the value of [name][crate::model::GetWorkflowInvocationRequest::name].
5691 ///
5692 /// This is a **required** field for requests.
5693 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5694 self.0.request.name = v.into();
5695 self
5696 }
5697 }
5698
5699 #[doc(hidden)]
5700 impl crate::RequestBuilder for GetWorkflowInvocation {
5701 fn request_options(&mut self) -> &mut crate::RequestOptions {
5702 &mut self.0.options
5703 }
5704 }
5705
5706 /// The request builder for [Dataform::create_workflow_invocation][crate::client::Dataform::create_workflow_invocation] calls.
5707 ///
5708 /// # Example
5709 /// ```
5710 /// # use google_cloud_dataform_v1::builder::dataform::CreateWorkflowInvocation;
5711 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5712 ///
5713 /// let builder = prepare_request_builder();
5714 /// let response = builder.send().await?;
5715 /// # Ok(()) }
5716 ///
5717 /// fn prepare_request_builder() -> CreateWorkflowInvocation {
5718 /// # panic!();
5719 /// // ... details omitted ...
5720 /// }
5721 /// ```
5722 #[derive(Clone, Debug)]
5723 pub struct CreateWorkflowInvocation(
5724 RequestBuilder<crate::model::CreateWorkflowInvocationRequest>,
5725 );
5726
5727 impl CreateWorkflowInvocation {
5728 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5729 Self(RequestBuilder::new(stub))
5730 }
5731
5732 /// Sets the full request, replacing any prior values.
5733 pub fn with_request<V: Into<crate::model::CreateWorkflowInvocationRequest>>(
5734 mut self,
5735 v: V,
5736 ) -> Self {
5737 self.0.request = v.into();
5738 self
5739 }
5740
5741 /// Sets all the options, replacing any prior values.
5742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5743 self.0.options = v.into();
5744 self
5745 }
5746
5747 /// Sends the request.
5748 pub async fn send(self) -> Result<crate::model::WorkflowInvocation> {
5749 (*self.0.stub)
5750 .create_workflow_invocation(self.0.request, self.0.options)
5751 .await
5752 .map(crate::Response::into_body)
5753 }
5754
5755 /// Sets the value of [parent][crate::model::CreateWorkflowInvocationRequest::parent].
5756 ///
5757 /// This is a **required** field for requests.
5758 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5759 self.0.request.parent = v.into();
5760 self
5761 }
5762
5763 /// Sets the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
5764 ///
5765 /// This is a **required** field for requests.
5766 pub fn set_workflow_invocation<T>(mut self, v: T) -> Self
5767 where
5768 T: std::convert::Into<crate::model::WorkflowInvocation>,
5769 {
5770 self.0.request.workflow_invocation = std::option::Option::Some(v.into());
5771 self
5772 }
5773
5774 /// Sets or clears the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
5775 ///
5776 /// This is a **required** field for requests.
5777 pub fn set_or_clear_workflow_invocation<T>(mut self, v: std::option::Option<T>) -> Self
5778 where
5779 T: std::convert::Into<crate::model::WorkflowInvocation>,
5780 {
5781 self.0.request.workflow_invocation = v.map(|x| x.into());
5782 self
5783 }
5784 }
5785
5786 #[doc(hidden)]
5787 impl crate::RequestBuilder for CreateWorkflowInvocation {
5788 fn request_options(&mut self) -> &mut crate::RequestOptions {
5789 &mut self.0.options
5790 }
5791 }
5792
5793 /// The request builder for [Dataform::delete_workflow_invocation][crate::client::Dataform::delete_workflow_invocation] calls.
5794 ///
5795 /// # Example
5796 /// ```
5797 /// # use google_cloud_dataform_v1::builder::dataform::DeleteWorkflowInvocation;
5798 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5799 ///
5800 /// let builder = prepare_request_builder();
5801 /// let response = builder.send().await?;
5802 /// # Ok(()) }
5803 ///
5804 /// fn prepare_request_builder() -> DeleteWorkflowInvocation {
5805 /// # panic!();
5806 /// // ... details omitted ...
5807 /// }
5808 /// ```
5809 #[derive(Clone, Debug)]
5810 pub struct DeleteWorkflowInvocation(
5811 RequestBuilder<crate::model::DeleteWorkflowInvocationRequest>,
5812 );
5813
5814 impl DeleteWorkflowInvocation {
5815 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5816 Self(RequestBuilder::new(stub))
5817 }
5818
5819 /// Sets the full request, replacing any prior values.
5820 pub fn with_request<V: Into<crate::model::DeleteWorkflowInvocationRequest>>(
5821 mut self,
5822 v: V,
5823 ) -> Self {
5824 self.0.request = v.into();
5825 self
5826 }
5827
5828 /// Sets all the options, replacing any prior values.
5829 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5830 self.0.options = v.into();
5831 self
5832 }
5833
5834 /// Sends the request.
5835 pub async fn send(self) -> Result<()> {
5836 (*self.0.stub)
5837 .delete_workflow_invocation(self.0.request, self.0.options)
5838 .await
5839 .map(crate::Response::into_body)
5840 }
5841
5842 /// Sets the value of [name][crate::model::DeleteWorkflowInvocationRequest::name].
5843 ///
5844 /// This is a **required** field for requests.
5845 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5846 self.0.request.name = v.into();
5847 self
5848 }
5849 }
5850
5851 #[doc(hidden)]
5852 impl crate::RequestBuilder for DeleteWorkflowInvocation {
5853 fn request_options(&mut self) -> &mut crate::RequestOptions {
5854 &mut self.0.options
5855 }
5856 }
5857
5858 /// The request builder for [Dataform::cancel_workflow_invocation][crate::client::Dataform::cancel_workflow_invocation] calls.
5859 ///
5860 /// # Example
5861 /// ```
5862 /// # use google_cloud_dataform_v1::builder::dataform::CancelWorkflowInvocation;
5863 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5864 ///
5865 /// let builder = prepare_request_builder();
5866 /// let response = builder.send().await?;
5867 /// # Ok(()) }
5868 ///
5869 /// fn prepare_request_builder() -> CancelWorkflowInvocation {
5870 /// # panic!();
5871 /// // ... details omitted ...
5872 /// }
5873 /// ```
5874 #[derive(Clone, Debug)]
5875 pub struct CancelWorkflowInvocation(
5876 RequestBuilder<crate::model::CancelWorkflowInvocationRequest>,
5877 );
5878
5879 impl CancelWorkflowInvocation {
5880 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5881 Self(RequestBuilder::new(stub))
5882 }
5883
5884 /// Sets the full request, replacing any prior values.
5885 pub fn with_request<V: Into<crate::model::CancelWorkflowInvocationRequest>>(
5886 mut self,
5887 v: V,
5888 ) -> Self {
5889 self.0.request = v.into();
5890 self
5891 }
5892
5893 /// Sets all the options, replacing any prior values.
5894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5895 self.0.options = v.into();
5896 self
5897 }
5898
5899 /// Sends the request.
5900 pub async fn send(self) -> Result<crate::model::CancelWorkflowInvocationResponse> {
5901 (*self.0.stub)
5902 .cancel_workflow_invocation(self.0.request, self.0.options)
5903 .await
5904 .map(crate::Response::into_body)
5905 }
5906
5907 /// Sets the value of [name][crate::model::CancelWorkflowInvocationRequest::name].
5908 ///
5909 /// This is a **required** field for requests.
5910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5911 self.0.request.name = v.into();
5912 self
5913 }
5914 }
5915
5916 #[doc(hidden)]
5917 impl crate::RequestBuilder for CancelWorkflowInvocation {
5918 fn request_options(&mut self) -> &mut crate::RequestOptions {
5919 &mut self.0.options
5920 }
5921 }
5922
5923 /// The request builder for [Dataform::query_workflow_invocation_actions][crate::client::Dataform::query_workflow_invocation_actions] calls.
5924 ///
5925 /// # Example
5926 /// ```
5927 /// # use google_cloud_dataform_v1::builder::dataform::QueryWorkflowInvocationActions;
5928 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
5929 /// use google_cloud_gax::paginator::ItemPaginator;
5930 ///
5931 /// let builder = prepare_request_builder();
5932 /// let mut items = builder.by_item();
5933 /// while let Some(result) = items.next().await {
5934 /// let item = result?;
5935 /// }
5936 /// # Ok(()) }
5937 ///
5938 /// fn prepare_request_builder() -> QueryWorkflowInvocationActions {
5939 /// # panic!();
5940 /// // ... details omitted ...
5941 /// }
5942 /// ```
5943 #[derive(Clone, Debug)]
5944 pub struct QueryWorkflowInvocationActions(
5945 RequestBuilder<crate::model::QueryWorkflowInvocationActionsRequest>,
5946 );
5947
5948 impl QueryWorkflowInvocationActions {
5949 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
5950 Self(RequestBuilder::new(stub))
5951 }
5952
5953 /// Sets the full request, replacing any prior values.
5954 pub fn with_request<V: Into<crate::model::QueryWorkflowInvocationActionsRequest>>(
5955 mut self,
5956 v: V,
5957 ) -> Self {
5958 self.0.request = v.into();
5959 self
5960 }
5961
5962 /// Sets all the options, replacing any prior values.
5963 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5964 self.0.options = v.into();
5965 self
5966 }
5967
5968 /// Sends the request.
5969 pub async fn send(self) -> Result<crate::model::QueryWorkflowInvocationActionsResponse> {
5970 (*self.0.stub)
5971 .query_workflow_invocation_actions(self.0.request, self.0.options)
5972 .await
5973 .map(crate::Response::into_body)
5974 }
5975
5976 /// Streams each page in the collection.
5977 pub fn by_page(
5978 self,
5979 ) -> impl google_cloud_gax::paginator::Paginator<
5980 crate::model::QueryWorkflowInvocationActionsResponse,
5981 crate::Error,
5982 > {
5983 use std::clone::Clone;
5984 let token = self.0.request.page_token.clone();
5985 let execute = move |token: String| {
5986 let mut builder = self.clone();
5987 builder.0.request = builder.0.request.set_page_token(token);
5988 builder.send()
5989 };
5990 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5991 }
5992
5993 /// Streams each item in the collection.
5994 pub fn by_item(
5995 self,
5996 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5997 crate::model::QueryWorkflowInvocationActionsResponse,
5998 crate::Error,
5999 > {
6000 use google_cloud_gax::paginator::Paginator;
6001 self.by_page().items()
6002 }
6003
6004 /// Sets the value of [name][crate::model::QueryWorkflowInvocationActionsRequest::name].
6005 ///
6006 /// This is a **required** field for requests.
6007 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6008 self.0.request.name = v.into();
6009 self
6010 }
6011
6012 /// Sets the value of [page_size][crate::model::QueryWorkflowInvocationActionsRequest::page_size].
6013 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6014 self.0.request.page_size = v.into();
6015 self
6016 }
6017
6018 /// Sets the value of [page_token][crate::model::QueryWorkflowInvocationActionsRequest::page_token].
6019 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6020 self.0.request.page_token = v.into();
6021 self
6022 }
6023 }
6024
6025 #[doc(hidden)]
6026 impl crate::RequestBuilder for QueryWorkflowInvocationActions {
6027 fn request_options(&mut self) -> &mut crate::RequestOptions {
6028 &mut self.0.options
6029 }
6030 }
6031
6032 /// The request builder for [Dataform::get_config][crate::client::Dataform::get_config] calls.
6033 ///
6034 /// # Example
6035 /// ```
6036 /// # use google_cloud_dataform_v1::builder::dataform::GetConfig;
6037 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6038 ///
6039 /// let builder = prepare_request_builder();
6040 /// let response = builder.send().await?;
6041 /// # Ok(()) }
6042 ///
6043 /// fn prepare_request_builder() -> GetConfig {
6044 /// # panic!();
6045 /// // ... details omitted ...
6046 /// }
6047 /// ```
6048 #[derive(Clone, Debug)]
6049 pub struct GetConfig(RequestBuilder<crate::model::GetConfigRequest>);
6050
6051 impl GetConfig {
6052 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6053 Self(RequestBuilder::new(stub))
6054 }
6055
6056 /// Sets the full request, replacing any prior values.
6057 pub fn with_request<V: Into<crate::model::GetConfigRequest>>(mut self, v: V) -> Self {
6058 self.0.request = v.into();
6059 self
6060 }
6061
6062 /// Sets all the options, replacing any prior values.
6063 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6064 self.0.options = v.into();
6065 self
6066 }
6067
6068 /// Sends the request.
6069 pub async fn send(self) -> Result<crate::model::Config> {
6070 (*self.0.stub)
6071 .get_config(self.0.request, self.0.options)
6072 .await
6073 .map(crate::Response::into_body)
6074 }
6075
6076 /// Sets the value of [name][crate::model::GetConfigRequest::name].
6077 ///
6078 /// This is a **required** field for requests.
6079 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6080 self.0.request.name = v.into();
6081 self
6082 }
6083 }
6084
6085 #[doc(hidden)]
6086 impl crate::RequestBuilder for GetConfig {
6087 fn request_options(&mut self) -> &mut crate::RequestOptions {
6088 &mut self.0.options
6089 }
6090 }
6091
6092 /// The request builder for [Dataform::update_config][crate::client::Dataform::update_config] calls.
6093 ///
6094 /// # Example
6095 /// ```
6096 /// # use google_cloud_dataform_v1::builder::dataform::UpdateConfig;
6097 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6098 ///
6099 /// let builder = prepare_request_builder();
6100 /// let response = builder.send().await?;
6101 /// # Ok(()) }
6102 ///
6103 /// fn prepare_request_builder() -> UpdateConfig {
6104 /// # panic!();
6105 /// // ... details omitted ...
6106 /// }
6107 /// ```
6108 #[derive(Clone, Debug)]
6109 pub struct UpdateConfig(RequestBuilder<crate::model::UpdateConfigRequest>);
6110
6111 impl UpdateConfig {
6112 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6113 Self(RequestBuilder::new(stub))
6114 }
6115
6116 /// Sets the full request, replacing any prior values.
6117 pub fn with_request<V: Into<crate::model::UpdateConfigRequest>>(mut self, v: V) -> Self {
6118 self.0.request = v.into();
6119 self
6120 }
6121
6122 /// Sets all the options, replacing any prior values.
6123 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6124 self.0.options = v.into();
6125 self
6126 }
6127
6128 /// Sends the request.
6129 pub async fn send(self) -> Result<crate::model::Config> {
6130 (*self.0.stub)
6131 .update_config(self.0.request, self.0.options)
6132 .await
6133 .map(crate::Response::into_body)
6134 }
6135
6136 /// Sets the value of [config][crate::model::UpdateConfigRequest::config].
6137 ///
6138 /// This is a **required** field for requests.
6139 pub fn set_config<T>(mut self, v: T) -> Self
6140 where
6141 T: std::convert::Into<crate::model::Config>,
6142 {
6143 self.0.request.config = std::option::Option::Some(v.into());
6144 self
6145 }
6146
6147 /// Sets or clears the value of [config][crate::model::UpdateConfigRequest::config].
6148 ///
6149 /// This is a **required** field for requests.
6150 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
6151 where
6152 T: std::convert::Into<crate::model::Config>,
6153 {
6154 self.0.request.config = v.map(|x| x.into());
6155 self
6156 }
6157
6158 /// Sets the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
6159 pub fn set_update_mask<T>(mut self, v: T) -> Self
6160 where
6161 T: std::convert::Into<wkt::FieldMask>,
6162 {
6163 self.0.request.update_mask = std::option::Option::Some(v.into());
6164 self
6165 }
6166
6167 /// Sets or clears the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
6168 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6169 where
6170 T: std::convert::Into<wkt::FieldMask>,
6171 {
6172 self.0.request.update_mask = v.map(|x| x.into());
6173 self
6174 }
6175 }
6176
6177 #[doc(hidden)]
6178 impl crate::RequestBuilder for UpdateConfig {
6179 fn request_options(&mut self) -> &mut crate::RequestOptions {
6180 &mut self.0.options
6181 }
6182 }
6183
6184 /// The request builder for [Dataform::get_iam_policy][crate::client::Dataform::get_iam_policy] calls.
6185 ///
6186 /// # Example
6187 /// ```
6188 /// # use google_cloud_dataform_v1::builder::dataform::GetIamPolicy;
6189 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6190 ///
6191 /// let builder = prepare_request_builder();
6192 /// let response = builder.send().await?;
6193 /// # Ok(()) }
6194 ///
6195 /// fn prepare_request_builder() -> GetIamPolicy {
6196 /// # panic!();
6197 /// // ... details omitted ...
6198 /// }
6199 /// ```
6200 #[derive(Clone, Debug)]
6201 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
6202
6203 impl GetIamPolicy {
6204 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6205 Self(RequestBuilder::new(stub))
6206 }
6207
6208 /// Sets the full request, replacing any prior values.
6209 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
6210 mut self,
6211 v: V,
6212 ) -> Self {
6213 self.0.request = v.into();
6214 self
6215 }
6216
6217 /// Sets all the options, replacing any prior values.
6218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6219 self.0.options = v.into();
6220 self
6221 }
6222
6223 /// Sends the request.
6224 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6225 (*self.0.stub)
6226 .get_iam_policy(self.0.request, self.0.options)
6227 .await
6228 .map(crate::Response::into_body)
6229 }
6230
6231 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
6232 ///
6233 /// This is a **required** field for requests.
6234 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6235 self.0.request.resource = v.into();
6236 self
6237 }
6238
6239 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6240 pub fn set_options<T>(mut self, v: T) -> Self
6241 where
6242 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6243 {
6244 self.0.request.options = std::option::Option::Some(v.into());
6245 self
6246 }
6247
6248 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
6249 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
6250 where
6251 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
6252 {
6253 self.0.request.options = v.map(|x| x.into());
6254 self
6255 }
6256 }
6257
6258 #[doc(hidden)]
6259 impl crate::RequestBuilder for GetIamPolicy {
6260 fn request_options(&mut self) -> &mut crate::RequestOptions {
6261 &mut self.0.options
6262 }
6263 }
6264
6265 /// The request builder for [Dataform::set_iam_policy][crate::client::Dataform::set_iam_policy] calls.
6266 ///
6267 /// # Example
6268 /// ```
6269 /// # use google_cloud_dataform_v1::builder::dataform::SetIamPolicy;
6270 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6271 ///
6272 /// let builder = prepare_request_builder();
6273 /// let response = builder.send().await?;
6274 /// # Ok(()) }
6275 ///
6276 /// fn prepare_request_builder() -> SetIamPolicy {
6277 /// # panic!();
6278 /// // ... details omitted ...
6279 /// }
6280 /// ```
6281 #[derive(Clone, Debug)]
6282 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
6283
6284 impl SetIamPolicy {
6285 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6286 Self(RequestBuilder::new(stub))
6287 }
6288
6289 /// Sets the full request, replacing any prior values.
6290 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
6291 mut self,
6292 v: V,
6293 ) -> Self {
6294 self.0.request = v.into();
6295 self
6296 }
6297
6298 /// Sets all the options, replacing any prior values.
6299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6300 self.0.options = v.into();
6301 self
6302 }
6303
6304 /// Sends the request.
6305 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
6306 (*self.0.stub)
6307 .set_iam_policy(self.0.request, self.0.options)
6308 .await
6309 .map(crate::Response::into_body)
6310 }
6311
6312 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
6313 ///
6314 /// This is a **required** field for requests.
6315 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6316 self.0.request.resource = v.into();
6317 self
6318 }
6319
6320 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6321 ///
6322 /// This is a **required** field for requests.
6323 pub fn set_policy<T>(mut self, v: T) -> Self
6324 where
6325 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6326 {
6327 self.0.request.policy = std::option::Option::Some(v.into());
6328 self
6329 }
6330
6331 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
6332 ///
6333 /// This is a **required** field for requests.
6334 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
6335 where
6336 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
6337 {
6338 self.0.request.policy = v.map(|x| x.into());
6339 self
6340 }
6341
6342 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6343 pub fn set_update_mask<T>(mut self, v: T) -> Self
6344 where
6345 T: std::convert::Into<wkt::FieldMask>,
6346 {
6347 self.0.request.update_mask = std::option::Option::Some(v.into());
6348 self
6349 }
6350
6351 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
6352 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6353 where
6354 T: std::convert::Into<wkt::FieldMask>,
6355 {
6356 self.0.request.update_mask = v.map(|x| x.into());
6357 self
6358 }
6359 }
6360
6361 #[doc(hidden)]
6362 impl crate::RequestBuilder for SetIamPolicy {
6363 fn request_options(&mut self) -> &mut crate::RequestOptions {
6364 &mut self.0.options
6365 }
6366 }
6367
6368 /// The request builder for [Dataform::test_iam_permissions][crate::client::Dataform::test_iam_permissions] calls.
6369 ///
6370 /// # Example
6371 /// ```
6372 /// # use google_cloud_dataform_v1::builder::dataform::TestIamPermissions;
6373 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6374 ///
6375 /// let builder = prepare_request_builder();
6376 /// let response = builder.send().await?;
6377 /// # Ok(()) }
6378 ///
6379 /// fn prepare_request_builder() -> TestIamPermissions {
6380 /// # panic!();
6381 /// // ... details omitted ...
6382 /// }
6383 /// ```
6384 #[derive(Clone, Debug)]
6385 pub struct TestIamPermissions(
6386 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
6387 );
6388
6389 impl TestIamPermissions {
6390 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6391 Self(RequestBuilder::new(stub))
6392 }
6393
6394 /// Sets the full request, replacing any prior values.
6395 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
6396 mut self,
6397 v: V,
6398 ) -> Self {
6399 self.0.request = v.into();
6400 self
6401 }
6402
6403 /// Sets all the options, replacing any prior values.
6404 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6405 self.0.options = v.into();
6406 self
6407 }
6408
6409 /// Sends the request.
6410 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
6411 (*self.0.stub)
6412 .test_iam_permissions(self.0.request, self.0.options)
6413 .await
6414 .map(crate::Response::into_body)
6415 }
6416
6417 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
6418 ///
6419 /// This is a **required** field for requests.
6420 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
6421 self.0.request.resource = v.into();
6422 self
6423 }
6424
6425 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
6426 ///
6427 /// This is a **required** field for requests.
6428 pub fn set_permissions<T, V>(mut self, v: T) -> Self
6429 where
6430 T: std::iter::IntoIterator<Item = V>,
6431 V: std::convert::Into<std::string::String>,
6432 {
6433 use std::iter::Iterator;
6434 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
6435 self
6436 }
6437 }
6438
6439 #[doc(hidden)]
6440 impl crate::RequestBuilder for TestIamPermissions {
6441 fn request_options(&mut self) -> &mut crate::RequestOptions {
6442 &mut self.0.options
6443 }
6444 }
6445
6446 /// The request builder for [Dataform::list_locations][crate::client::Dataform::list_locations] calls.
6447 ///
6448 /// # Example
6449 /// ```
6450 /// # use google_cloud_dataform_v1::builder::dataform::ListLocations;
6451 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6452 /// use google_cloud_gax::paginator::ItemPaginator;
6453 ///
6454 /// let builder = prepare_request_builder();
6455 /// let mut items = builder.by_item();
6456 /// while let Some(result) = items.next().await {
6457 /// let item = result?;
6458 /// }
6459 /// # Ok(()) }
6460 ///
6461 /// fn prepare_request_builder() -> ListLocations {
6462 /// # panic!();
6463 /// // ... details omitted ...
6464 /// }
6465 /// ```
6466 #[derive(Clone, Debug)]
6467 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6468
6469 impl ListLocations {
6470 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6471 Self(RequestBuilder::new(stub))
6472 }
6473
6474 /// Sets the full request, replacing any prior values.
6475 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6476 mut self,
6477 v: V,
6478 ) -> Self {
6479 self.0.request = v.into();
6480 self
6481 }
6482
6483 /// Sets all the options, replacing any prior values.
6484 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6485 self.0.options = v.into();
6486 self
6487 }
6488
6489 /// Sends the request.
6490 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6491 (*self.0.stub)
6492 .list_locations(self.0.request, self.0.options)
6493 .await
6494 .map(crate::Response::into_body)
6495 }
6496
6497 /// Streams each page in the collection.
6498 pub fn by_page(
6499 self,
6500 ) -> impl google_cloud_gax::paginator::Paginator<
6501 google_cloud_location::model::ListLocationsResponse,
6502 crate::Error,
6503 > {
6504 use std::clone::Clone;
6505 let token = self.0.request.page_token.clone();
6506 let execute = move |token: String| {
6507 let mut builder = self.clone();
6508 builder.0.request = builder.0.request.set_page_token(token);
6509 builder.send()
6510 };
6511 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6512 }
6513
6514 /// Streams each item in the collection.
6515 pub fn by_item(
6516 self,
6517 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6518 google_cloud_location::model::ListLocationsResponse,
6519 crate::Error,
6520 > {
6521 use google_cloud_gax::paginator::Paginator;
6522 self.by_page().items()
6523 }
6524
6525 /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
6526 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6527 self.0.request.name = v.into();
6528 self
6529 }
6530
6531 /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
6532 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6533 self.0.request.filter = v.into();
6534 self
6535 }
6536
6537 /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
6538 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6539 self.0.request.page_size = v.into();
6540 self
6541 }
6542
6543 /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
6544 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6545 self.0.request.page_token = v.into();
6546 self
6547 }
6548 }
6549
6550 #[doc(hidden)]
6551 impl crate::RequestBuilder for ListLocations {
6552 fn request_options(&mut self) -> &mut crate::RequestOptions {
6553 &mut self.0.options
6554 }
6555 }
6556
6557 /// The request builder for [Dataform::get_location][crate::client::Dataform::get_location] calls.
6558 ///
6559 /// # Example
6560 /// ```
6561 /// # use google_cloud_dataform_v1::builder::dataform::GetLocation;
6562 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6563 ///
6564 /// let builder = prepare_request_builder();
6565 /// let response = builder.send().await?;
6566 /// # Ok(()) }
6567 ///
6568 /// fn prepare_request_builder() -> GetLocation {
6569 /// # panic!();
6570 /// // ... details omitted ...
6571 /// }
6572 /// ```
6573 #[derive(Clone, Debug)]
6574 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6575
6576 impl GetLocation {
6577 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6578 Self(RequestBuilder::new(stub))
6579 }
6580
6581 /// Sets the full request, replacing any prior values.
6582 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6583 mut self,
6584 v: V,
6585 ) -> Self {
6586 self.0.request = v.into();
6587 self
6588 }
6589
6590 /// Sets all the options, replacing any prior values.
6591 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6592 self.0.options = v.into();
6593 self
6594 }
6595
6596 /// Sends the request.
6597 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6598 (*self.0.stub)
6599 .get_location(self.0.request, self.0.options)
6600 .await
6601 .map(crate::Response::into_body)
6602 }
6603
6604 /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
6605 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6606 self.0.request.name = v.into();
6607 self
6608 }
6609 }
6610
6611 #[doc(hidden)]
6612 impl crate::RequestBuilder for GetLocation {
6613 fn request_options(&mut self) -> &mut crate::RequestOptions {
6614 &mut self.0.options
6615 }
6616 }
6617
6618 /// The request builder for [Dataform::list_operations][crate::client::Dataform::list_operations] calls.
6619 ///
6620 /// # Example
6621 /// ```
6622 /// # use google_cloud_dataform_v1::builder::dataform::ListOperations;
6623 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6624 /// use google_cloud_gax::paginator::ItemPaginator;
6625 ///
6626 /// let builder = prepare_request_builder();
6627 /// let mut items = builder.by_item();
6628 /// while let Some(result) = items.next().await {
6629 /// let item = result?;
6630 /// }
6631 /// # Ok(()) }
6632 ///
6633 /// fn prepare_request_builder() -> ListOperations {
6634 /// # panic!();
6635 /// // ... details omitted ...
6636 /// }
6637 /// ```
6638 #[derive(Clone, Debug)]
6639 pub struct ListOperations(
6640 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6641 );
6642
6643 impl ListOperations {
6644 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6645 Self(RequestBuilder::new(stub))
6646 }
6647
6648 /// Sets the full request, replacing any prior values.
6649 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6650 mut self,
6651 v: V,
6652 ) -> Self {
6653 self.0.request = v.into();
6654 self
6655 }
6656
6657 /// Sets all the options, replacing any prior values.
6658 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6659 self.0.options = v.into();
6660 self
6661 }
6662
6663 /// Sends the request.
6664 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6665 (*self.0.stub)
6666 .list_operations(self.0.request, self.0.options)
6667 .await
6668 .map(crate::Response::into_body)
6669 }
6670
6671 /// Streams each page in the collection.
6672 pub fn by_page(
6673 self,
6674 ) -> impl google_cloud_gax::paginator::Paginator<
6675 google_cloud_longrunning::model::ListOperationsResponse,
6676 crate::Error,
6677 > {
6678 use std::clone::Clone;
6679 let token = self.0.request.page_token.clone();
6680 let execute = move |token: String| {
6681 let mut builder = self.clone();
6682 builder.0.request = builder.0.request.set_page_token(token);
6683 builder.send()
6684 };
6685 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6686 }
6687
6688 /// Streams each item in the collection.
6689 pub fn by_item(
6690 self,
6691 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6692 google_cloud_longrunning::model::ListOperationsResponse,
6693 crate::Error,
6694 > {
6695 use google_cloud_gax::paginator::Paginator;
6696 self.by_page().items()
6697 }
6698
6699 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
6700 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6701 self.0.request.name = v.into();
6702 self
6703 }
6704
6705 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
6706 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6707 self.0.request.filter = v.into();
6708 self
6709 }
6710
6711 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
6712 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6713 self.0.request.page_size = v.into();
6714 self
6715 }
6716
6717 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
6718 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6719 self.0.request.page_token = v.into();
6720 self
6721 }
6722
6723 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
6724 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6725 self.0.request.return_partial_success = v.into();
6726 self
6727 }
6728 }
6729
6730 #[doc(hidden)]
6731 impl crate::RequestBuilder for ListOperations {
6732 fn request_options(&mut self) -> &mut crate::RequestOptions {
6733 &mut self.0.options
6734 }
6735 }
6736
6737 /// The request builder for [Dataform::get_operation][crate::client::Dataform::get_operation] calls.
6738 ///
6739 /// # Example
6740 /// ```
6741 /// # use google_cloud_dataform_v1::builder::dataform::GetOperation;
6742 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6743 ///
6744 /// let builder = prepare_request_builder();
6745 /// let response = builder.send().await?;
6746 /// # Ok(()) }
6747 ///
6748 /// fn prepare_request_builder() -> GetOperation {
6749 /// # panic!();
6750 /// // ... details omitted ...
6751 /// }
6752 /// ```
6753 #[derive(Clone, Debug)]
6754 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6755
6756 impl GetOperation {
6757 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6758 Self(RequestBuilder::new(stub))
6759 }
6760
6761 /// Sets the full request, replacing any prior values.
6762 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6763 mut self,
6764 v: V,
6765 ) -> Self {
6766 self.0.request = v.into();
6767 self
6768 }
6769
6770 /// Sets all the options, replacing any prior values.
6771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6772 self.0.options = v.into();
6773 self
6774 }
6775
6776 /// Sends the request.
6777 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6778 (*self.0.stub)
6779 .get_operation(self.0.request, self.0.options)
6780 .await
6781 .map(crate::Response::into_body)
6782 }
6783
6784 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
6785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6786 self.0.request.name = v.into();
6787 self
6788 }
6789 }
6790
6791 #[doc(hidden)]
6792 impl crate::RequestBuilder for GetOperation {
6793 fn request_options(&mut self) -> &mut crate::RequestOptions {
6794 &mut self.0.options
6795 }
6796 }
6797
6798 /// The request builder for [Dataform::delete_operation][crate::client::Dataform::delete_operation] calls.
6799 ///
6800 /// # Example
6801 /// ```
6802 /// # use google_cloud_dataform_v1::builder::dataform::DeleteOperation;
6803 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6804 ///
6805 /// let builder = prepare_request_builder();
6806 /// let response = builder.send().await?;
6807 /// # Ok(()) }
6808 ///
6809 /// fn prepare_request_builder() -> DeleteOperation {
6810 /// # panic!();
6811 /// // ... details omitted ...
6812 /// }
6813 /// ```
6814 #[derive(Clone, Debug)]
6815 pub struct DeleteOperation(
6816 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6817 );
6818
6819 impl DeleteOperation {
6820 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6821 Self(RequestBuilder::new(stub))
6822 }
6823
6824 /// Sets the full request, replacing any prior values.
6825 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6826 mut self,
6827 v: V,
6828 ) -> Self {
6829 self.0.request = v.into();
6830 self
6831 }
6832
6833 /// Sets all the options, replacing any prior values.
6834 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6835 self.0.options = v.into();
6836 self
6837 }
6838
6839 /// Sends the request.
6840 pub async fn send(self) -> Result<()> {
6841 (*self.0.stub)
6842 .delete_operation(self.0.request, self.0.options)
6843 .await
6844 .map(crate::Response::into_body)
6845 }
6846
6847 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
6848 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6849 self.0.request.name = v.into();
6850 self
6851 }
6852 }
6853
6854 #[doc(hidden)]
6855 impl crate::RequestBuilder for DeleteOperation {
6856 fn request_options(&mut self) -> &mut crate::RequestOptions {
6857 &mut self.0.options
6858 }
6859 }
6860
6861 /// The request builder for [Dataform::cancel_operation][crate::client::Dataform::cancel_operation] calls.
6862 ///
6863 /// # Example
6864 /// ```
6865 /// # use google_cloud_dataform_v1::builder::dataform::CancelOperation;
6866 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
6867 ///
6868 /// let builder = prepare_request_builder();
6869 /// let response = builder.send().await?;
6870 /// # Ok(()) }
6871 ///
6872 /// fn prepare_request_builder() -> CancelOperation {
6873 /// # panic!();
6874 /// // ... details omitted ...
6875 /// }
6876 /// ```
6877 #[derive(Clone, Debug)]
6878 pub struct CancelOperation(
6879 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6880 );
6881
6882 impl CancelOperation {
6883 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
6884 Self(RequestBuilder::new(stub))
6885 }
6886
6887 /// Sets the full request, replacing any prior values.
6888 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6889 mut self,
6890 v: V,
6891 ) -> Self {
6892 self.0.request = v.into();
6893 self
6894 }
6895
6896 /// Sets all the options, replacing any prior values.
6897 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6898 self.0.options = v.into();
6899 self
6900 }
6901
6902 /// Sends the request.
6903 pub async fn send(self) -> Result<()> {
6904 (*self.0.stub)
6905 .cancel_operation(self.0.request, self.0.options)
6906 .await
6907 .map(crate::Response::into_body)
6908 }
6909
6910 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
6911 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6912 self.0.request.name = v.into();
6913 self
6914 }
6915 }
6916
6917 #[doc(hidden)]
6918 impl crate::RequestBuilder for CancelOperation {
6919 fn request_options(&mut self) -> &mut crate::RequestOptions {
6920 &mut self.0.options
6921 }
6922 }
6923}