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