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