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::list_repositories][crate::client::Dataform::list_repositories] calls.
72 ///
73 /// # Example
74 /// ```
75 /// # use google_cloud_dataform_v1::builder::dataform::ListRepositories;
76 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
77 /// use google_cloud_gax::paginator::ItemPaginator;
78 ///
79 /// let builder = prepare_request_builder();
80 /// let mut items = builder.by_item();
81 /// while let Some(result) = items.next().await {
82 /// let item = result?;
83 /// }
84 /// # Ok(()) }
85 ///
86 /// fn prepare_request_builder() -> ListRepositories {
87 /// # panic!();
88 /// // ... details omitted ...
89 /// }
90 /// ```
91 #[derive(Clone, Debug)]
92 pub struct ListRepositories(RequestBuilder<crate::model::ListRepositoriesRequest>);
93
94 impl ListRepositories {
95 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
96 Self(RequestBuilder::new(stub))
97 }
98
99 /// Sets the full request, replacing any prior values.
100 pub fn with_request<V: Into<crate::model::ListRepositoriesRequest>>(
101 mut self,
102 v: V,
103 ) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 /// Sets all the options, replacing any prior values.
109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 /// Sends the request.
115 pub async fn send(self) -> Result<crate::model::ListRepositoriesResponse> {
116 (*self.0.stub)
117 .list_repositories(self.0.request, self.0.options)
118 .await
119 .map(crate::Response::into_body)
120 }
121
122 /// Streams each page in the collection.
123 pub fn by_page(
124 self,
125 ) -> impl google_cloud_gax::paginator::Paginator<
126 crate::model::ListRepositoriesResponse,
127 crate::Error,
128 > {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 /// Streams each item in the collection.
140 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<
143 crate::model::ListRepositoriesResponse,
144 crate::Error,
145 > {
146 use google_cloud_gax::paginator::Paginator;
147 self.by_page().items()
148 }
149
150 /// Sets the value of [parent][crate::model::ListRepositoriesRequest::parent].
151 ///
152 /// This is a **required** field for requests.
153 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
154 self.0.request.parent = v.into();
155 self
156 }
157
158 /// Sets the value of [page_size][crate::model::ListRepositoriesRequest::page_size].
159 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
160 self.0.request.page_size = v.into();
161 self
162 }
163
164 /// Sets the value of [page_token][crate::model::ListRepositoriesRequest::page_token].
165 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
166 self.0.request.page_token = v.into();
167 self
168 }
169
170 /// Sets the value of [order_by][crate::model::ListRepositoriesRequest::order_by].
171 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
172 self.0.request.order_by = v.into();
173 self
174 }
175
176 /// Sets the value of [filter][crate::model::ListRepositoriesRequest::filter].
177 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
178 self.0.request.filter = v.into();
179 self
180 }
181 }
182
183 #[doc(hidden)]
184 impl crate::RequestBuilder for ListRepositories {
185 fn request_options(&mut self) -> &mut crate::RequestOptions {
186 &mut self.0.options
187 }
188 }
189
190 /// The request builder for [Dataform::get_repository][crate::client::Dataform::get_repository] calls.
191 ///
192 /// # Example
193 /// ```
194 /// # use google_cloud_dataform_v1::builder::dataform::GetRepository;
195 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
196 ///
197 /// let builder = prepare_request_builder();
198 /// let response = builder.send().await?;
199 /// # Ok(()) }
200 ///
201 /// fn prepare_request_builder() -> GetRepository {
202 /// # panic!();
203 /// // ... details omitted ...
204 /// }
205 /// ```
206 #[derive(Clone, Debug)]
207 pub struct GetRepository(RequestBuilder<crate::model::GetRepositoryRequest>);
208
209 impl GetRepository {
210 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 /// Sets the full request, replacing any prior values.
215 pub fn with_request<V: Into<crate::model::GetRepositoryRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 /// Sets all the options, replacing any prior values.
221 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 /// Sends the request.
227 pub async fn send(self) -> Result<crate::model::Repository> {
228 (*self.0.stub)
229 .get_repository(self.0.request, self.0.options)
230 .await
231 .map(crate::Response::into_body)
232 }
233
234 /// Sets the value of [name][crate::model::GetRepositoryRequest::name].
235 ///
236 /// This is a **required** field for requests.
237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl crate::RequestBuilder for GetRepository {
245 fn request_options(&mut self) -> &mut crate::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 /// The request builder for [Dataform::create_repository][crate::client::Dataform::create_repository] calls.
251 ///
252 /// # Example
253 /// ```
254 /// # use google_cloud_dataform_v1::builder::dataform::CreateRepository;
255 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
256 ///
257 /// let builder = prepare_request_builder();
258 /// let response = builder.send().await?;
259 /// # Ok(()) }
260 ///
261 /// fn prepare_request_builder() -> CreateRepository {
262 /// # panic!();
263 /// // ... details omitted ...
264 /// }
265 /// ```
266 #[derive(Clone, Debug)]
267 pub struct CreateRepository(RequestBuilder<crate::model::CreateRepositoryRequest>);
268
269 impl CreateRepository {
270 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
271 Self(RequestBuilder::new(stub))
272 }
273
274 /// Sets the full request, replacing any prior values.
275 pub fn with_request<V: Into<crate::model::CreateRepositoryRequest>>(
276 mut self,
277 v: V,
278 ) -> Self {
279 self.0.request = v.into();
280 self
281 }
282
283 /// Sets all the options, replacing any prior values.
284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
285 self.0.options = v.into();
286 self
287 }
288
289 /// Sends the request.
290 pub async fn send(self) -> Result<crate::model::Repository> {
291 (*self.0.stub)
292 .create_repository(self.0.request, self.0.options)
293 .await
294 .map(crate::Response::into_body)
295 }
296
297 /// Sets the value of [parent][crate::model::CreateRepositoryRequest::parent].
298 ///
299 /// This is a **required** field for requests.
300 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
301 self.0.request.parent = v.into();
302 self
303 }
304
305 /// Sets the value of [repository][crate::model::CreateRepositoryRequest::repository].
306 ///
307 /// This is a **required** field for requests.
308 pub fn set_repository<T>(mut self, v: T) -> Self
309 where
310 T: std::convert::Into<crate::model::Repository>,
311 {
312 self.0.request.repository = std::option::Option::Some(v.into());
313 self
314 }
315
316 /// Sets or clears the value of [repository][crate::model::CreateRepositoryRequest::repository].
317 ///
318 /// This is a **required** field for requests.
319 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
320 where
321 T: std::convert::Into<crate::model::Repository>,
322 {
323 self.0.request.repository = v.map(|x| x.into());
324 self
325 }
326
327 /// Sets the value of [repository_id][crate::model::CreateRepositoryRequest::repository_id].
328 ///
329 /// This is a **required** field for requests.
330 pub fn set_repository_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
331 self.0.request.repository_id = v.into();
332 self
333 }
334 }
335
336 #[doc(hidden)]
337 impl crate::RequestBuilder for CreateRepository {
338 fn request_options(&mut self) -> &mut crate::RequestOptions {
339 &mut self.0.options
340 }
341 }
342
343 /// The request builder for [Dataform::update_repository][crate::client::Dataform::update_repository] calls.
344 ///
345 /// # Example
346 /// ```
347 /// # use google_cloud_dataform_v1::builder::dataform::UpdateRepository;
348 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
349 ///
350 /// let builder = prepare_request_builder();
351 /// let response = builder.send().await?;
352 /// # Ok(()) }
353 ///
354 /// fn prepare_request_builder() -> UpdateRepository {
355 /// # panic!();
356 /// // ... details omitted ...
357 /// }
358 /// ```
359 #[derive(Clone, Debug)]
360 pub struct UpdateRepository(RequestBuilder<crate::model::UpdateRepositoryRequest>);
361
362 impl UpdateRepository {
363 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
364 Self(RequestBuilder::new(stub))
365 }
366
367 /// Sets the full request, replacing any prior values.
368 pub fn with_request<V: Into<crate::model::UpdateRepositoryRequest>>(
369 mut self,
370 v: V,
371 ) -> Self {
372 self.0.request = v.into();
373 self
374 }
375
376 /// Sets all the options, replacing any prior values.
377 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
378 self.0.options = v.into();
379 self
380 }
381
382 /// Sends the request.
383 pub async fn send(self) -> Result<crate::model::Repository> {
384 (*self.0.stub)
385 .update_repository(self.0.request, self.0.options)
386 .await
387 .map(crate::Response::into_body)
388 }
389
390 /// Sets the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
391 pub fn set_update_mask<T>(mut self, v: T) -> Self
392 where
393 T: std::convert::Into<wkt::FieldMask>,
394 {
395 self.0.request.update_mask = std::option::Option::Some(v.into());
396 self
397 }
398
399 /// Sets or clears the value of [update_mask][crate::model::UpdateRepositoryRequest::update_mask].
400 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
401 where
402 T: std::convert::Into<wkt::FieldMask>,
403 {
404 self.0.request.update_mask = v.map(|x| x.into());
405 self
406 }
407
408 /// Sets the value of [repository][crate::model::UpdateRepositoryRequest::repository].
409 ///
410 /// This is a **required** field for requests.
411 pub fn set_repository<T>(mut self, v: T) -> Self
412 where
413 T: std::convert::Into<crate::model::Repository>,
414 {
415 self.0.request.repository = std::option::Option::Some(v.into());
416 self
417 }
418
419 /// Sets or clears the value of [repository][crate::model::UpdateRepositoryRequest::repository].
420 ///
421 /// This is a **required** field for requests.
422 pub fn set_or_clear_repository<T>(mut self, v: std::option::Option<T>) -> Self
423 where
424 T: std::convert::Into<crate::model::Repository>,
425 {
426 self.0.request.repository = v.map(|x| x.into());
427 self
428 }
429 }
430
431 #[doc(hidden)]
432 impl crate::RequestBuilder for UpdateRepository {
433 fn request_options(&mut self) -> &mut crate::RequestOptions {
434 &mut self.0.options
435 }
436 }
437
438 /// The request builder for [Dataform::delete_repository][crate::client::Dataform::delete_repository] calls.
439 ///
440 /// # Example
441 /// ```
442 /// # use google_cloud_dataform_v1::builder::dataform::DeleteRepository;
443 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
444 ///
445 /// let builder = prepare_request_builder();
446 /// let response = builder.send().await?;
447 /// # Ok(()) }
448 ///
449 /// fn prepare_request_builder() -> DeleteRepository {
450 /// # panic!();
451 /// // ... details omitted ...
452 /// }
453 /// ```
454 #[derive(Clone, Debug)]
455 pub struct DeleteRepository(RequestBuilder<crate::model::DeleteRepositoryRequest>);
456
457 impl DeleteRepository {
458 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
459 Self(RequestBuilder::new(stub))
460 }
461
462 /// Sets the full request, replacing any prior values.
463 pub fn with_request<V: Into<crate::model::DeleteRepositoryRequest>>(
464 mut self,
465 v: V,
466 ) -> Self {
467 self.0.request = v.into();
468 self
469 }
470
471 /// Sets all the options, replacing any prior values.
472 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
473 self.0.options = v.into();
474 self
475 }
476
477 /// Sends the request.
478 pub async fn send(self) -> Result<()> {
479 (*self.0.stub)
480 .delete_repository(self.0.request, self.0.options)
481 .await
482 .map(crate::Response::into_body)
483 }
484
485 /// Sets the value of [name][crate::model::DeleteRepositoryRequest::name].
486 ///
487 /// This is a **required** field for requests.
488 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
489 self.0.request.name = v.into();
490 self
491 }
492
493 /// Sets the value of [force][crate::model::DeleteRepositoryRequest::force].
494 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
495 self.0.request.force = v.into();
496 self
497 }
498 }
499
500 #[doc(hidden)]
501 impl crate::RequestBuilder for DeleteRepository {
502 fn request_options(&mut self) -> &mut crate::RequestOptions {
503 &mut self.0.options
504 }
505 }
506
507 /// The request builder for [Dataform::commit_repository_changes][crate::client::Dataform::commit_repository_changes] calls.
508 ///
509 /// # Example
510 /// ```
511 /// # use google_cloud_dataform_v1::builder::dataform::CommitRepositoryChanges;
512 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
513 ///
514 /// let builder = prepare_request_builder();
515 /// let response = builder.send().await?;
516 /// # Ok(()) }
517 ///
518 /// fn prepare_request_builder() -> CommitRepositoryChanges {
519 /// # panic!();
520 /// // ... details omitted ...
521 /// }
522 /// ```
523 #[derive(Clone, Debug)]
524 pub struct CommitRepositoryChanges(
525 RequestBuilder<crate::model::CommitRepositoryChangesRequest>,
526 );
527
528 impl CommitRepositoryChanges {
529 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
530 Self(RequestBuilder::new(stub))
531 }
532
533 /// Sets the full request, replacing any prior values.
534 pub fn with_request<V: Into<crate::model::CommitRepositoryChangesRequest>>(
535 mut self,
536 v: V,
537 ) -> Self {
538 self.0.request = v.into();
539 self
540 }
541
542 /// Sets all the options, replacing any prior values.
543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
544 self.0.options = v.into();
545 self
546 }
547
548 /// Sends the request.
549 pub async fn send(self) -> Result<crate::model::CommitRepositoryChangesResponse> {
550 (*self.0.stub)
551 .commit_repository_changes(self.0.request, self.0.options)
552 .await
553 .map(crate::Response::into_body)
554 }
555
556 /// Sets the value of [name][crate::model::CommitRepositoryChangesRequest::name].
557 ///
558 /// This is a **required** field for requests.
559 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
560 self.0.request.name = v.into();
561 self
562 }
563
564 /// Sets the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
565 ///
566 /// This is a **required** field for requests.
567 pub fn set_commit_metadata<T>(mut self, v: T) -> Self
568 where
569 T: std::convert::Into<crate::model::CommitMetadata>,
570 {
571 self.0.request.commit_metadata = std::option::Option::Some(v.into());
572 self
573 }
574
575 /// Sets or clears the value of [commit_metadata][crate::model::CommitRepositoryChangesRequest::commit_metadata].
576 ///
577 /// This is a **required** field for requests.
578 pub fn set_or_clear_commit_metadata<T>(mut self, v: std::option::Option<T>) -> Self
579 where
580 T: std::convert::Into<crate::model::CommitMetadata>,
581 {
582 self.0.request.commit_metadata = v.map(|x| x.into());
583 self
584 }
585
586 /// Sets the value of [required_head_commit_sha][crate::model::CommitRepositoryChangesRequest::required_head_commit_sha].
587 pub fn set_required_head_commit_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
588 self.0.request.required_head_commit_sha = v.into();
589 self
590 }
591
592 /// Sets the value of [file_operations][crate::model::CommitRepositoryChangesRequest::file_operations].
593 pub fn set_file_operations<T, K, V>(mut self, v: T) -> Self
594 where
595 T: std::iter::IntoIterator<Item = (K, V)>,
596 K: std::convert::Into<std::string::String>,
597 V: std::convert::Into<crate::model::commit_repository_changes_request::FileOperation>,
598 {
599 self.0.request.file_operations =
600 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
601 self
602 }
603 }
604
605 #[doc(hidden)]
606 impl crate::RequestBuilder for CommitRepositoryChanges {
607 fn request_options(&mut self) -> &mut crate::RequestOptions {
608 &mut self.0.options
609 }
610 }
611
612 /// The request builder for [Dataform::read_repository_file][crate::client::Dataform::read_repository_file] calls.
613 ///
614 /// # Example
615 /// ```
616 /// # use google_cloud_dataform_v1::builder::dataform::ReadRepositoryFile;
617 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
618 ///
619 /// let builder = prepare_request_builder();
620 /// let response = builder.send().await?;
621 /// # Ok(()) }
622 ///
623 /// fn prepare_request_builder() -> ReadRepositoryFile {
624 /// # panic!();
625 /// // ... details omitted ...
626 /// }
627 /// ```
628 #[derive(Clone, Debug)]
629 pub struct ReadRepositoryFile(RequestBuilder<crate::model::ReadRepositoryFileRequest>);
630
631 impl ReadRepositoryFile {
632 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
633 Self(RequestBuilder::new(stub))
634 }
635
636 /// Sets the full request, replacing any prior values.
637 pub fn with_request<V: Into<crate::model::ReadRepositoryFileRequest>>(
638 mut self,
639 v: V,
640 ) -> Self {
641 self.0.request = v.into();
642 self
643 }
644
645 /// Sets all the options, replacing any prior values.
646 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
647 self.0.options = v.into();
648 self
649 }
650
651 /// Sends the request.
652 pub async fn send(self) -> Result<crate::model::ReadRepositoryFileResponse> {
653 (*self.0.stub)
654 .read_repository_file(self.0.request, self.0.options)
655 .await
656 .map(crate::Response::into_body)
657 }
658
659 /// Sets the value of [name][crate::model::ReadRepositoryFileRequest::name].
660 ///
661 /// This is a **required** field for requests.
662 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
663 self.0.request.name = v.into();
664 self
665 }
666
667 /// Sets the value of [commit_sha][crate::model::ReadRepositoryFileRequest::commit_sha].
668 pub fn set_commit_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
669 self.0.request.commit_sha = v.into();
670 self
671 }
672
673 /// Sets the value of [path][crate::model::ReadRepositoryFileRequest::path].
674 ///
675 /// This is a **required** field for requests.
676 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
677 self.0.request.path = v.into();
678 self
679 }
680 }
681
682 #[doc(hidden)]
683 impl crate::RequestBuilder for ReadRepositoryFile {
684 fn request_options(&mut self) -> &mut crate::RequestOptions {
685 &mut self.0.options
686 }
687 }
688
689 /// The request builder for [Dataform::query_repository_directory_contents][crate::client::Dataform::query_repository_directory_contents] calls.
690 ///
691 /// # Example
692 /// ```
693 /// # use google_cloud_dataform_v1::builder::dataform::QueryRepositoryDirectoryContents;
694 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
695 /// use google_cloud_gax::paginator::ItemPaginator;
696 ///
697 /// let builder = prepare_request_builder();
698 /// let mut items = builder.by_item();
699 /// while let Some(result) = items.next().await {
700 /// let item = result?;
701 /// }
702 /// # Ok(()) }
703 ///
704 /// fn prepare_request_builder() -> QueryRepositoryDirectoryContents {
705 /// # panic!();
706 /// // ... details omitted ...
707 /// }
708 /// ```
709 #[derive(Clone, Debug)]
710 pub struct QueryRepositoryDirectoryContents(
711 RequestBuilder<crate::model::QueryRepositoryDirectoryContentsRequest>,
712 );
713
714 impl QueryRepositoryDirectoryContents {
715 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
716 Self(RequestBuilder::new(stub))
717 }
718
719 /// Sets the full request, replacing any prior values.
720 pub fn with_request<V: Into<crate::model::QueryRepositoryDirectoryContentsRequest>>(
721 mut self,
722 v: V,
723 ) -> Self {
724 self.0.request = v.into();
725 self
726 }
727
728 /// Sets all the options, replacing any prior values.
729 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
730 self.0.options = v.into();
731 self
732 }
733
734 /// Sends the request.
735 pub async fn send(self) -> Result<crate::model::QueryRepositoryDirectoryContentsResponse> {
736 (*self.0.stub)
737 .query_repository_directory_contents(self.0.request, self.0.options)
738 .await
739 .map(crate::Response::into_body)
740 }
741
742 /// Streams each page in the collection.
743 pub fn by_page(
744 self,
745 ) -> impl google_cloud_gax::paginator::Paginator<
746 crate::model::QueryRepositoryDirectoryContentsResponse,
747 crate::Error,
748 > {
749 use std::clone::Clone;
750 let token = self.0.request.page_token.clone();
751 let execute = move |token: String| {
752 let mut builder = self.clone();
753 builder.0.request = builder.0.request.set_page_token(token);
754 builder.send()
755 };
756 google_cloud_gax::paginator::internal::new_paginator(token, execute)
757 }
758
759 /// Streams each item in the collection.
760 pub fn by_item(
761 self,
762 ) -> impl google_cloud_gax::paginator::ItemPaginator<
763 crate::model::QueryRepositoryDirectoryContentsResponse,
764 crate::Error,
765 > {
766 use google_cloud_gax::paginator::Paginator;
767 self.by_page().items()
768 }
769
770 /// Sets the value of [name][crate::model::QueryRepositoryDirectoryContentsRequest::name].
771 ///
772 /// This is a **required** field for requests.
773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
774 self.0.request.name = v.into();
775 self
776 }
777
778 /// Sets the value of [commit_sha][crate::model::QueryRepositoryDirectoryContentsRequest::commit_sha].
779 pub fn set_commit_sha<T: Into<std::string::String>>(mut self, v: T) -> Self {
780 self.0.request.commit_sha = v.into();
781 self
782 }
783
784 /// Sets the value of [path][crate::model::QueryRepositoryDirectoryContentsRequest::path].
785 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
786 self.0.request.path = v.into();
787 self
788 }
789
790 /// Sets the value of [page_size][crate::model::QueryRepositoryDirectoryContentsRequest::page_size].
791 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
792 self.0.request.page_size = v.into();
793 self
794 }
795
796 /// Sets the value of [page_token][crate::model::QueryRepositoryDirectoryContentsRequest::page_token].
797 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
798 self.0.request.page_token = v.into();
799 self
800 }
801 }
802
803 #[doc(hidden)]
804 impl crate::RequestBuilder for QueryRepositoryDirectoryContents {
805 fn request_options(&mut self) -> &mut crate::RequestOptions {
806 &mut self.0.options
807 }
808 }
809
810 /// The request builder for [Dataform::fetch_repository_history][crate::client::Dataform::fetch_repository_history] calls.
811 ///
812 /// # Example
813 /// ```
814 /// # use google_cloud_dataform_v1::builder::dataform::FetchRepositoryHistory;
815 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
816 /// use google_cloud_gax::paginator::ItemPaginator;
817 ///
818 /// let builder = prepare_request_builder();
819 /// let mut items = builder.by_item();
820 /// while let Some(result) = items.next().await {
821 /// let item = result?;
822 /// }
823 /// # Ok(()) }
824 ///
825 /// fn prepare_request_builder() -> FetchRepositoryHistory {
826 /// # panic!();
827 /// // ... details omitted ...
828 /// }
829 /// ```
830 #[derive(Clone, Debug)]
831 pub struct FetchRepositoryHistory(RequestBuilder<crate::model::FetchRepositoryHistoryRequest>);
832
833 impl FetchRepositoryHistory {
834 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
835 Self(RequestBuilder::new(stub))
836 }
837
838 /// Sets the full request, replacing any prior values.
839 pub fn with_request<V: Into<crate::model::FetchRepositoryHistoryRequest>>(
840 mut self,
841 v: V,
842 ) -> Self {
843 self.0.request = v.into();
844 self
845 }
846
847 /// Sets all the options, replacing any prior values.
848 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
849 self.0.options = v.into();
850 self
851 }
852
853 /// Sends the request.
854 pub async fn send(self) -> Result<crate::model::FetchRepositoryHistoryResponse> {
855 (*self.0.stub)
856 .fetch_repository_history(self.0.request, self.0.options)
857 .await
858 .map(crate::Response::into_body)
859 }
860
861 /// Streams each page in the collection.
862 pub fn by_page(
863 self,
864 ) -> impl google_cloud_gax::paginator::Paginator<
865 crate::model::FetchRepositoryHistoryResponse,
866 crate::Error,
867 > {
868 use std::clone::Clone;
869 let token = self.0.request.page_token.clone();
870 let execute = move |token: String| {
871 let mut builder = self.clone();
872 builder.0.request = builder.0.request.set_page_token(token);
873 builder.send()
874 };
875 google_cloud_gax::paginator::internal::new_paginator(token, execute)
876 }
877
878 /// Streams each item in the collection.
879 pub fn by_item(
880 self,
881 ) -> impl google_cloud_gax::paginator::ItemPaginator<
882 crate::model::FetchRepositoryHistoryResponse,
883 crate::Error,
884 > {
885 use google_cloud_gax::paginator::Paginator;
886 self.by_page().items()
887 }
888
889 /// Sets the value of [name][crate::model::FetchRepositoryHistoryRequest::name].
890 ///
891 /// This is a **required** field for requests.
892 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
893 self.0.request.name = v.into();
894 self
895 }
896
897 /// Sets the value of [page_size][crate::model::FetchRepositoryHistoryRequest::page_size].
898 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
899 self.0.request.page_size = v.into();
900 self
901 }
902
903 /// Sets the value of [page_token][crate::model::FetchRepositoryHistoryRequest::page_token].
904 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
905 self.0.request.page_token = v.into();
906 self
907 }
908 }
909
910 #[doc(hidden)]
911 impl crate::RequestBuilder for FetchRepositoryHistory {
912 fn request_options(&mut self) -> &mut crate::RequestOptions {
913 &mut self.0.options
914 }
915 }
916
917 /// The request builder for [Dataform::compute_repository_access_token_status][crate::client::Dataform::compute_repository_access_token_status] calls.
918 ///
919 /// # Example
920 /// ```
921 /// # use google_cloud_dataform_v1::builder::dataform::ComputeRepositoryAccessTokenStatus;
922 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
923 ///
924 /// let builder = prepare_request_builder();
925 /// let response = builder.send().await?;
926 /// # Ok(()) }
927 ///
928 /// fn prepare_request_builder() -> ComputeRepositoryAccessTokenStatus {
929 /// # panic!();
930 /// // ... details omitted ...
931 /// }
932 /// ```
933 #[derive(Clone, Debug)]
934 pub struct ComputeRepositoryAccessTokenStatus(
935 RequestBuilder<crate::model::ComputeRepositoryAccessTokenStatusRequest>,
936 );
937
938 impl ComputeRepositoryAccessTokenStatus {
939 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
940 Self(RequestBuilder::new(stub))
941 }
942
943 /// Sets the full request, replacing any prior values.
944 pub fn with_request<V: Into<crate::model::ComputeRepositoryAccessTokenStatusRequest>>(
945 mut self,
946 v: V,
947 ) -> Self {
948 self.0.request = v.into();
949 self
950 }
951
952 /// Sets all the options, replacing any prior values.
953 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
954 self.0.options = v.into();
955 self
956 }
957
958 /// Sends the request.
959 pub async fn send(
960 self,
961 ) -> Result<crate::model::ComputeRepositoryAccessTokenStatusResponse> {
962 (*self.0.stub)
963 .compute_repository_access_token_status(self.0.request, self.0.options)
964 .await
965 .map(crate::Response::into_body)
966 }
967
968 /// Sets the value of [name][crate::model::ComputeRepositoryAccessTokenStatusRequest::name].
969 ///
970 /// This is a **required** field for requests.
971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
972 self.0.request.name = v.into();
973 self
974 }
975 }
976
977 #[doc(hidden)]
978 impl crate::RequestBuilder for ComputeRepositoryAccessTokenStatus {
979 fn request_options(&mut self) -> &mut crate::RequestOptions {
980 &mut self.0.options
981 }
982 }
983
984 /// The request builder for [Dataform::fetch_remote_branches][crate::client::Dataform::fetch_remote_branches] calls.
985 ///
986 /// # Example
987 /// ```
988 /// # use google_cloud_dataform_v1::builder::dataform::FetchRemoteBranches;
989 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
990 ///
991 /// let builder = prepare_request_builder();
992 /// let response = builder.send().await?;
993 /// # Ok(()) }
994 ///
995 /// fn prepare_request_builder() -> FetchRemoteBranches {
996 /// # panic!();
997 /// // ... details omitted ...
998 /// }
999 /// ```
1000 #[derive(Clone, Debug)]
1001 pub struct FetchRemoteBranches(RequestBuilder<crate::model::FetchRemoteBranchesRequest>);
1002
1003 impl FetchRemoteBranches {
1004 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1005 Self(RequestBuilder::new(stub))
1006 }
1007
1008 /// Sets the full request, replacing any prior values.
1009 pub fn with_request<V: Into<crate::model::FetchRemoteBranchesRequest>>(
1010 mut self,
1011 v: V,
1012 ) -> Self {
1013 self.0.request = v.into();
1014 self
1015 }
1016
1017 /// Sets all the options, replacing any prior values.
1018 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1019 self.0.options = v.into();
1020 self
1021 }
1022
1023 /// Sends the request.
1024 pub async fn send(self) -> Result<crate::model::FetchRemoteBranchesResponse> {
1025 (*self.0.stub)
1026 .fetch_remote_branches(self.0.request, self.0.options)
1027 .await
1028 .map(crate::Response::into_body)
1029 }
1030
1031 /// Sets the value of [name][crate::model::FetchRemoteBranchesRequest::name].
1032 ///
1033 /// This is a **required** field for requests.
1034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1035 self.0.request.name = v.into();
1036 self
1037 }
1038 }
1039
1040 #[doc(hidden)]
1041 impl crate::RequestBuilder for FetchRemoteBranches {
1042 fn request_options(&mut self) -> &mut crate::RequestOptions {
1043 &mut self.0.options
1044 }
1045 }
1046
1047 /// The request builder for [Dataform::list_workspaces][crate::client::Dataform::list_workspaces] calls.
1048 ///
1049 /// # Example
1050 /// ```
1051 /// # use google_cloud_dataform_v1::builder::dataform::ListWorkspaces;
1052 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1053 /// use google_cloud_gax::paginator::ItemPaginator;
1054 ///
1055 /// let builder = prepare_request_builder();
1056 /// let mut items = builder.by_item();
1057 /// while let Some(result) = items.next().await {
1058 /// let item = result?;
1059 /// }
1060 /// # Ok(()) }
1061 ///
1062 /// fn prepare_request_builder() -> ListWorkspaces {
1063 /// # panic!();
1064 /// // ... details omitted ...
1065 /// }
1066 /// ```
1067 #[derive(Clone, Debug)]
1068 pub struct ListWorkspaces(RequestBuilder<crate::model::ListWorkspacesRequest>);
1069
1070 impl ListWorkspaces {
1071 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1072 Self(RequestBuilder::new(stub))
1073 }
1074
1075 /// Sets the full request, replacing any prior values.
1076 pub fn with_request<V: Into<crate::model::ListWorkspacesRequest>>(mut self, v: V) -> Self {
1077 self.0.request = v.into();
1078 self
1079 }
1080
1081 /// Sets all the options, replacing any prior values.
1082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1083 self.0.options = v.into();
1084 self
1085 }
1086
1087 /// Sends the request.
1088 pub async fn send(self) -> Result<crate::model::ListWorkspacesResponse> {
1089 (*self.0.stub)
1090 .list_workspaces(self.0.request, self.0.options)
1091 .await
1092 .map(crate::Response::into_body)
1093 }
1094
1095 /// Streams each page in the collection.
1096 pub fn by_page(
1097 self,
1098 ) -> impl google_cloud_gax::paginator::Paginator<
1099 crate::model::ListWorkspacesResponse,
1100 crate::Error,
1101 > {
1102 use std::clone::Clone;
1103 let token = self.0.request.page_token.clone();
1104 let execute = move |token: String| {
1105 let mut builder = self.clone();
1106 builder.0.request = builder.0.request.set_page_token(token);
1107 builder.send()
1108 };
1109 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1110 }
1111
1112 /// Streams each item in the collection.
1113 pub fn by_item(
1114 self,
1115 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1116 crate::model::ListWorkspacesResponse,
1117 crate::Error,
1118 > {
1119 use google_cloud_gax::paginator::Paginator;
1120 self.by_page().items()
1121 }
1122
1123 /// Sets the value of [parent][crate::model::ListWorkspacesRequest::parent].
1124 ///
1125 /// This is a **required** field for requests.
1126 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1127 self.0.request.parent = v.into();
1128 self
1129 }
1130
1131 /// Sets the value of [page_size][crate::model::ListWorkspacesRequest::page_size].
1132 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1133 self.0.request.page_size = v.into();
1134 self
1135 }
1136
1137 /// Sets the value of [page_token][crate::model::ListWorkspacesRequest::page_token].
1138 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1139 self.0.request.page_token = v.into();
1140 self
1141 }
1142
1143 /// Sets the value of [order_by][crate::model::ListWorkspacesRequest::order_by].
1144 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1145 self.0.request.order_by = v.into();
1146 self
1147 }
1148
1149 /// Sets the value of [filter][crate::model::ListWorkspacesRequest::filter].
1150 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1151 self.0.request.filter = v.into();
1152 self
1153 }
1154 }
1155
1156 #[doc(hidden)]
1157 impl crate::RequestBuilder for ListWorkspaces {
1158 fn request_options(&mut self) -> &mut crate::RequestOptions {
1159 &mut self.0.options
1160 }
1161 }
1162
1163 /// The request builder for [Dataform::get_workspace][crate::client::Dataform::get_workspace] calls.
1164 ///
1165 /// # Example
1166 /// ```
1167 /// # use google_cloud_dataform_v1::builder::dataform::GetWorkspace;
1168 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1169 ///
1170 /// let builder = prepare_request_builder();
1171 /// let response = builder.send().await?;
1172 /// # Ok(()) }
1173 ///
1174 /// fn prepare_request_builder() -> GetWorkspace {
1175 /// # panic!();
1176 /// // ... details omitted ...
1177 /// }
1178 /// ```
1179 #[derive(Clone, Debug)]
1180 pub struct GetWorkspace(RequestBuilder<crate::model::GetWorkspaceRequest>);
1181
1182 impl GetWorkspace {
1183 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1184 Self(RequestBuilder::new(stub))
1185 }
1186
1187 /// Sets the full request, replacing any prior values.
1188 pub fn with_request<V: Into<crate::model::GetWorkspaceRequest>>(mut self, v: V) -> Self {
1189 self.0.request = v.into();
1190 self
1191 }
1192
1193 /// Sets all the options, replacing any prior values.
1194 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1195 self.0.options = v.into();
1196 self
1197 }
1198
1199 /// Sends the request.
1200 pub async fn send(self) -> Result<crate::model::Workspace> {
1201 (*self.0.stub)
1202 .get_workspace(self.0.request, self.0.options)
1203 .await
1204 .map(crate::Response::into_body)
1205 }
1206
1207 /// Sets the value of [name][crate::model::GetWorkspaceRequest::name].
1208 ///
1209 /// This is a **required** field for requests.
1210 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1211 self.0.request.name = v.into();
1212 self
1213 }
1214 }
1215
1216 #[doc(hidden)]
1217 impl crate::RequestBuilder for GetWorkspace {
1218 fn request_options(&mut self) -> &mut crate::RequestOptions {
1219 &mut self.0.options
1220 }
1221 }
1222
1223 /// The request builder for [Dataform::create_workspace][crate::client::Dataform::create_workspace] calls.
1224 ///
1225 /// # Example
1226 /// ```
1227 /// # use google_cloud_dataform_v1::builder::dataform::CreateWorkspace;
1228 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1229 ///
1230 /// let builder = prepare_request_builder();
1231 /// let response = builder.send().await?;
1232 /// # Ok(()) }
1233 ///
1234 /// fn prepare_request_builder() -> CreateWorkspace {
1235 /// # panic!();
1236 /// // ... details omitted ...
1237 /// }
1238 /// ```
1239 #[derive(Clone, Debug)]
1240 pub struct CreateWorkspace(RequestBuilder<crate::model::CreateWorkspaceRequest>);
1241
1242 impl CreateWorkspace {
1243 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1244 Self(RequestBuilder::new(stub))
1245 }
1246
1247 /// Sets the full request, replacing any prior values.
1248 pub fn with_request<V: Into<crate::model::CreateWorkspaceRequest>>(mut self, v: V) -> Self {
1249 self.0.request = v.into();
1250 self
1251 }
1252
1253 /// Sets all the options, replacing any prior values.
1254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1255 self.0.options = v.into();
1256 self
1257 }
1258
1259 /// Sends the request.
1260 pub async fn send(self) -> Result<crate::model::Workspace> {
1261 (*self.0.stub)
1262 .create_workspace(self.0.request, self.0.options)
1263 .await
1264 .map(crate::Response::into_body)
1265 }
1266
1267 /// Sets the value of [parent][crate::model::CreateWorkspaceRequest::parent].
1268 ///
1269 /// This is a **required** field for requests.
1270 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1271 self.0.request.parent = v.into();
1272 self
1273 }
1274
1275 /// Sets the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
1276 ///
1277 /// This is a **required** field for requests.
1278 pub fn set_workspace<T>(mut self, v: T) -> Self
1279 where
1280 T: std::convert::Into<crate::model::Workspace>,
1281 {
1282 self.0.request.workspace = std::option::Option::Some(v.into());
1283 self
1284 }
1285
1286 /// Sets or clears the value of [workspace][crate::model::CreateWorkspaceRequest::workspace].
1287 ///
1288 /// This is a **required** field for requests.
1289 pub fn set_or_clear_workspace<T>(mut self, v: std::option::Option<T>) -> Self
1290 where
1291 T: std::convert::Into<crate::model::Workspace>,
1292 {
1293 self.0.request.workspace = v.map(|x| x.into());
1294 self
1295 }
1296
1297 /// Sets the value of [workspace_id][crate::model::CreateWorkspaceRequest::workspace_id].
1298 ///
1299 /// This is a **required** field for requests.
1300 pub fn set_workspace_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1301 self.0.request.workspace_id = v.into();
1302 self
1303 }
1304 }
1305
1306 #[doc(hidden)]
1307 impl crate::RequestBuilder for CreateWorkspace {
1308 fn request_options(&mut self) -> &mut crate::RequestOptions {
1309 &mut self.0.options
1310 }
1311 }
1312
1313 /// The request builder for [Dataform::delete_workspace][crate::client::Dataform::delete_workspace] calls.
1314 ///
1315 /// # Example
1316 /// ```
1317 /// # use google_cloud_dataform_v1::builder::dataform::DeleteWorkspace;
1318 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1319 ///
1320 /// let builder = prepare_request_builder();
1321 /// let response = builder.send().await?;
1322 /// # Ok(()) }
1323 ///
1324 /// fn prepare_request_builder() -> DeleteWorkspace {
1325 /// # panic!();
1326 /// // ... details omitted ...
1327 /// }
1328 /// ```
1329 #[derive(Clone, Debug)]
1330 pub struct DeleteWorkspace(RequestBuilder<crate::model::DeleteWorkspaceRequest>);
1331
1332 impl DeleteWorkspace {
1333 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1334 Self(RequestBuilder::new(stub))
1335 }
1336
1337 /// Sets the full request, replacing any prior values.
1338 pub fn with_request<V: Into<crate::model::DeleteWorkspaceRequest>>(mut self, v: V) -> Self {
1339 self.0.request = v.into();
1340 self
1341 }
1342
1343 /// Sets all the options, replacing any prior values.
1344 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1345 self.0.options = v.into();
1346 self
1347 }
1348
1349 /// Sends the request.
1350 pub async fn send(self) -> Result<()> {
1351 (*self.0.stub)
1352 .delete_workspace(self.0.request, self.0.options)
1353 .await
1354 .map(crate::Response::into_body)
1355 }
1356
1357 /// Sets the value of [name][crate::model::DeleteWorkspaceRequest::name].
1358 ///
1359 /// This is a **required** field for requests.
1360 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1361 self.0.request.name = v.into();
1362 self
1363 }
1364 }
1365
1366 #[doc(hidden)]
1367 impl crate::RequestBuilder for DeleteWorkspace {
1368 fn request_options(&mut self) -> &mut crate::RequestOptions {
1369 &mut self.0.options
1370 }
1371 }
1372
1373 /// The request builder for [Dataform::install_npm_packages][crate::client::Dataform::install_npm_packages] calls.
1374 ///
1375 /// # Example
1376 /// ```
1377 /// # use google_cloud_dataform_v1::builder::dataform::InstallNpmPackages;
1378 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1379 ///
1380 /// let builder = prepare_request_builder();
1381 /// let response = builder.send().await?;
1382 /// # Ok(()) }
1383 ///
1384 /// fn prepare_request_builder() -> InstallNpmPackages {
1385 /// # panic!();
1386 /// // ... details omitted ...
1387 /// }
1388 /// ```
1389 #[derive(Clone, Debug)]
1390 pub struct InstallNpmPackages(RequestBuilder<crate::model::InstallNpmPackagesRequest>);
1391
1392 impl InstallNpmPackages {
1393 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1394 Self(RequestBuilder::new(stub))
1395 }
1396
1397 /// Sets the full request, replacing any prior values.
1398 pub fn with_request<V: Into<crate::model::InstallNpmPackagesRequest>>(
1399 mut self,
1400 v: V,
1401 ) -> Self {
1402 self.0.request = v.into();
1403 self
1404 }
1405
1406 /// Sets all the options, replacing any prior values.
1407 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1408 self.0.options = v.into();
1409 self
1410 }
1411
1412 /// Sends the request.
1413 pub async fn send(self) -> Result<crate::model::InstallNpmPackagesResponse> {
1414 (*self.0.stub)
1415 .install_npm_packages(self.0.request, self.0.options)
1416 .await
1417 .map(crate::Response::into_body)
1418 }
1419
1420 /// Sets the value of [workspace][crate::model::InstallNpmPackagesRequest::workspace].
1421 ///
1422 /// This is a **required** field for requests.
1423 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
1424 self.0.request.workspace = v.into();
1425 self
1426 }
1427 }
1428
1429 #[doc(hidden)]
1430 impl crate::RequestBuilder for InstallNpmPackages {
1431 fn request_options(&mut self) -> &mut crate::RequestOptions {
1432 &mut self.0.options
1433 }
1434 }
1435
1436 /// The request builder for [Dataform::pull_git_commits][crate::client::Dataform::pull_git_commits] calls.
1437 ///
1438 /// # Example
1439 /// ```
1440 /// # use google_cloud_dataform_v1::builder::dataform::PullGitCommits;
1441 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1442 ///
1443 /// let builder = prepare_request_builder();
1444 /// let response = builder.send().await?;
1445 /// # Ok(()) }
1446 ///
1447 /// fn prepare_request_builder() -> PullGitCommits {
1448 /// # panic!();
1449 /// // ... details omitted ...
1450 /// }
1451 /// ```
1452 #[derive(Clone, Debug)]
1453 pub struct PullGitCommits(RequestBuilder<crate::model::PullGitCommitsRequest>);
1454
1455 impl PullGitCommits {
1456 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1457 Self(RequestBuilder::new(stub))
1458 }
1459
1460 /// Sets the full request, replacing any prior values.
1461 pub fn with_request<V: Into<crate::model::PullGitCommitsRequest>>(mut self, v: V) -> Self {
1462 self.0.request = v.into();
1463 self
1464 }
1465
1466 /// Sets all the options, replacing any prior values.
1467 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1468 self.0.options = v.into();
1469 self
1470 }
1471
1472 /// Sends the request.
1473 pub async fn send(self) -> Result<crate::model::PullGitCommitsResponse> {
1474 (*self.0.stub)
1475 .pull_git_commits(self.0.request, self.0.options)
1476 .await
1477 .map(crate::Response::into_body)
1478 }
1479
1480 /// Sets the value of [name][crate::model::PullGitCommitsRequest::name].
1481 ///
1482 /// This is a **required** field for requests.
1483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1484 self.0.request.name = v.into();
1485 self
1486 }
1487
1488 /// Sets the value of [remote_branch][crate::model::PullGitCommitsRequest::remote_branch].
1489 pub fn set_remote_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
1490 self.0.request.remote_branch = v.into();
1491 self
1492 }
1493
1494 /// Sets the value of [author][crate::model::PullGitCommitsRequest::author].
1495 ///
1496 /// This is a **required** field for requests.
1497 pub fn set_author<T>(mut self, v: T) -> Self
1498 where
1499 T: std::convert::Into<crate::model::CommitAuthor>,
1500 {
1501 self.0.request.author = std::option::Option::Some(v.into());
1502 self
1503 }
1504
1505 /// Sets or clears the value of [author][crate::model::PullGitCommitsRequest::author].
1506 ///
1507 /// This is a **required** field for requests.
1508 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
1509 where
1510 T: std::convert::Into<crate::model::CommitAuthor>,
1511 {
1512 self.0.request.author = v.map(|x| x.into());
1513 self
1514 }
1515 }
1516
1517 #[doc(hidden)]
1518 impl crate::RequestBuilder for PullGitCommits {
1519 fn request_options(&mut self) -> &mut crate::RequestOptions {
1520 &mut self.0.options
1521 }
1522 }
1523
1524 /// The request builder for [Dataform::push_git_commits][crate::client::Dataform::push_git_commits] calls.
1525 ///
1526 /// # Example
1527 /// ```
1528 /// # use google_cloud_dataform_v1::builder::dataform::PushGitCommits;
1529 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1530 ///
1531 /// let builder = prepare_request_builder();
1532 /// let response = builder.send().await?;
1533 /// # Ok(()) }
1534 ///
1535 /// fn prepare_request_builder() -> PushGitCommits {
1536 /// # panic!();
1537 /// // ... details omitted ...
1538 /// }
1539 /// ```
1540 #[derive(Clone, Debug)]
1541 pub struct PushGitCommits(RequestBuilder<crate::model::PushGitCommitsRequest>);
1542
1543 impl PushGitCommits {
1544 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1545 Self(RequestBuilder::new(stub))
1546 }
1547
1548 /// Sets the full request, replacing any prior values.
1549 pub fn with_request<V: Into<crate::model::PushGitCommitsRequest>>(mut self, v: V) -> Self {
1550 self.0.request = v.into();
1551 self
1552 }
1553
1554 /// Sets all the options, replacing any prior values.
1555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1556 self.0.options = v.into();
1557 self
1558 }
1559
1560 /// Sends the request.
1561 pub async fn send(self) -> Result<crate::model::PushGitCommitsResponse> {
1562 (*self.0.stub)
1563 .push_git_commits(self.0.request, self.0.options)
1564 .await
1565 .map(crate::Response::into_body)
1566 }
1567
1568 /// Sets the value of [name][crate::model::PushGitCommitsRequest::name].
1569 ///
1570 /// This is a **required** field for requests.
1571 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1572 self.0.request.name = v.into();
1573 self
1574 }
1575
1576 /// Sets the value of [remote_branch][crate::model::PushGitCommitsRequest::remote_branch].
1577 pub fn set_remote_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
1578 self.0.request.remote_branch = v.into();
1579 self
1580 }
1581 }
1582
1583 #[doc(hidden)]
1584 impl crate::RequestBuilder for PushGitCommits {
1585 fn request_options(&mut self) -> &mut crate::RequestOptions {
1586 &mut self.0.options
1587 }
1588 }
1589
1590 /// The request builder for [Dataform::fetch_file_git_statuses][crate::client::Dataform::fetch_file_git_statuses] calls.
1591 ///
1592 /// # Example
1593 /// ```
1594 /// # use google_cloud_dataform_v1::builder::dataform::FetchFileGitStatuses;
1595 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1596 ///
1597 /// let builder = prepare_request_builder();
1598 /// let response = builder.send().await?;
1599 /// # Ok(()) }
1600 ///
1601 /// fn prepare_request_builder() -> FetchFileGitStatuses {
1602 /// # panic!();
1603 /// // ... details omitted ...
1604 /// }
1605 /// ```
1606 #[derive(Clone, Debug)]
1607 pub struct FetchFileGitStatuses(RequestBuilder<crate::model::FetchFileGitStatusesRequest>);
1608
1609 impl FetchFileGitStatuses {
1610 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1611 Self(RequestBuilder::new(stub))
1612 }
1613
1614 /// Sets the full request, replacing any prior values.
1615 pub fn with_request<V: Into<crate::model::FetchFileGitStatusesRequest>>(
1616 mut self,
1617 v: V,
1618 ) -> Self {
1619 self.0.request = v.into();
1620 self
1621 }
1622
1623 /// Sets all the options, replacing any prior values.
1624 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1625 self.0.options = v.into();
1626 self
1627 }
1628
1629 /// Sends the request.
1630 pub async fn send(self) -> Result<crate::model::FetchFileGitStatusesResponse> {
1631 (*self.0.stub)
1632 .fetch_file_git_statuses(self.0.request, self.0.options)
1633 .await
1634 .map(crate::Response::into_body)
1635 }
1636
1637 /// Sets the value of [name][crate::model::FetchFileGitStatusesRequest::name].
1638 ///
1639 /// This is a **required** field for requests.
1640 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1641 self.0.request.name = v.into();
1642 self
1643 }
1644 }
1645
1646 #[doc(hidden)]
1647 impl crate::RequestBuilder for FetchFileGitStatuses {
1648 fn request_options(&mut self) -> &mut crate::RequestOptions {
1649 &mut self.0.options
1650 }
1651 }
1652
1653 /// The request builder for [Dataform::fetch_git_ahead_behind][crate::client::Dataform::fetch_git_ahead_behind] calls.
1654 ///
1655 /// # Example
1656 /// ```
1657 /// # use google_cloud_dataform_v1::builder::dataform::FetchGitAheadBehind;
1658 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1659 ///
1660 /// let builder = prepare_request_builder();
1661 /// let response = builder.send().await?;
1662 /// # Ok(()) }
1663 ///
1664 /// fn prepare_request_builder() -> FetchGitAheadBehind {
1665 /// # panic!();
1666 /// // ... details omitted ...
1667 /// }
1668 /// ```
1669 #[derive(Clone, Debug)]
1670 pub struct FetchGitAheadBehind(RequestBuilder<crate::model::FetchGitAheadBehindRequest>);
1671
1672 impl FetchGitAheadBehind {
1673 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1674 Self(RequestBuilder::new(stub))
1675 }
1676
1677 /// Sets the full request, replacing any prior values.
1678 pub fn with_request<V: Into<crate::model::FetchGitAheadBehindRequest>>(
1679 mut self,
1680 v: V,
1681 ) -> Self {
1682 self.0.request = v.into();
1683 self
1684 }
1685
1686 /// Sets all the options, replacing any prior values.
1687 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1688 self.0.options = v.into();
1689 self
1690 }
1691
1692 /// Sends the request.
1693 pub async fn send(self) -> Result<crate::model::FetchGitAheadBehindResponse> {
1694 (*self.0.stub)
1695 .fetch_git_ahead_behind(self.0.request, self.0.options)
1696 .await
1697 .map(crate::Response::into_body)
1698 }
1699
1700 /// Sets the value of [name][crate::model::FetchGitAheadBehindRequest::name].
1701 ///
1702 /// This is a **required** field for requests.
1703 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1704 self.0.request.name = v.into();
1705 self
1706 }
1707
1708 /// Sets the value of [remote_branch][crate::model::FetchGitAheadBehindRequest::remote_branch].
1709 pub fn set_remote_branch<T: Into<std::string::String>>(mut self, v: T) -> Self {
1710 self.0.request.remote_branch = v.into();
1711 self
1712 }
1713 }
1714
1715 #[doc(hidden)]
1716 impl crate::RequestBuilder for FetchGitAheadBehind {
1717 fn request_options(&mut self) -> &mut crate::RequestOptions {
1718 &mut self.0.options
1719 }
1720 }
1721
1722 /// The request builder for [Dataform::commit_workspace_changes][crate::client::Dataform::commit_workspace_changes] calls.
1723 ///
1724 /// # Example
1725 /// ```
1726 /// # use google_cloud_dataform_v1::builder::dataform::CommitWorkspaceChanges;
1727 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1728 ///
1729 /// let builder = prepare_request_builder();
1730 /// let response = builder.send().await?;
1731 /// # Ok(()) }
1732 ///
1733 /// fn prepare_request_builder() -> CommitWorkspaceChanges {
1734 /// # panic!();
1735 /// // ... details omitted ...
1736 /// }
1737 /// ```
1738 #[derive(Clone, Debug)]
1739 pub struct CommitWorkspaceChanges(RequestBuilder<crate::model::CommitWorkspaceChangesRequest>);
1740
1741 impl CommitWorkspaceChanges {
1742 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1743 Self(RequestBuilder::new(stub))
1744 }
1745
1746 /// Sets the full request, replacing any prior values.
1747 pub fn with_request<V: Into<crate::model::CommitWorkspaceChangesRequest>>(
1748 mut self,
1749 v: V,
1750 ) -> Self {
1751 self.0.request = v.into();
1752 self
1753 }
1754
1755 /// Sets all the options, replacing any prior values.
1756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1757 self.0.options = v.into();
1758 self
1759 }
1760
1761 /// Sends the request.
1762 pub async fn send(self) -> Result<crate::model::CommitWorkspaceChangesResponse> {
1763 (*self.0.stub)
1764 .commit_workspace_changes(self.0.request, self.0.options)
1765 .await
1766 .map(crate::Response::into_body)
1767 }
1768
1769 /// Sets the value of [name][crate::model::CommitWorkspaceChangesRequest::name].
1770 ///
1771 /// This is a **required** field for requests.
1772 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1773 self.0.request.name = v.into();
1774 self
1775 }
1776
1777 /// Sets the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
1778 ///
1779 /// This is a **required** field for requests.
1780 pub fn set_author<T>(mut self, v: T) -> Self
1781 where
1782 T: std::convert::Into<crate::model::CommitAuthor>,
1783 {
1784 self.0.request.author = std::option::Option::Some(v.into());
1785 self
1786 }
1787
1788 /// Sets or clears the value of [author][crate::model::CommitWorkspaceChangesRequest::author].
1789 ///
1790 /// This is a **required** field for requests.
1791 pub fn set_or_clear_author<T>(mut self, v: std::option::Option<T>) -> Self
1792 where
1793 T: std::convert::Into<crate::model::CommitAuthor>,
1794 {
1795 self.0.request.author = v.map(|x| x.into());
1796 self
1797 }
1798
1799 /// Sets the value of [commit_message][crate::model::CommitWorkspaceChangesRequest::commit_message].
1800 pub fn set_commit_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
1801 self.0.request.commit_message = v.into();
1802 self
1803 }
1804
1805 /// Sets the value of [paths][crate::model::CommitWorkspaceChangesRequest::paths].
1806 pub fn set_paths<T, V>(mut self, v: T) -> Self
1807 where
1808 T: std::iter::IntoIterator<Item = V>,
1809 V: std::convert::Into<std::string::String>,
1810 {
1811 use std::iter::Iterator;
1812 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
1813 self
1814 }
1815 }
1816
1817 #[doc(hidden)]
1818 impl crate::RequestBuilder for CommitWorkspaceChanges {
1819 fn request_options(&mut self) -> &mut crate::RequestOptions {
1820 &mut self.0.options
1821 }
1822 }
1823
1824 /// The request builder for [Dataform::reset_workspace_changes][crate::client::Dataform::reset_workspace_changes] calls.
1825 ///
1826 /// # Example
1827 /// ```
1828 /// # use google_cloud_dataform_v1::builder::dataform::ResetWorkspaceChanges;
1829 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1830 ///
1831 /// let builder = prepare_request_builder();
1832 /// let response = builder.send().await?;
1833 /// # Ok(()) }
1834 ///
1835 /// fn prepare_request_builder() -> ResetWorkspaceChanges {
1836 /// # panic!();
1837 /// // ... details omitted ...
1838 /// }
1839 /// ```
1840 #[derive(Clone, Debug)]
1841 pub struct ResetWorkspaceChanges(RequestBuilder<crate::model::ResetWorkspaceChangesRequest>);
1842
1843 impl ResetWorkspaceChanges {
1844 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1845 Self(RequestBuilder::new(stub))
1846 }
1847
1848 /// Sets the full request, replacing any prior values.
1849 pub fn with_request<V: Into<crate::model::ResetWorkspaceChangesRequest>>(
1850 mut self,
1851 v: V,
1852 ) -> Self {
1853 self.0.request = v.into();
1854 self
1855 }
1856
1857 /// Sets all the options, replacing any prior values.
1858 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1859 self.0.options = v.into();
1860 self
1861 }
1862
1863 /// Sends the request.
1864 pub async fn send(self) -> Result<crate::model::ResetWorkspaceChangesResponse> {
1865 (*self.0.stub)
1866 .reset_workspace_changes(self.0.request, self.0.options)
1867 .await
1868 .map(crate::Response::into_body)
1869 }
1870
1871 /// Sets the value of [name][crate::model::ResetWorkspaceChangesRequest::name].
1872 ///
1873 /// This is a **required** field for requests.
1874 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1875 self.0.request.name = v.into();
1876 self
1877 }
1878
1879 /// Sets the value of [paths][crate::model::ResetWorkspaceChangesRequest::paths].
1880 pub fn set_paths<T, V>(mut self, v: T) -> Self
1881 where
1882 T: std::iter::IntoIterator<Item = V>,
1883 V: std::convert::Into<std::string::String>,
1884 {
1885 use std::iter::Iterator;
1886 self.0.request.paths = v.into_iter().map(|i| i.into()).collect();
1887 self
1888 }
1889
1890 /// Sets the value of [clean][crate::model::ResetWorkspaceChangesRequest::clean].
1891 pub fn set_clean<T: Into<bool>>(mut self, v: T) -> Self {
1892 self.0.request.clean = v.into();
1893 self
1894 }
1895 }
1896
1897 #[doc(hidden)]
1898 impl crate::RequestBuilder for ResetWorkspaceChanges {
1899 fn request_options(&mut self) -> &mut crate::RequestOptions {
1900 &mut self.0.options
1901 }
1902 }
1903
1904 /// The request builder for [Dataform::fetch_file_diff][crate::client::Dataform::fetch_file_diff] calls.
1905 ///
1906 /// # Example
1907 /// ```
1908 /// # use google_cloud_dataform_v1::builder::dataform::FetchFileDiff;
1909 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1910 ///
1911 /// let builder = prepare_request_builder();
1912 /// let response = builder.send().await?;
1913 /// # Ok(()) }
1914 ///
1915 /// fn prepare_request_builder() -> FetchFileDiff {
1916 /// # panic!();
1917 /// // ... details omitted ...
1918 /// }
1919 /// ```
1920 #[derive(Clone, Debug)]
1921 pub struct FetchFileDiff(RequestBuilder<crate::model::FetchFileDiffRequest>);
1922
1923 impl FetchFileDiff {
1924 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1925 Self(RequestBuilder::new(stub))
1926 }
1927
1928 /// Sets the full request, replacing any prior values.
1929 pub fn with_request<V: Into<crate::model::FetchFileDiffRequest>>(mut self, v: V) -> Self {
1930 self.0.request = v.into();
1931 self
1932 }
1933
1934 /// Sets all the options, replacing any prior values.
1935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1936 self.0.options = v.into();
1937 self
1938 }
1939
1940 /// Sends the request.
1941 pub async fn send(self) -> Result<crate::model::FetchFileDiffResponse> {
1942 (*self.0.stub)
1943 .fetch_file_diff(self.0.request, self.0.options)
1944 .await
1945 .map(crate::Response::into_body)
1946 }
1947
1948 /// Sets the value of [workspace][crate::model::FetchFileDiffRequest::workspace].
1949 ///
1950 /// This is a **required** field for requests.
1951 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
1952 self.0.request.workspace = v.into();
1953 self
1954 }
1955
1956 /// Sets the value of [path][crate::model::FetchFileDiffRequest::path].
1957 ///
1958 /// This is a **required** field for requests.
1959 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
1960 self.0.request.path = v.into();
1961 self
1962 }
1963 }
1964
1965 #[doc(hidden)]
1966 impl crate::RequestBuilder for FetchFileDiff {
1967 fn request_options(&mut self) -> &mut crate::RequestOptions {
1968 &mut self.0.options
1969 }
1970 }
1971
1972 /// The request builder for [Dataform::query_directory_contents][crate::client::Dataform::query_directory_contents] calls.
1973 ///
1974 /// # Example
1975 /// ```
1976 /// # use google_cloud_dataform_v1::builder::dataform::QueryDirectoryContents;
1977 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
1978 /// use google_cloud_gax::paginator::ItemPaginator;
1979 ///
1980 /// let builder = prepare_request_builder();
1981 /// let mut items = builder.by_item();
1982 /// while let Some(result) = items.next().await {
1983 /// let item = result?;
1984 /// }
1985 /// # Ok(()) }
1986 ///
1987 /// fn prepare_request_builder() -> QueryDirectoryContents {
1988 /// # panic!();
1989 /// // ... details omitted ...
1990 /// }
1991 /// ```
1992 #[derive(Clone, Debug)]
1993 pub struct QueryDirectoryContents(RequestBuilder<crate::model::QueryDirectoryContentsRequest>);
1994
1995 impl QueryDirectoryContents {
1996 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
1997 Self(RequestBuilder::new(stub))
1998 }
1999
2000 /// Sets the full request, replacing any prior values.
2001 pub fn with_request<V: Into<crate::model::QueryDirectoryContentsRequest>>(
2002 mut self,
2003 v: V,
2004 ) -> Self {
2005 self.0.request = v.into();
2006 self
2007 }
2008
2009 /// Sets all the options, replacing any prior values.
2010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2011 self.0.options = v.into();
2012 self
2013 }
2014
2015 /// Sends the request.
2016 pub async fn send(self) -> Result<crate::model::QueryDirectoryContentsResponse> {
2017 (*self.0.stub)
2018 .query_directory_contents(self.0.request, self.0.options)
2019 .await
2020 .map(crate::Response::into_body)
2021 }
2022
2023 /// Streams each page in the collection.
2024 pub fn by_page(
2025 self,
2026 ) -> impl google_cloud_gax::paginator::Paginator<
2027 crate::model::QueryDirectoryContentsResponse,
2028 crate::Error,
2029 > {
2030 use std::clone::Clone;
2031 let token = self.0.request.page_token.clone();
2032 let execute = move |token: String| {
2033 let mut builder = self.clone();
2034 builder.0.request = builder.0.request.set_page_token(token);
2035 builder.send()
2036 };
2037 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2038 }
2039
2040 /// Streams each item in the collection.
2041 pub fn by_item(
2042 self,
2043 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2044 crate::model::QueryDirectoryContentsResponse,
2045 crate::Error,
2046 > {
2047 use google_cloud_gax::paginator::Paginator;
2048 self.by_page().items()
2049 }
2050
2051 /// Sets the value of [workspace][crate::model::QueryDirectoryContentsRequest::workspace].
2052 ///
2053 /// This is a **required** field for requests.
2054 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2055 self.0.request.workspace = v.into();
2056 self
2057 }
2058
2059 /// Sets the value of [path][crate::model::QueryDirectoryContentsRequest::path].
2060 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2061 self.0.request.path = v.into();
2062 self
2063 }
2064
2065 /// Sets the value of [page_size][crate::model::QueryDirectoryContentsRequest::page_size].
2066 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2067 self.0.request.page_size = v.into();
2068 self
2069 }
2070
2071 /// Sets the value of [page_token][crate::model::QueryDirectoryContentsRequest::page_token].
2072 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2073 self.0.request.page_token = v.into();
2074 self
2075 }
2076 }
2077
2078 #[doc(hidden)]
2079 impl crate::RequestBuilder for QueryDirectoryContents {
2080 fn request_options(&mut self) -> &mut crate::RequestOptions {
2081 &mut self.0.options
2082 }
2083 }
2084
2085 /// The request builder for [Dataform::search_files][crate::client::Dataform::search_files] calls.
2086 ///
2087 /// # Example
2088 /// ```
2089 /// # use google_cloud_dataform_v1::builder::dataform::SearchFiles;
2090 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2091 /// use google_cloud_gax::paginator::ItemPaginator;
2092 ///
2093 /// let builder = prepare_request_builder();
2094 /// let mut items = builder.by_item();
2095 /// while let Some(result) = items.next().await {
2096 /// let item = result?;
2097 /// }
2098 /// # Ok(()) }
2099 ///
2100 /// fn prepare_request_builder() -> SearchFiles {
2101 /// # panic!();
2102 /// // ... details omitted ...
2103 /// }
2104 /// ```
2105 #[derive(Clone, Debug)]
2106 pub struct SearchFiles(RequestBuilder<crate::model::SearchFilesRequest>);
2107
2108 impl SearchFiles {
2109 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2110 Self(RequestBuilder::new(stub))
2111 }
2112
2113 /// Sets the full request, replacing any prior values.
2114 pub fn with_request<V: Into<crate::model::SearchFilesRequest>>(mut self, v: V) -> Self {
2115 self.0.request = v.into();
2116 self
2117 }
2118
2119 /// Sets all the options, replacing any prior values.
2120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2121 self.0.options = v.into();
2122 self
2123 }
2124
2125 /// Sends the request.
2126 pub async fn send(self) -> Result<crate::model::SearchFilesResponse> {
2127 (*self.0.stub)
2128 .search_files(self.0.request, self.0.options)
2129 .await
2130 .map(crate::Response::into_body)
2131 }
2132
2133 /// Streams each page in the collection.
2134 pub fn by_page(
2135 self,
2136 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchFilesResponse, crate::Error>
2137 {
2138 use std::clone::Clone;
2139 let token = self.0.request.page_token.clone();
2140 let execute = move |token: String| {
2141 let mut builder = self.clone();
2142 builder.0.request = builder.0.request.set_page_token(token);
2143 builder.send()
2144 };
2145 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2146 }
2147
2148 /// Streams each item in the collection.
2149 pub fn by_item(
2150 self,
2151 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2152 crate::model::SearchFilesResponse,
2153 crate::Error,
2154 > {
2155 use google_cloud_gax::paginator::Paginator;
2156 self.by_page().items()
2157 }
2158
2159 /// Sets the value of [workspace][crate::model::SearchFilesRequest::workspace].
2160 ///
2161 /// This is a **required** field for requests.
2162 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2163 self.0.request.workspace = v.into();
2164 self
2165 }
2166
2167 /// Sets the value of [page_size][crate::model::SearchFilesRequest::page_size].
2168 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2169 self.0.request.page_size = v.into();
2170 self
2171 }
2172
2173 /// Sets the value of [page_token][crate::model::SearchFilesRequest::page_token].
2174 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2175 self.0.request.page_token = v.into();
2176 self
2177 }
2178
2179 /// Sets the value of [filter][crate::model::SearchFilesRequest::filter].
2180 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2181 self.0.request.filter = v.into();
2182 self
2183 }
2184 }
2185
2186 #[doc(hidden)]
2187 impl crate::RequestBuilder for SearchFiles {
2188 fn request_options(&mut self) -> &mut crate::RequestOptions {
2189 &mut self.0.options
2190 }
2191 }
2192
2193 /// The request builder for [Dataform::make_directory][crate::client::Dataform::make_directory] calls.
2194 ///
2195 /// # Example
2196 /// ```
2197 /// # use google_cloud_dataform_v1::builder::dataform::MakeDirectory;
2198 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2199 ///
2200 /// let builder = prepare_request_builder();
2201 /// let response = builder.send().await?;
2202 /// # Ok(()) }
2203 ///
2204 /// fn prepare_request_builder() -> MakeDirectory {
2205 /// # panic!();
2206 /// // ... details omitted ...
2207 /// }
2208 /// ```
2209 #[derive(Clone, Debug)]
2210 pub struct MakeDirectory(RequestBuilder<crate::model::MakeDirectoryRequest>);
2211
2212 impl MakeDirectory {
2213 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2214 Self(RequestBuilder::new(stub))
2215 }
2216
2217 /// Sets the full request, replacing any prior values.
2218 pub fn with_request<V: Into<crate::model::MakeDirectoryRequest>>(mut self, v: V) -> Self {
2219 self.0.request = v.into();
2220 self
2221 }
2222
2223 /// Sets all the options, replacing any prior values.
2224 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2225 self.0.options = v.into();
2226 self
2227 }
2228
2229 /// Sends the request.
2230 pub async fn send(self) -> Result<crate::model::MakeDirectoryResponse> {
2231 (*self.0.stub)
2232 .make_directory(self.0.request, self.0.options)
2233 .await
2234 .map(crate::Response::into_body)
2235 }
2236
2237 /// Sets the value of [workspace][crate::model::MakeDirectoryRequest::workspace].
2238 ///
2239 /// This is a **required** field for requests.
2240 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2241 self.0.request.workspace = v.into();
2242 self
2243 }
2244
2245 /// Sets the value of [path][crate::model::MakeDirectoryRequest::path].
2246 ///
2247 /// This is a **required** field for requests.
2248 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2249 self.0.request.path = v.into();
2250 self
2251 }
2252 }
2253
2254 #[doc(hidden)]
2255 impl crate::RequestBuilder for MakeDirectory {
2256 fn request_options(&mut self) -> &mut crate::RequestOptions {
2257 &mut self.0.options
2258 }
2259 }
2260
2261 /// The request builder for [Dataform::remove_directory][crate::client::Dataform::remove_directory] calls.
2262 ///
2263 /// # Example
2264 /// ```
2265 /// # use google_cloud_dataform_v1::builder::dataform::RemoveDirectory;
2266 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2267 ///
2268 /// let builder = prepare_request_builder();
2269 /// let response = builder.send().await?;
2270 /// # Ok(()) }
2271 ///
2272 /// fn prepare_request_builder() -> RemoveDirectory {
2273 /// # panic!();
2274 /// // ... details omitted ...
2275 /// }
2276 /// ```
2277 #[derive(Clone, Debug)]
2278 pub struct RemoveDirectory(RequestBuilder<crate::model::RemoveDirectoryRequest>);
2279
2280 impl RemoveDirectory {
2281 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2282 Self(RequestBuilder::new(stub))
2283 }
2284
2285 /// Sets the full request, replacing any prior values.
2286 pub fn with_request<V: Into<crate::model::RemoveDirectoryRequest>>(mut self, v: V) -> Self {
2287 self.0.request = v.into();
2288 self
2289 }
2290
2291 /// Sets all the options, replacing any prior values.
2292 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2293 self.0.options = v.into();
2294 self
2295 }
2296
2297 /// Sends the request.
2298 pub async fn send(self) -> Result<crate::model::RemoveDirectoryResponse> {
2299 (*self.0.stub)
2300 .remove_directory(self.0.request, self.0.options)
2301 .await
2302 .map(crate::Response::into_body)
2303 }
2304
2305 /// Sets the value of [workspace][crate::model::RemoveDirectoryRequest::workspace].
2306 ///
2307 /// This is a **required** field for requests.
2308 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2309 self.0.request.workspace = v.into();
2310 self
2311 }
2312
2313 /// Sets the value of [path][crate::model::RemoveDirectoryRequest::path].
2314 ///
2315 /// This is a **required** field for requests.
2316 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2317 self.0.request.path = v.into();
2318 self
2319 }
2320 }
2321
2322 #[doc(hidden)]
2323 impl crate::RequestBuilder for RemoveDirectory {
2324 fn request_options(&mut self) -> &mut crate::RequestOptions {
2325 &mut self.0.options
2326 }
2327 }
2328
2329 /// The request builder for [Dataform::move_directory][crate::client::Dataform::move_directory] calls.
2330 ///
2331 /// # Example
2332 /// ```
2333 /// # use google_cloud_dataform_v1::builder::dataform::MoveDirectory;
2334 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2335 ///
2336 /// let builder = prepare_request_builder();
2337 /// let response = builder.send().await?;
2338 /// # Ok(()) }
2339 ///
2340 /// fn prepare_request_builder() -> MoveDirectory {
2341 /// # panic!();
2342 /// // ... details omitted ...
2343 /// }
2344 /// ```
2345 #[derive(Clone, Debug)]
2346 pub struct MoveDirectory(RequestBuilder<crate::model::MoveDirectoryRequest>);
2347
2348 impl MoveDirectory {
2349 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2350 Self(RequestBuilder::new(stub))
2351 }
2352
2353 /// Sets the full request, replacing any prior values.
2354 pub fn with_request<V: Into<crate::model::MoveDirectoryRequest>>(mut self, v: V) -> Self {
2355 self.0.request = v.into();
2356 self
2357 }
2358
2359 /// Sets all the options, replacing any prior values.
2360 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2361 self.0.options = v.into();
2362 self
2363 }
2364
2365 /// Sends the request.
2366 pub async fn send(self) -> Result<crate::model::MoveDirectoryResponse> {
2367 (*self.0.stub)
2368 .move_directory(self.0.request, self.0.options)
2369 .await
2370 .map(crate::Response::into_body)
2371 }
2372
2373 /// Sets the value of [workspace][crate::model::MoveDirectoryRequest::workspace].
2374 ///
2375 /// This is a **required** field for requests.
2376 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2377 self.0.request.workspace = v.into();
2378 self
2379 }
2380
2381 /// Sets the value of [path][crate::model::MoveDirectoryRequest::path].
2382 ///
2383 /// This is a **required** field for requests.
2384 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2385 self.0.request.path = v.into();
2386 self
2387 }
2388
2389 /// Sets the value of [new_path][crate::model::MoveDirectoryRequest::new_path].
2390 ///
2391 /// This is a **required** field for requests.
2392 pub fn set_new_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2393 self.0.request.new_path = v.into();
2394 self
2395 }
2396 }
2397
2398 #[doc(hidden)]
2399 impl crate::RequestBuilder for MoveDirectory {
2400 fn request_options(&mut self) -> &mut crate::RequestOptions {
2401 &mut self.0.options
2402 }
2403 }
2404
2405 /// The request builder for [Dataform::read_file][crate::client::Dataform::read_file] calls.
2406 ///
2407 /// # Example
2408 /// ```
2409 /// # use google_cloud_dataform_v1::builder::dataform::ReadFile;
2410 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2411 ///
2412 /// let builder = prepare_request_builder();
2413 /// let response = builder.send().await?;
2414 /// # Ok(()) }
2415 ///
2416 /// fn prepare_request_builder() -> ReadFile {
2417 /// # panic!();
2418 /// // ... details omitted ...
2419 /// }
2420 /// ```
2421 #[derive(Clone, Debug)]
2422 pub struct ReadFile(RequestBuilder<crate::model::ReadFileRequest>);
2423
2424 impl ReadFile {
2425 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2426 Self(RequestBuilder::new(stub))
2427 }
2428
2429 /// Sets the full request, replacing any prior values.
2430 pub fn with_request<V: Into<crate::model::ReadFileRequest>>(mut self, v: V) -> Self {
2431 self.0.request = v.into();
2432 self
2433 }
2434
2435 /// Sets all the options, replacing any prior values.
2436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2437 self.0.options = v.into();
2438 self
2439 }
2440
2441 /// Sends the request.
2442 pub async fn send(self) -> Result<crate::model::ReadFileResponse> {
2443 (*self.0.stub)
2444 .read_file(self.0.request, self.0.options)
2445 .await
2446 .map(crate::Response::into_body)
2447 }
2448
2449 /// Sets the value of [workspace][crate::model::ReadFileRequest::workspace].
2450 ///
2451 /// This is a **required** field for requests.
2452 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2453 self.0.request.workspace = v.into();
2454 self
2455 }
2456
2457 /// Sets the value of [path][crate::model::ReadFileRequest::path].
2458 ///
2459 /// This is a **required** field for requests.
2460 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2461 self.0.request.path = v.into();
2462 self
2463 }
2464
2465 /// Sets the value of [revision][crate::model::ReadFileRequest::revision].
2466 pub fn set_revision<T: Into<std::string::String>>(mut self, v: T) -> Self {
2467 self.0.request.revision = v.into();
2468 self
2469 }
2470 }
2471
2472 #[doc(hidden)]
2473 impl crate::RequestBuilder for ReadFile {
2474 fn request_options(&mut self) -> &mut crate::RequestOptions {
2475 &mut self.0.options
2476 }
2477 }
2478
2479 /// The request builder for [Dataform::remove_file][crate::client::Dataform::remove_file] calls.
2480 ///
2481 /// # Example
2482 /// ```
2483 /// # use google_cloud_dataform_v1::builder::dataform::RemoveFile;
2484 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2485 ///
2486 /// let builder = prepare_request_builder();
2487 /// let response = builder.send().await?;
2488 /// # Ok(()) }
2489 ///
2490 /// fn prepare_request_builder() -> RemoveFile {
2491 /// # panic!();
2492 /// // ... details omitted ...
2493 /// }
2494 /// ```
2495 #[derive(Clone, Debug)]
2496 pub struct RemoveFile(RequestBuilder<crate::model::RemoveFileRequest>);
2497
2498 impl RemoveFile {
2499 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2500 Self(RequestBuilder::new(stub))
2501 }
2502
2503 /// Sets the full request, replacing any prior values.
2504 pub fn with_request<V: Into<crate::model::RemoveFileRequest>>(mut self, v: V) -> Self {
2505 self.0.request = v.into();
2506 self
2507 }
2508
2509 /// Sets all the options, replacing any prior values.
2510 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2511 self.0.options = v.into();
2512 self
2513 }
2514
2515 /// Sends the request.
2516 pub async fn send(self) -> Result<crate::model::RemoveFileResponse> {
2517 (*self.0.stub)
2518 .remove_file(self.0.request, self.0.options)
2519 .await
2520 .map(crate::Response::into_body)
2521 }
2522
2523 /// Sets the value of [workspace][crate::model::RemoveFileRequest::workspace].
2524 ///
2525 /// This is a **required** field for requests.
2526 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2527 self.0.request.workspace = v.into();
2528 self
2529 }
2530
2531 /// Sets the value of [path][crate::model::RemoveFileRequest::path].
2532 ///
2533 /// This is a **required** field for requests.
2534 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2535 self.0.request.path = v.into();
2536 self
2537 }
2538 }
2539
2540 #[doc(hidden)]
2541 impl crate::RequestBuilder for RemoveFile {
2542 fn request_options(&mut self) -> &mut crate::RequestOptions {
2543 &mut self.0.options
2544 }
2545 }
2546
2547 /// The request builder for [Dataform::move_file][crate::client::Dataform::move_file] calls.
2548 ///
2549 /// # Example
2550 /// ```
2551 /// # use google_cloud_dataform_v1::builder::dataform::MoveFile;
2552 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2553 ///
2554 /// let builder = prepare_request_builder();
2555 /// let response = builder.send().await?;
2556 /// # Ok(()) }
2557 ///
2558 /// fn prepare_request_builder() -> MoveFile {
2559 /// # panic!();
2560 /// // ... details omitted ...
2561 /// }
2562 /// ```
2563 #[derive(Clone, Debug)]
2564 pub struct MoveFile(RequestBuilder<crate::model::MoveFileRequest>);
2565
2566 impl MoveFile {
2567 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2568 Self(RequestBuilder::new(stub))
2569 }
2570
2571 /// Sets the full request, replacing any prior values.
2572 pub fn with_request<V: Into<crate::model::MoveFileRequest>>(mut self, v: V) -> Self {
2573 self.0.request = v.into();
2574 self
2575 }
2576
2577 /// Sets all the options, replacing any prior values.
2578 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2579 self.0.options = v.into();
2580 self
2581 }
2582
2583 /// Sends the request.
2584 pub async fn send(self) -> Result<crate::model::MoveFileResponse> {
2585 (*self.0.stub)
2586 .move_file(self.0.request, self.0.options)
2587 .await
2588 .map(crate::Response::into_body)
2589 }
2590
2591 /// Sets the value of [workspace][crate::model::MoveFileRequest::workspace].
2592 ///
2593 /// This is a **required** field for requests.
2594 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2595 self.0.request.workspace = v.into();
2596 self
2597 }
2598
2599 /// Sets the value of [path][crate::model::MoveFileRequest::path].
2600 ///
2601 /// This is a **required** field for requests.
2602 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2603 self.0.request.path = v.into();
2604 self
2605 }
2606
2607 /// Sets the value of [new_path][crate::model::MoveFileRequest::new_path].
2608 ///
2609 /// This is a **required** field for requests.
2610 pub fn set_new_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2611 self.0.request.new_path = v.into();
2612 self
2613 }
2614 }
2615
2616 #[doc(hidden)]
2617 impl crate::RequestBuilder for MoveFile {
2618 fn request_options(&mut self) -> &mut crate::RequestOptions {
2619 &mut self.0.options
2620 }
2621 }
2622
2623 /// The request builder for [Dataform::write_file][crate::client::Dataform::write_file] calls.
2624 ///
2625 /// # Example
2626 /// ```
2627 /// # use google_cloud_dataform_v1::builder::dataform::WriteFile;
2628 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2629 ///
2630 /// let builder = prepare_request_builder();
2631 /// let response = builder.send().await?;
2632 /// # Ok(()) }
2633 ///
2634 /// fn prepare_request_builder() -> WriteFile {
2635 /// # panic!();
2636 /// // ... details omitted ...
2637 /// }
2638 /// ```
2639 #[derive(Clone, Debug)]
2640 pub struct WriteFile(RequestBuilder<crate::model::WriteFileRequest>);
2641
2642 impl WriteFile {
2643 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2644 Self(RequestBuilder::new(stub))
2645 }
2646
2647 /// Sets the full request, replacing any prior values.
2648 pub fn with_request<V: Into<crate::model::WriteFileRequest>>(mut self, v: V) -> Self {
2649 self.0.request = v.into();
2650 self
2651 }
2652
2653 /// Sets all the options, replacing any prior values.
2654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2655 self.0.options = v.into();
2656 self
2657 }
2658
2659 /// Sends the request.
2660 pub async fn send(self) -> Result<crate::model::WriteFileResponse> {
2661 (*self.0.stub)
2662 .write_file(self.0.request, self.0.options)
2663 .await
2664 .map(crate::Response::into_body)
2665 }
2666
2667 /// Sets the value of [workspace][crate::model::WriteFileRequest::workspace].
2668 ///
2669 /// This is a **required** field for requests.
2670 pub fn set_workspace<T: Into<std::string::String>>(mut self, v: T) -> Self {
2671 self.0.request.workspace = v.into();
2672 self
2673 }
2674
2675 /// Sets the value of [path][crate::model::WriteFileRequest::path].
2676 ///
2677 /// This is a **required** field for requests.
2678 pub fn set_path<T: Into<std::string::String>>(mut self, v: T) -> Self {
2679 self.0.request.path = v.into();
2680 self
2681 }
2682
2683 /// Sets the value of [contents][crate::model::WriteFileRequest::contents].
2684 ///
2685 /// This is a **required** field for requests.
2686 pub fn set_contents<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
2687 self.0.request.contents = v.into();
2688 self
2689 }
2690 }
2691
2692 #[doc(hidden)]
2693 impl crate::RequestBuilder for WriteFile {
2694 fn request_options(&mut self) -> &mut crate::RequestOptions {
2695 &mut self.0.options
2696 }
2697 }
2698
2699 /// The request builder for [Dataform::list_release_configs][crate::client::Dataform::list_release_configs] calls.
2700 ///
2701 /// # Example
2702 /// ```
2703 /// # use google_cloud_dataform_v1::builder::dataform::ListReleaseConfigs;
2704 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2705 /// use google_cloud_gax::paginator::ItemPaginator;
2706 ///
2707 /// let builder = prepare_request_builder();
2708 /// let mut items = builder.by_item();
2709 /// while let Some(result) = items.next().await {
2710 /// let item = result?;
2711 /// }
2712 /// # Ok(()) }
2713 ///
2714 /// fn prepare_request_builder() -> ListReleaseConfigs {
2715 /// # panic!();
2716 /// // ... details omitted ...
2717 /// }
2718 /// ```
2719 #[derive(Clone, Debug)]
2720 pub struct ListReleaseConfigs(RequestBuilder<crate::model::ListReleaseConfigsRequest>);
2721
2722 impl ListReleaseConfigs {
2723 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2724 Self(RequestBuilder::new(stub))
2725 }
2726
2727 /// Sets the full request, replacing any prior values.
2728 pub fn with_request<V: Into<crate::model::ListReleaseConfigsRequest>>(
2729 mut self,
2730 v: V,
2731 ) -> Self {
2732 self.0.request = v.into();
2733 self
2734 }
2735
2736 /// Sets all the options, replacing any prior values.
2737 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2738 self.0.options = v.into();
2739 self
2740 }
2741
2742 /// Sends the request.
2743 pub async fn send(self) -> Result<crate::model::ListReleaseConfigsResponse> {
2744 (*self.0.stub)
2745 .list_release_configs(self.0.request, self.0.options)
2746 .await
2747 .map(crate::Response::into_body)
2748 }
2749
2750 /// Streams each page in the collection.
2751 pub fn by_page(
2752 self,
2753 ) -> impl google_cloud_gax::paginator::Paginator<
2754 crate::model::ListReleaseConfigsResponse,
2755 crate::Error,
2756 > {
2757 use std::clone::Clone;
2758 let token = self.0.request.page_token.clone();
2759 let execute = move |token: String| {
2760 let mut builder = self.clone();
2761 builder.0.request = builder.0.request.set_page_token(token);
2762 builder.send()
2763 };
2764 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2765 }
2766
2767 /// Streams each item in the collection.
2768 pub fn by_item(
2769 self,
2770 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2771 crate::model::ListReleaseConfigsResponse,
2772 crate::Error,
2773 > {
2774 use google_cloud_gax::paginator::Paginator;
2775 self.by_page().items()
2776 }
2777
2778 /// Sets the value of [parent][crate::model::ListReleaseConfigsRequest::parent].
2779 ///
2780 /// This is a **required** field for requests.
2781 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2782 self.0.request.parent = v.into();
2783 self
2784 }
2785
2786 /// Sets the value of [page_size][crate::model::ListReleaseConfigsRequest::page_size].
2787 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2788 self.0.request.page_size = v.into();
2789 self
2790 }
2791
2792 /// Sets the value of [page_token][crate::model::ListReleaseConfigsRequest::page_token].
2793 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2794 self.0.request.page_token = v.into();
2795 self
2796 }
2797 }
2798
2799 #[doc(hidden)]
2800 impl crate::RequestBuilder for ListReleaseConfigs {
2801 fn request_options(&mut self) -> &mut crate::RequestOptions {
2802 &mut self.0.options
2803 }
2804 }
2805
2806 /// The request builder for [Dataform::get_release_config][crate::client::Dataform::get_release_config] calls.
2807 ///
2808 /// # Example
2809 /// ```
2810 /// # use google_cloud_dataform_v1::builder::dataform::GetReleaseConfig;
2811 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2812 ///
2813 /// let builder = prepare_request_builder();
2814 /// let response = builder.send().await?;
2815 /// # Ok(()) }
2816 ///
2817 /// fn prepare_request_builder() -> GetReleaseConfig {
2818 /// # panic!();
2819 /// // ... details omitted ...
2820 /// }
2821 /// ```
2822 #[derive(Clone, Debug)]
2823 pub struct GetReleaseConfig(RequestBuilder<crate::model::GetReleaseConfigRequest>);
2824
2825 impl GetReleaseConfig {
2826 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2827 Self(RequestBuilder::new(stub))
2828 }
2829
2830 /// Sets the full request, replacing any prior values.
2831 pub fn with_request<V: Into<crate::model::GetReleaseConfigRequest>>(
2832 mut self,
2833 v: V,
2834 ) -> Self {
2835 self.0.request = v.into();
2836 self
2837 }
2838
2839 /// Sets all the options, replacing any prior values.
2840 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2841 self.0.options = v.into();
2842 self
2843 }
2844
2845 /// Sends the request.
2846 pub async fn send(self) -> Result<crate::model::ReleaseConfig> {
2847 (*self.0.stub)
2848 .get_release_config(self.0.request, self.0.options)
2849 .await
2850 .map(crate::Response::into_body)
2851 }
2852
2853 /// Sets the value of [name][crate::model::GetReleaseConfigRequest::name].
2854 ///
2855 /// This is a **required** field for requests.
2856 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2857 self.0.request.name = v.into();
2858 self
2859 }
2860 }
2861
2862 #[doc(hidden)]
2863 impl crate::RequestBuilder for GetReleaseConfig {
2864 fn request_options(&mut self) -> &mut crate::RequestOptions {
2865 &mut self.0.options
2866 }
2867 }
2868
2869 /// The request builder for [Dataform::create_release_config][crate::client::Dataform::create_release_config] calls.
2870 ///
2871 /// # Example
2872 /// ```
2873 /// # use google_cloud_dataform_v1::builder::dataform::CreateReleaseConfig;
2874 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2875 ///
2876 /// let builder = prepare_request_builder();
2877 /// let response = builder.send().await?;
2878 /// # Ok(()) }
2879 ///
2880 /// fn prepare_request_builder() -> CreateReleaseConfig {
2881 /// # panic!();
2882 /// // ... details omitted ...
2883 /// }
2884 /// ```
2885 #[derive(Clone, Debug)]
2886 pub struct CreateReleaseConfig(RequestBuilder<crate::model::CreateReleaseConfigRequest>);
2887
2888 impl CreateReleaseConfig {
2889 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2890 Self(RequestBuilder::new(stub))
2891 }
2892
2893 /// Sets the full request, replacing any prior values.
2894 pub fn with_request<V: Into<crate::model::CreateReleaseConfigRequest>>(
2895 mut self,
2896 v: V,
2897 ) -> Self {
2898 self.0.request = v.into();
2899 self
2900 }
2901
2902 /// Sets all the options, replacing any prior values.
2903 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2904 self.0.options = v.into();
2905 self
2906 }
2907
2908 /// Sends the request.
2909 pub async fn send(self) -> Result<crate::model::ReleaseConfig> {
2910 (*self.0.stub)
2911 .create_release_config(self.0.request, self.0.options)
2912 .await
2913 .map(crate::Response::into_body)
2914 }
2915
2916 /// Sets the value of [parent][crate::model::CreateReleaseConfigRequest::parent].
2917 ///
2918 /// This is a **required** field for requests.
2919 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.0.request.parent = v.into();
2921 self
2922 }
2923
2924 /// Sets the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
2925 ///
2926 /// This is a **required** field for requests.
2927 pub fn set_release_config<T>(mut self, v: T) -> Self
2928 where
2929 T: std::convert::Into<crate::model::ReleaseConfig>,
2930 {
2931 self.0.request.release_config = std::option::Option::Some(v.into());
2932 self
2933 }
2934
2935 /// Sets or clears the value of [release_config][crate::model::CreateReleaseConfigRequest::release_config].
2936 ///
2937 /// This is a **required** field for requests.
2938 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
2939 where
2940 T: std::convert::Into<crate::model::ReleaseConfig>,
2941 {
2942 self.0.request.release_config = v.map(|x| x.into());
2943 self
2944 }
2945
2946 /// Sets the value of [release_config_id][crate::model::CreateReleaseConfigRequest::release_config_id].
2947 ///
2948 /// This is a **required** field for requests.
2949 pub fn set_release_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2950 self.0.request.release_config_id = v.into();
2951 self
2952 }
2953 }
2954
2955 #[doc(hidden)]
2956 impl crate::RequestBuilder for CreateReleaseConfig {
2957 fn request_options(&mut self) -> &mut crate::RequestOptions {
2958 &mut self.0.options
2959 }
2960 }
2961
2962 /// The request builder for [Dataform::update_release_config][crate::client::Dataform::update_release_config] calls.
2963 ///
2964 /// # Example
2965 /// ```
2966 /// # use google_cloud_dataform_v1::builder::dataform::UpdateReleaseConfig;
2967 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
2968 ///
2969 /// let builder = prepare_request_builder();
2970 /// let response = builder.send().await?;
2971 /// # Ok(()) }
2972 ///
2973 /// fn prepare_request_builder() -> UpdateReleaseConfig {
2974 /// # panic!();
2975 /// // ... details omitted ...
2976 /// }
2977 /// ```
2978 #[derive(Clone, Debug)]
2979 pub struct UpdateReleaseConfig(RequestBuilder<crate::model::UpdateReleaseConfigRequest>);
2980
2981 impl UpdateReleaseConfig {
2982 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
2983 Self(RequestBuilder::new(stub))
2984 }
2985
2986 /// Sets the full request, replacing any prior values.
2987 pub fn with_request<V: Into<crate::model::UpdateReleaseConfigRequest>>(
2988 mut self,
2989 v: V,
2990 ) -> Self {
2991 self.0.request = v.into();
2992 self
2993 }
2994
2995 /// Sets all the options, replacing any prior values.
2996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2997 self.0.options = v.into();
2998 self
2999 }
3000
3001 /// Sends the request.
3002 pub async fn send(self) -> Result<crate::model::ReleaseConfig> {
3003 (*self.0.stub)
3004 .update_release_config(self.0.request, self.0.options)
3005 .await
3006 .map(crate::Response::into_body)
3007 }
3008
3009 /// Sets the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
3010 pub fn set_update_mask<T>(mut self, v: T) -> Self
3011 where
3012 T: std::convert::Into<wkt::FieldMask>,
3013 {
3014 self.0.request.update_mask = std::option::Option::Some(v.into());
3015 self
3016 }
3017
3018 /// Sets or clears the value of [update_mask][crate::model::UpdateReleaseConfigRequest::update_mask].
3019 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3020 where
3021 T: std::convert::Into<wkt::FieldMask>,
3022 {
3023 self.0.request.update_mask = v.map(|x| x.into());
3024 self
3025 }
3026
3027 /// Sets the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
3028 ///
3029 /// This is a **required** field for requests.
3030 pub fn set_release_config<T>(mut self, v: T) -> Self
3031 where
3032 T: std::convert::Into<crate::model::ReleaseConfig>,
3033 {
3034 self.0.request.release_config = std::option::Option::Some(v.into());
3035 self
3036 }
3037
3038 /// Sets or clears the value of [release_config][crate::model::UpdateReleaseConfigRequest::release_config].
3039 ///
3040 /// This is a **required** field for requests.
3041 pub fn set_or_clear_release_config<T>(mut self, v: std::option::Option<T>) -> Self
3042 where
3043 T: std::convert::Into<crate::model::ReleaseConfig>,
3044 {
3045 self.0.request.release_config = v.map(|x| x.into());
3046 self
3047 }
3048 }
3049
3050 #[doc(hidden)]
3051 impl crate::RequestBuilder for UpdateReleaseConfig {
3052 fn request_options(&mut self) -> &mut crate::RequestOptions {
3053 &mut self.0.options
3054 }
3055 }
3056
3057 /// The request builder for [Dataform::delete_release_config][crate::client::Dataform::delete_release_config] calls.
3058 ///
3059 /// # Example
3060 /// ```
3061 /// # use google_cloud_dataform_v1::builder::dataform::DeleteReleaseConfig;
3062 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3063 ///
3064 /// let builder = prepare_request_builder();
3065 /// let response = builder.send().await?;
3066 /// # Ok(()) }
3067 ///
3068 /// fn prepare_request_builder() -> DeleteReleaseConfig {
3069 /// # panic!();
3070 /// // ... details omitted ...
3071 /// }
3072 /// ```
3073 #[derive(Clone, Debug)]
3074 pub struct DeleteReleaseConfig(RequestBuilder<crate::model::DeleteReleaseConfigRequest>);
3075
3076 impl DeleteReleaseConfig {
3077 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3078 Self(RequestBuilder::new(stub))
3079 }
3080
3081 /// Sets the full request, replacing any prior values.
3082 pub fn with_request<V: Into<crate::model::DeleteReleaseConfigRequest>>(
3083 mut self,
3084 v: V,
3085 ) -> Self {
3086 self.0.request = v.into();
3087 self
3088 }
3089
3090 /// Sets all the options, replacing any prior values.
3091 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3092 self.0.options = v.into();
3093 self
3094 }
3095
3096 /// Sends the request.
3097 pub async fn send(self) -> Result<()> {
3098 (*self.0.stub)
3099 .delete_release_config(self.0.request, self.0.options)
3100 .await
3101 .map(crate::Response::into_body)
3102 }
3103
3104 /// Sets the value of [name][crate::model::DeleteReleaseConfigRequest::name].
3105 ///
3106 /// This is a **required** field for requests.
3107 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3108 self.0.request.name = v.into();
3109 self
3110 }
3111 }
3112
3113 #[doc(hidden)]
3114 impl crate::RequestBuilder for DeleteReleaseConfig {
3115 fn request_options(&mut self) -> &mut crate::RequestOptions {
3116 &mut self.0.options
3117 }
3118 }
3119
3120 /// The request builder for [Dataform::list_compilation_results][crate::client::Dataform::list_compilation_results] calls.
3121 ///
3122 /// # Example
3123 /// ```
3124 /// # use google_cloud_dataform_v1::builder::dataform::ListCompilationResults;
3125 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3126 /// use google_cloud_gax::paginator::ItemPaginator;
3127 ///
3128 /// let builder = prepare_request_builder();
3129 /// let mut items = builder.by_item();
3130 /// while let Some(result) = items.next().await {
3131 /// let item = result?;
3132 /// }
3133 /// # Ok(()) }
3134 ///
3135 /// fn prepare_request_builder() -> ListCompilationResults {
3136 /// # panic!();
3137 /// // ... details omitted ...
3138 /// }
3139 /// ```
3140 #[derive(Clone, Debug)]
3141 pub struct ListCompilationResults(RequestBuilder<crate::model::ListCompilationResultsRequest>);
3142
3143 impl ListCompilationResults {
3144 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3145 Self(RequestBuilder::new(stub))
3146 }
3147
3148 /// Sets the full request, replacing any prior values.
3149 pub fn with_request<V: Into<crate::model::ListCompilationResultsRequest>>(
3150 mut self,
3151 v: V,
3152 ) -> Self {
3153 self.0.request = v.into();
3154 self
3155 }
3156
3157 /// Sets all the options, replacing any prior values.
3158 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3159 self.0.options = v.into();
3160 self
3161 }
3162
3163 /// Sends the request.
3164 pub async fn send(self) -> Result<crate::model::ListCompilationResultsResponse> {
3165 (*self.0.stub)
3166 .list_compilation_results(self.0.request, self.0.options)
3167 .await
3168 .map(crate::Response::into_body)
3169 }
3170
3171 /// Streams each page in the collection.
3172 pub fn by_page(
3173 self,
3174 ) -> impl google_cloud_gax::paginator::Paginator<
3175 crate::model::ListCompilationResultsResponse,
3176 crate::Error,
3177 > {
3178 use std::clone::Clone;
3179 let token = self.0.request.page_token.clone();
3180 let execute = move |token: String| {
3181 let mut builder = self.clone();
3182 builder.0.request = builder.0.request.set_page_token(token);
3183 builder.send()
3184 };
3185 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3186 }
3187
3188 /// Streams each item in the collection.
3189 pub fn by_item(
3190 self,
3191 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3192 crate::model::ListCompilationResultsResponse,
3193 crate::Error,
3194 > {
3195 use google_cloud_gax::paginator::Paginator;
3196 self.by_page().items()
3197 }
3198
3199 /// Sets the value of [parent][crate::model::ListCompilationResultsRequest::parent].
3200 ///
3201 /// This is a **required** field for requests.
3202 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3203 self.0.request.parent = v.into();
3204 self
3205 }
3206
3207 /// Sets the value of [page_size][crate::model::ListCompilationResultsRequest::page_size].
3208 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3209 self.0.request.page_size = v.into();
3210 self
3211 }
3212
3213 /// Sets the value of [page_token][crate::model::ListCompilationResultsRequest::page_token].
3214 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3215 self.0.request.page_token = v.into();
3216 self
3217 }
3218
3219 /// Sets the value of [order_by][crate::model::ListCompilationResultsRequest::order_by].
3220 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3221 self.0.request.order_by = v.into();
3222 self
3223 }
3224
3225 /// Sets the value of [filter][crate::model::ListCompilationResultsRequest::filter].
3226 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3227 self.0.request.filter = v.into();
3228 self
3229 }
3230 }
3231
3232 #[doc(hidden)]
3233 impl crate::RequestBuilder for ListCompilationResults {
3234 fn request_options(&mut self) -> &mut crate::RequestOptions {
3235 &mut self.0.options
3236 }
3237 }
3238
3239 /// The request builder for [Dataform::get_compilation_result][crate::client::Dataform::get_compilation_result] calls.
3240 ///
3241 /// # Example
3242 /// ```
3243 /// # use google_cloud_dataform_v1::builder::dataform::GetCompilationResult;
3244 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3245 ///
3246 /// let builder = prepare_request_builder();
3247 /// let response = builder.send().await?;
3248 /// # Ok(()) }
3249 ///
3250 /// fn prepare_request_builder() -> GetCompilationResult {
3251 /// # panic!();
3252 /// // ... details omitted ...
3253 /// }
3254 /// ```
3255 #[derive(Clone, Debug)]
3256 pub struct GetCompilationResult(RequestBuilder<crate::model::GetCompilationResultRequest>);
3257
3258 impl GetCompilationResult {
3259 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3260 Self(RequestBuilder::new(stub))
3261 }
3262
3263 /// Sets the full request, replacing any prior values.
3264 pub fn with_request<V: Into<crate::model::GetCompilationResultRequest>>(
3265 mut self,
3266 v: V,
3267 ) -> Self {
3268 self.0.request = v.into();
3269 self
3270 }
3271
3272 /// Sets all the options, replacing any prior values.
3273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3274 self.0.options = v.into();
3275 self
3276 }
3277
3278 /// Sends the request.
3279 pub async fn send(self) -> Result<crate::model::CompilationResult> {
3280 (*self.0.stub)
3281 .get_compilation_result(self.0.request, self.0.options)
3282 .await
3283 .map(crate::Response::into_body)
3284 }
3285
3286 /// Sets the value of [name][crate::model::GetCompilationResultRequest::name].
3287 ///
3288 /// This is a **required** field for requests.
3289 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3290 self.0.request.name = v.into();
3291 self
3292 }
3293 }
3294
3295 #[doc(hidden)]
3296 impl crate::RequestBuilder for GetCompilationResult {
3297 fn request_options(&mut self) -> &mut crate::RequestOptions {
3298 &mut self.0.options
3299 }
3300 }
3301
3302 /// The request builder for [Dataform::create_compilation_result][crate::client::Dataform::create_compilation_result] calls.
3303 ///
3304 /// # Example
3305 /// ```
3306 /// # use google_cloud_dataform_v1::builder::dataform::CreateCompilationResult;
3307 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3308 ///
3309 /// let builder = prepare_request_builder();
3310 /// let response = builder.send().await?;
3311 /// # Ok(()) }
3312 ///
3313 /// fn prepare_request_builder() -> CreateCompilationResult {
3314 /// # panic!();
3315 /// // ... details omitted ...
3316 /// }
3317 /// ```
3318 #[derive(Clone, Debug)]
3319 pub struct CreateCompilationResult(
3320 RequestBuilder<crate::model::CreateCompilationResultRequest>,
3321 );
3322
3323 impl CreateCompilationResult {
3324 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3325 Self(RequestBuilder::new(stub))
3326 }
3327
3328 /// Sets the full request, replacing any prior values.
3329 pub fn with_request<V: Into<crate::model::CreateCompilationResultRequest>>(
3330 mut self,
3331 v: V,
3332 ) -> Self {
3333 self.0.request = v.into();
3334 self
3335 }
3336
3337 /// Sets all the options, replacing any prior values.
3338 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3339 self.0.options = v.into();
3340 self
3341 }
3342
3343 /// Sends the request.
3344 pub async fn send(self) -> Result<crate::model::CompilationResult> {
3345 (*self.0.stub)
3346 .create_compilation_result(self.0.request, self.0.options)
3347 .await
3348 .map(crate::Response::into_body)
3349 }
3350
3351 /// Sets the value of [parent][crate::model::CreateCompilationResultRequest::parent].
3352 ///
3353 /// This is a **required** field for requests.
3354 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3355 self.0.request.parent = v.into();
3356 self
3357 }
3358
3359 /// Sets the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
3360 ///
3361 /// This is a **required** field for requests.
3362 pub fn set_compilation_result<T>(mut self, v: T) -> Self
3363 where
3364 T: std::convert::Into<crate::model::CompilationResult>,
3365 {
3366 self.0.request.compilation_result = std::option::Option::Some(v.into());
3367 self
3368 }
3369
3370 /// Sets or clears the value of [compilation_result][crate::model::CreateCompilationResultRequest::compilation_result].
3371 ///
3372 /// This is a **required** field for requests.
3373 pub fn set_or_clear_compilation_result<T>(mut self, v: std::option::Option<T>) -> Self
3374 where
3375 T: std::convert::Into<crate::model::CompilationResult>,
3376 {
3377 self.0.request.compilation_result = v.map(|x| x.into());
3378 self
3379 }
3380 }
3381
3382 #[doc(hidden)]
3383 impl crate::RequestBuilder for CreateCompilationResult {
3384 fn request_options(&mut self) -> &mut crate::RequestOptions {
3385 &mut self.0.options
3386 }
3387 }
3388
3389 /// The request builder for [Dataform::query_compilation_result_actions][crate::client::Dataform::query_compilation_result_actions] calls.
3390 ///
3391 /// # Example
3392 /// ```
3393 /// # use google_cloud_dataform_v1::builder::dataform::QueryCompilationResultActions;
3394 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3395 /// use google_cloud_gax::paginator::ItemPaginator;
3396 ///
3397 /// let builder = prepare_request_builder();
3398 /// let mut items = builder.by_item();
3399 /// while let Some(result) = items.next().await {
3400 /// let item = result?;
3401 /// }
3402 /// # Ok(()) }
3403 ///
3404 /// fn prepare_request_builder() -> QueryCompilationResultActions {
3405 /// # panic!();
3406 /// // ... details omitted ...
3407 /// }
3408 /// ```
3409 #[derive(Clone, Debug)]
3410 pub struct QueryCompilationResultActions(
3411 RequestBuilder<crate::model::QueryCompilationResultActionsRequest>,
3412 );
3413
3414 impl QueryCompilationResultActions {
3415 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3416 Self(RequestBuilder::new(stub))
3417 }
3418
3419 /// Sets the full request, replacing any prior values.
3420 pub fn with_request<V: Into<crate::model::QueryCompilationResultActionsRequest>>(
3421 mut self,
3422 v: V,
3423 ) -> Self {
3424 self.0.request = v.into();
3425 self
3426 }
3427
3428 /// Sets all the options, replacing any prior values.
3429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3430 self.0.options = v.into();
3431 self
3432 }
3433
3434 /// Sends the request.
3435 pub async fn send(self) -> Result<crate::model::QueryCompilationResultActionsResponse> {
3436 (*self.0.stub)
3437 .query_compilation_result_actions(self.0.request, self.0.options)
3438 .await
3439 .map(crate::Response::into_body)
3440 }
3441
3442 /// Streams each page in the collection.
3443 pub fn by_page(
3444 self,
3445 ) -> impl google_cloud_gax::paginator::Paginator<
3446 crate::model::QueryCompilationResultActionsResponse,
3447 crate::Error,
3448 > {
3449 use std::clone::Clone;
3450 let token = self.0.request.page_token.clone();
3451 let execute = move |token: String| {
3452 let mut builder = self.clone();
3453 builder.0.request = builder.0.request.set_page_token(token);
3454 builder.send()
3455 };
3456 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3457 }
3458
3459 /// Streams each item in the collection.
3460 pub fn by_item(
3461 self,
3462 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3463 crate::model::QueryCompilationResultActionsResponse,
3464 crate::Error,
3465 > {
3466 use google_cloud_gax::paginator::Paginator;
3467 self.by_page().items()
3468 }
3469
3470 /// Sets the value of [name][crate::model::QueryCompilationResultActionsRequest::name].
3471 ///
3472 /// This is a **required** field for requests.
3473 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3474 self.0.request.name = v.into();
3475 self
3476 }
3477
3478 /// Sets the value of [page_size][crate::model::QueryCompilationResultActionsRequest::page_size].
3479 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3480 self.0.request.page_size = v.into();
3481 self
3482 }
3483
3484 /// Sets the value of [page_token][crate::model::QueryCompilationResultActionsRequest::page_token].
3485 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3486 self.0.request.page_token = v.into();
3487 self
3488 }
3489
3490 /// Sets the value of [filter][crate::model::QueryCompilationResultActionsRequest::filter].
3491 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3492 self.0.request.filter = v.into();
3493 self
3494 }
3495 }
3496
3497 #[doc(hidden)]
3498 impl crate::RequestBuilder for QueryCompilationResultActions {
3499 fn request_options(&mut self) -> &mut crate::RequestOptions {
3500 &mut self.0.options
3501 }
3502 }
3503
3504 /// The request builder for [Dataform::list_workflow_configs][crate::client::Dataform::list_workflow_configs] calls.
3505 ///
3506 /// # Example
3507 /// ```
3508 /// # use google_cloud_dataform_v1::builder::dataform::ListWorkflowConfigs;
3509 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3510 /// use google_cloud_gax::paginator::ItemPaginator;
3511 ///
3512 /// let builder = prepare_request_builder();
3513 /// let mut items = builder.by_item();
3514 /// while let Some(result) = items.next().await {
3515 /// let item = result?;
3516 /// }
3517 /// # Ok(()) }
3518 ///
3519 /// fn prepare_request_builder() -> ListWorkflowConfigs {
3520 /// # panic!();
3521 /// // ... details omitted ...
3522 /// }
3523 /// ```
3524 #[derive(Clone, Debug)]
3525 pub struct ListWorkflowConfigs(RequestBuilder<crate::model::ListWorkflowConfigsRequest>);
3526
3527 impl ListWorkflowConfigs {
3528 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3529 Self(RequestBuilder::new(stub))
3530 }
3531
3532 /// Sets the full request, replacing any prior values.
3533 pub fn with_request<V: Into<crate::model::ListWorkflowConfigsRequest>>(
3534 mut self,
3535 v: V,
3536 ) -> Self {
3537 self.0.request = v.into();
3538 self
3539 }
3540
3541 /// Sets all the options, replacing any prior values.
3542 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3543 self.0.options = v.into();
3544 self
3545 }
3546
3547 /// Sends the request.
3548 pub async fn send(self) -> Result<crate::model::ListWorkflowConfigsResponse> {
3549 (*self.0.stub)
3550 .list_workflow_configs(self.0.request, self.0.options)
3551 .await
3552 .map(crate::Response::into_body)
3553 }
3554
3555 /// Streams each page in the collection.
3556 pub fn by_page(
3557 self,
3558 ) -> impl google_cloud_gax::paginator::Paginator<
3559 crate::model::ListWorkflowConfigsResponse,
3560 crate::Error,
3561 > {
3562 use std::clone::Clone;
3563 let token = self.0.request.page_token.clone();
3564 let execute = move |token: String| {
3565 let mut builder = self.clone();
3566 builder.0.request = builder.0.request.set_page_token(token);
3567 builder.send()
3568 };
3569 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3570 }
3571
3572 /// Streams each item in the collection.
3573 pub fn by_item(
3574 self,
3575 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3576 crate::model::ListWorkflowConfigsResponse,
3577 crate::Error,
3578 > {
3579 use google_cloud_gax::paginator::Paginator;
3580 self.by_page().items()
3581 }
3582
3583 /// Sets the value of [parent][crate::model::ListWorkflowConfigsRequest::parent].
3584 ///
3585 /// This is a **required** field for requests.
3586 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3587 self.0.request.parent = v.into();
3588 self
3589 }
3590
3591 /// Sets the value of [page_size][crate::model::ListWorkflowConfigsRequest::page_size].
3592 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3593 self.0.request.page_size = v.into();
3594 self
3595 }
3596
3597 /// Sets the value of [page_token][crate::model::ListWorkflowConfigsRequest::page_token].
3598 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3599 self.0.request.page_token = v.into();
3600 self
3601 }
3602 }
3603
3604 #[doc(hidden)]
3605 impl crate::RequestBuilder for ListWorkflowConfigs {
3606 fn request_options(&mut self) -> &mut crate::RequestOptions {
3607 &mut self.0.options
3608 }
3609 }
3610
3611 /// The request builder for [Dataform::get_workflow_config][crate::client::Dataform::get_workflow_config] calls.
3612 ///
3613 /// # Example
3614 /// ```
3615 /// # use google_cloud_dataform_v1::builder::dataform::GetWorkflowConfig;
3616 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3617 ///
3618 /// let builder = prepare_request_builder();
3619 /// let response = builder.send().await?;
3620 /// # Ok(()) }
3621 ///
3622 /// fn prepare_request_builder() -> GetWorkflowConfig {
3623 /// # panic!();
3624 /// // ... details omitted ...
3625 /// }
3626 /// ```
3627 #[derive(Clone, Debug)]
3628 pub struct GetWorkflowConfig(RequestBuilder<crate::model::GetWorkflowConfigRequest>);
3629
3630 impl GetWorkflowConfig {
3631 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3632 Self(RequestBuilder::new(stub))
3633 }
3634
3635 /// Sets the full request, replacing any prior values.
3636 pub fn with_request<V: Into<crate::model::GetWorkflowConfigRequest>>(
3637 mut self,
3638 v: V,
3639 ) -> Self {
3640 self.0.request = v.into();
3641 self
3642 }
3643
3644 /// Sets all the options, replacing any prior values.
3645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3646 self.0.options = v.into();
3647 self
3648 }
3649
3650 /// Sends the request.
3651 pub async fn send(self) -> Result<crate::model::WorkflowConfig> {
3652 (*self.0.stub)
3653 .get_workflow_config(self.0.request, self.0.options)
3654 .await
3655 .map(crate::Response::into_body)
3656 }
3657
3658 /// Sets the value of [name][crate::model::GetWorkflowConfigRequest::name].
3659 ///
3660 /// This is a **required** field for requests.
3661 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3662 self.0.request.name = v.into();
3663 self
3664 }
3665 }
3666
3667 #[doc(hidden)]
3668 impl crate::RequestBuilder for GetWorkflowConfig {
3669 fn request_options(&mut self) -> &mut crate::RequestOptions {
3670 &mut self.0.options
3671 }
3672 }
3673
3674 /// The request builder for [Dataform::create_workflow_config][crate::client::Dataform::create_workflow_config] calls.
3675 ///
3676 /// # Example
3677 /// ```
3678 /// # use google_cloud_dataform_v1::builder::dataform::CreateWorkflowConfig;
3679 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3680 ///
3681 /// let builder = prepare_request_builder();
3682 /// let response = builder.send().await?;
3683 /// # Ok(()) }
3684 ///
3685 /// fn prepare_request_builder() -> CreateWorkflowConfig {
3686 /// # panic!();
3687 /// // ... details omitted ...
3688 /// }
3689 /// ```
3690 #[derive(Clone, Debug)]
3691 pub struct CreateWorkflowConfig(RequestBuilder<crate::model::CreateWorkflowConfigRequest>);
3692
3693 impl CreateWorkflowConfig {
3694 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3695 Self(RequestBuilder::new(stub))
3696 }
3697
3698 /// Sets the full request, replacing any prior values.
3699 pub fn with_request<V: Into<crate::model::CreateWorkflowConfigRequest>>(
3700 mut self,
3701 v: V,
3702 ) -> Self {
3703 self.0.request = v.into();
3704 self
3705 }
3706
3707 /// Sets all the options, replacing any prior values.
3708 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3709 self.0.options = v.into();
3710 self
3711 }
3712
3713 /// Sends the request.
3714 pub async fn send(self) -> Result<crate::model::WorkflowConfig> {
3715 (*self.0.stub)
3716 .create_workflow_config(self.0.request, self.0.options)
3717 .await
3718 .map(crate::Response::into_body)
3719 }
3720
3721 /// Sets the value of [parent][crate::model::CreateWorkflowConfigRequest::parent].
3722 ///
3723 /// This is a **required** field for requests.
3724 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3725 self.0.request.parent = v.into();
3726 self
3727 }
3728
3729 /// Sets the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
3730 ///
3731 /// This is a **required** field for requests.
3732 pub fn set_workflow_config<T>(mut self, v: T) -> Self
3733 where
3734 T: std::convert::Into<crate::model::WorkflowConfig>,
3735 {
3736 self.0.request.workflow_config = std::option::Option::Some(v.into());
3737 self
3738 }
3739
3740 /// Sets or clears the value of [workflow_config][crate::model::CreateWorkflowConfigRequest::workflow_config].
3741 ///
3742 /// This is a **required** field for requests.
3743 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
3744 where
3745 T: std::convert::Into<crate::model::WorkflowConfig>,
3746 {
3747 self.0.request.workflow_config = v.map(|x| x.into());
3748 self
3749 }
3750
3751 /// Sets the value of [workflow_config_id][crate::model::CreateWorkflowConfigRequest::workflow_config_id].
3752 ///
3753 /// This is a **required** field for requests.
3754 pub fn set_workflow_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3755 self.0.request.workflow_config_id = v.into();
3756 self
3757 }
3758 }
3759
3760 #[doc(hidden)]
3761 impl crate::RequestBuilder for CreateWorkflowConfig {
3762 fn request_options(&mut self) -> &mut crate::RequestOptions {
3763 &mut self.0.options
3764 }
3765 }
3766
3767 /// The request builder for [Dataform::update_workflow_config][crate::client::Dataform::update_workflow_config] calls.
3768 ///
3769 /// # Example
3770 /// ```
3771 /// # use google_cloud_dataform_v1::builder::dataform::UpdateWorkflowConfig;
3772 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3773 ///
3774 /// let builder = prepare_request_builder();
3775 /// let response = builder.send().await?;
3776 /// # Ok(()) }
3777 ///
3778 /// fn prepare_request_builder() -> UpdateWorkflowConfig {
3779 /// # panic!();
3780 /// // ... details omitted ...
3781 /// }
3782 /// ```
3783 #[derive(Clone, Debug)]
3784 pub struct UpdateWorkflowConfig(RequestBuilder<crate::model::UpdateWorkflowConfigRequest>);
3785
3786 impl UpdateWorkflowConfig {
3787 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3788 Self(RequestBuilder::new(stub))
3789 }
3790
3791 /// Sets the full request, replacing any prior values.
3792 pub fn with_request<V: Into<crate::model::UpdateWorkflowConfigRequest>>(
3793 mut self,
3794 v: V,
3795 ) -> Self {
3796 self.0.request = v.into();
3797 self
3798 }
3799
3800 /// Sets all the options, replacing any prior values.
3801 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3802 self.0.options = v.into();
3803 self
3804 }
3805
3806 /// Sends the request.
3807 pub async fn send(self) -> Result<crate::model::WorkflowConfig> {
3808 (*self.0.stub)
3809 .update_workflow_config(self.0.request, self.0.options)
3810 .await
3811 .map(crate::Response::into_body)
3812 }
3813
3814 /// Sets the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
3815 pub fn set_update_mask<T>(mut self, v: T) -> Self
3816 where
3817 T: std::convert::Into<wkt::FieldMask>,
3818 {
3819 self.0.request.update_mask = std::option::Option::Some(v.into());
3820 self
3821 }
3822
3823 /// Sets or clears the value of [update_mask][crate::model::UpdateWorkflowConfigRequest::update_mask].
3824 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3825 where
3826 T: std::convert::Into<wkt::FieldMask>,
3827 {
3828 self.0.request.update_mask = v.map(|x| x.into());
3829 self
3830 }
3831
3832 /// Sets the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
3833 ///
3834 /// This is a **required** field for requests.
3835 pub fn set_workflow_config<T>(mut self, v: T) -> Self
3836 where
3837 T: std::convert::Into<crate::model::WorkflowConfig>,
3838 {
3839 self.0.request.workflow_config = std::option::Option::Some(v.into());
3840 self
3841 }
3842
3843 /// Sets or clears the value of [workflow_config][crate::model::UpdateWorkflowConfigRequest::workflow_config].
3844 ///
3845 /// This is a **required** field for requests.
3846 pub fn set_or_clear_workflow_config<T>(mut self, v: std::option::Option<T>) -> Self
3847 where
3848 T: std::convert::Into<crate::model::WorkflowConfig>,
3849 {
3850 self.0.request.workflow_config = v.map(|x| x.into());
3851 self
3852 }
3853 }
3854
3855 #[doc(hidden)]
3856 impl crate::RequestBuilder for UpdateWorkflowConfig {
3857 fn request_options(&mut self) -> &mut crate::RequestOptions {
3858 &mut self.0.options
3859 }
3860 }
3861
3862 /// The request builder for [Dataform::delete_workflow_config][crate::client::Dataform::delete_workflow_config] calls.
3863 ///
3864 /// # Example
3865 /// ```
3866 /// # use google_cloud_dataform_v1::builder::dataform::DeleteWorkflowConfig;
3867 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3868 ///
3869 /// let builder = prepare_request_builder();
3870 /// let response = builder.send().await?;
3871 /// # Ok(()) }
3872 ///
3873 /// fn prepare_request_builder() -> DeleteWorkflowConfig {
3874 /// # panic!();
3875 /// // ... details omitted ...
3876 /// }
3877 /// ```
3878 #[derive(Clone, Debug)]
3879 pub struct DeleteWorkflowConfig(RequestBuilder<crate::model::DeleteWorkflowConfigRequest>);
3880
3881 impl DeleteWorkflowConfig {
3882 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3883 Self(RequestBuilder::new(stub))
3884 }
3885
3886 /// Sets the full request, replacing any prior values.
3887 pub fn with_request<V: Into<crate::model::DeleteWorkflowConfigRequest>>(
3888 mut self,
3889 v: V,
3890 ) -> Self {
3891 self.0.request = v.into();
3892 self
3893 }
3894
3895 /// Sets all the options, replacing any prior values.
3896 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3897 self.0.options = v.into();
3898 self
3899 }
3900
3901 /// Sends the request.
3902 pub async fn send(self) -> Result<()> {
3903 (*self.0.stub)
3904 .delete_workflow_config(self.0.request, self.0.options)
3905 .await
3906 .map(crate::Response::into_body)
3907 }
3908
3909 /// Sets the value of [name][crate::model::DeleteWorkflowConfigRequest::name].
3910 ///
3911 /// This is a **required** field for requests.
3912 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3913 self.0.request.name = v.into();
3914 self
3915 }
3916 }
3917
3918 #[doc(hidden)]
3919 impl crate::RequestBuilder for DeleteWorkflowConfig {
3920 fn request_options(&mut self) -> &mut crate::RequestOptions {
3921 &mut self.0.options
3922 }
3923 }
3924
3925 /// The request builder for [Dataform::list_workflow_invocations][crate::client::Dataform::list_workflow_invocations] calls.
3926 ///
3927 /// # Example
3928 /// ```
3929 /// # use google_cloud_dataform_v1::builder::dataform::ListWorkflowInvocations;
3930 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
3931 /// use google_cloud_gax::paginator::ItemPaginator;
3932 ///
3933 /// let builder = prepare_request_builder();
3934 /// let mut items = builder.by_item();
3935 /// while let Some(result) = items.next().await {
3936 /// let item = result?;
3937 /// }
3938 /// # Ok(()) }
3939 ///
3940 /// fn prepare_request_builder() -> ListWorkflowInvocations {
3941 /// # panic!();
3942 /// // ... details omitted ...
3943 /// }
3944 /// ```
3945 #[derive(Clone, Debug)]
3946 pub struct ListWorkflowInvocations(
3947 RequestBuilder<crate::model::ListWorkflowInvocationsRequest>,
3948 );
3949
3950 impl ListWorkflowInvocations {
3951 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
3952 Self(RequestBuilder::new(stub))
3953 }
3954
3955 /// Sets the full request, replacing any prior values.
3956 pub fn with_request<V: Into<crate::model::ListWorkflowInvocationsRequest>>(
3957 mut self,
3958 v: V,
3959 ) -> Self {
3960 self.0.request = v.into();
3961 self
3962 }
3963
3964 /// Sets all the options, replacing any prior values.
3965 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3966 self.0.options = v.into();
3967 self
3968 }
3969
3970 /// Sends the request.
3971 pub async fn send(self) -> Result<crate::model::ListWorkflowInvocationsResponse> {
3972 (*self.0.stub)
3973 .list_workflow_invocations(self.0.request, self.0.options)
3974 .await
3975 .map(crate::Response::into_body)
3976 }
3977
3978 /// Streams each page in the collection.
3979 pub fn by_page(
3980 self,
3981 ) -> impl google_cloud_gax::paginator::Paginator<
3982 crate::model::ListWorkflowInvocationsResponse,
3983 crate::Error,
3984 > {
3985 use std::clone::Clone;
3986 let token = self.0.request.page_token.clone();
3987 let execute = move |token: String| {
3988 let mut builder = self.clone();
3989 builder.0.request = builder.0.request.set_page_token(token);
3990 builder.send()
3991 };
3992 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3993 }
3994
3995 /// Streams each item in the collection.
3996 pub fn by_item(
3997 self,
3998 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3999 crate::model::ListWorkflowInvocationsResponse,
4000 crate::Error,
4001 > {
4002 use google_cloud_gax::paginator::Paginator;
4003 self.by_page().items()
4004 }
4005
4006 /// Sets the value of [parent][crate::model::ListWorkflowInvocationsRequest::parent].
4007 ///
4008 /// This is a **required** field for requests.
4009 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4010 self.0.request.parent = v.into();
4011 self
4012 }
4013
4014 /// Sets the value of [page_size][crate::model::ListWorkflowInvocationsRequest::page_size].
4015 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4016 self.0.request.page_size = v.into();
4017 self
4018 }
4019
4020 /// Sets the value of [page_token][crate::model::ListWorkflowInvocationsRequest::page_token].
4021 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4022 self.0.request.page_token = v.into();
4023 self
4024 }
4025
4026 /// Sets the value of [order_by][crate::model::ListWorkflowInvocationsRequest::order_by].
4027 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4028 self.0.request.order_by = v.into();
4029 self
4030 }
4031
4032 /// Sets the value of [filter][crate::model::ListWorkflowInvocationsRequest::filter].
4033 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4034 self.0.request.filter = v.into();
4035 self
4036 }
4037 }
4038
4039 #[doc(hidden)]
4040 impl crate::RequestBuilder for ListWorkflowInvocations {
4041 fn request_options(&mut self) -> &mut crate::RequestOptions {
4042 &mut self.0.options
4043 }
4044 }
4045
4046 /// The request builder for [Dataform::get_workflow_invocation][crate::client::Dataform::get_workflow_invocation] calls.
4047 ///
4048 /// # Example
4049 /// ```
4050 /// # use google_cloud_dataform_v1::builder::dataform::GetWorkflowInvocation;
4051 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4052 ///
4053 /// let builder = prepare_request_builder();
4054 /// let response = builder.send().await?;
4055 /// # Ok(()) }
4056 ///
4057 /// fn prepare_request_builder() -> GetWorkflowInvocation {
4058 /// # panic!();
4059 /// // ... details omitted ...
4060 /// }
4061 /// ```
4062 #[derive(Clone, Debug)]
4063 pub struct GetWorkflowInvocation(RequestBuilder<crate::model::GetWorkflowInvocationRequest>);
4064
4065 impl GetWorkflowInvocation {
4066 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4067 Self(RequestBuilder::new(stub))
4068 }
4069
4070 /// Sets the full request, replacing any prior values.
4071 pub fn with_request<V: Into<crate::model::GetWorkflowInvocationRequest>>(
4072 mut self,
4073 v: V,
4074 ) -> Self {
4075 self.0.request = v.into();
4076 self
4077 }
4078
4079 /// Sets all the options, replacing any prior values.
4080 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4081 self.0.options = v.into();
4082 self
4083 }
4084
4085 /// Sends the request.
4086 pub async fn send(self) -> Result<crate::model::WorkflowInvocation> {
4087 (*self.0.stub)
4088 .get_workflow_invocation(self.0.request, self.0.options)
4089 .await
4090 .map(crate::Response::into_body)
4091 }
4092
4093 /// Sets the value of [name][crate::model::GetWorkflowInvocationRequest::name].
4094 ///
4095 /// This is a **required** field for requests.
4096 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4097 self.0.request.name = v.into();
4098 self
4099 }
4100 }
4101
4102 #[doc(hidden)]
4103 impl crate::RequestBuilder for GetWorkflowInvocation {
4104 fn request_options(&mut self) -> &mut crate::RequestOptions {
4105 &mut self.0.options
4106 }
4107 }
4108
4109 /// The request builder for [Dataform::create_workflow_invocation][crate::client::Dataform::create_workflow_invocation] calls.
4110 ///
4111 /// # Example
4112 /// ```
4113 /// # use google_cloud_dataform_v1::builder::dataform::CreateWorkflowInvocation;
4114 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4115 ///
4116 /// let builder = prepare_request_builder();
4117 /// let response = builder.send().await?;
4118 /// # Ok(()) }
4119 ///
4120 /// fn prepare_request_builder() -> CreateWorkflowInvocation {
4121 /// # panic!();
4122 /// // ... details omitted ...
4123 /// }
4124 /// ```
4125 #[derive(Clone, Debug)]
4126 pub struct CreateWorkflowInvocation(
4127 RequestBuilder<crate::model::CreateWorkflowInvocationRequest>,
4128 );
4129
4130 impl CreateWorkflowInvocation {
4131 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4132 Self(RequestBuilder::new(stub))
4133 }
4134
4135 /// Sets the full request, replacing any prior values.
4136 pub fn with_request<V: Into<crate::model::CreateWorkflowInvocationRequest>>(
4137 mut self,
4138 v: V,
4139 ) -> Self {
4140 self.0.request = v.into();
4141 self
4142 }
4143
4144 /// Sets all the options, replacing any prior values.
4145 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4146 self.0.options = v.into();
4147 self
4148 }
4149
4150 /// Sends the request.
4151 pub async fn send(self) -> Result<crate::model::WorkflowInvocation> {
4152 (*self.0.stub)
4153 .create_workflow_invocation(self.0.request, self.0.options)
4154 .await
4155 .map(crate::Response::into_body)
4156 }
4157
4158 /// Sets the value of [parent][crate::model::CreateWorkflowInvocationRequest::parent].
4159 ///
4160 /// This is a **required** field for requests.
4161 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4162 self.0.request.parent = v.into();
4163 self
4164 }
4165
4166 /// Sets the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
4167 ///
4168 /// This is a **required** field for requests.
4169 pub fn set_workflow_invocation<T>(mut self, v: T) -> Self
4170 where
4171 T: std::convert::Into<crate::model::WorkflowInvocation>,
4172 {
4173 self.0.request.workflow_invocation = std::option::Option::Some(v.into());
4174 self
4175 }
4176
4177 /// Sets or clears the value of [workflow_invocation][crate::model::CreateWorkflowInvocationRequest::workflow_invocation].
4178 ///
4179 /// This is a **required** field for requests.
4180 pub fn set_or_clear_workflow_invocation<T>(mut self, v: std::option::Option<T>) -> Self
4181 where
4182 T: std::convert::Into<crate::model::WorkflowInvocation>,
4183 {
4184 self.0.request.workflow_invocation = v.map(|x| x.into());
4185 self
4186 }
4187 }
4188
4189 #[doc(hidden)]
4190 impl crate::RequestBuilder for CreateWorkflowInvocation {
4191 fn request_options(&mut self) -> &mut crate::RequestOptions {
4192 &mut self.0.options
4193 }
4194 }
4195
4196 /// The request builder for [Dataform::delete_workflow_invocation][crate::client::Dataform::delete_workflow_invocation] calls.
4197 ///
4198 /// # Example
4199 /// ```
4200 /// # use google_cloud_dataform_v1::builder::dataform::DeleteWorkflowInvocation;
4201 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4202 ///
4203 /// let builder = prepare_request_builder();
4204 /// let response = builder.send().await?;
4205 /// # Ok(()) }
4206 ///
4207 /// fn prepare_request_builder() -> DeleteWorkflowInvocation {
4208 /// # panic!();
4209 /// // ... details omitted ...
4210 /// }
4211 /// ```
4212 #[derive(Clone, Debug)]
4213 pub struct DeleteWorkflowInvocation(
4214 RequestBuilder<crate::model::DeleteWorkflowInvocationRequest>,
4215 );
4216
4217 impl DeleteWorkflowInvocation {
4218 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4219 Self(RequestBuilder::new(stub))
4220 }
4221
4222 /// Sets the full request, replacing any prior values.
4223 pub fn with_request<V: Into<crate::model::DeleteWorkflowInvocationRequest>>(
4224 mut self,
4225 v: V,
4226 ) -> Self {
4227 self.0.request = v.into();
4228 self
4229 }
4230
4231 /// Sets all the options, replacing any prior values.
4232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4233 self.0.options = v.into();
4234 self
4235 }
4236
4237 /// Sends the request.
4238 pub async fn send(self) -> Result<()> {
4239 (*self.0.stub)
4240 .delete_workflow_invocation(self.0.request, self.0.options)
4241 .await
4242 .map(crate::Response::into_body)
4243 }
4244
4245 /// Sets the value of [name][crate::model::DeleteWorkflowInvocationRequest::name].
4246 ///
4247 /// This is a **required** field for requests.
4248 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4249 self.0.request.name = v.into();
4250 self
4251 }
4252 }
4253
4254 #[doc(hidden)]
4255 impl crate::RequestBuilder for DeleteWorkflowInvocation {
4256 fn request_options(&mut self) -> &mut crate::RequestOptions {
4257 &mut self.0.options
4258 }
4259 }
4260
4261 /// The request builder for [Dataform::cancel_workflow_invocation][crate::client::Dataform::cancel_workflow_invocation] calls.
4262 ///
4263 /// # Example
4264 /// ```
4265 /// # use google_cloud_dataform_v1::builder::dataform::CancelWorkflowInvocation;
4266 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4267 ///
4268 /// let builder = prepare_request_builder();
4269 /// let response = builder.send().await?;
4270 /// # Ok(()) }
4271 ///
4272 /// fn prepare_request_builder() -> CancelWorkflowInvocation {
4273 /// # panic!();
4274 /// // ... details omitted ...
4275 /// }
4276 /// ```
4277 #[derive(Clone, Debug)]
4278 pub struct CancelWorkflowInvocation(
4279 RequestBuilder<crate::model::CancelWorkflowInvocationRequest>,
4280 );
4281
4282 impl CancelWorkflowInvocation {
4283 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4284 Self(RequestBuilder::new(stub))
4285 }
4286
4287 /// Sets the full request, replacing any prior values.
4288 pub fn with_request<V: Into<crate::model::CancelWorkflowInvocationRequest>>(
4289 mut self,
4290 v: V,
4291 ) -> Self {
4292 self.0.request = v.into();
4293 self
4294 }
4295
4296 /// Sets all the options, replacing any prior values.
4297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4298 self.0.options = v.into();
4299 self
4300 }
4301
4302 /// Sends the request.
4303 pub async fn send(self) -> Result<crate::model::CancelWorkflowInvocationResponse> {
4304 (*self.0.stub)
4305 .cancel_workflow_invocation(self.0.request, self.0.options)
4306 .await
4307 .map(crate::Response::into_body)
4308 }
4309
4310 /// Sets the value of [name][crate::model::CancelWorkflowInvocationRequest::name].
4311 ///
4312 /// This is a **required** field for requests.
4313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4314 self.0.request.name = v.into();
4315 self
4316 }
4317 }
4318
4319 #[doc(hidden)]
4320 impl crate::RequestBuilder for CancelWorkflowInvocation {
4321 fn request_options(&mut self) -> &mut crate::RequestOptions {
4322 &mut self.0.options
4323 }
4324 }
4325
4326 /// The request builder for [Dataform::query_workflow_invocation_actions][crate::client::Dataform::query_workflow_invocation_actions] calls.
4327 ///
4328 /// # Example
4329 /// ```
4330 /// # use google_cloud_dataform_v1::builder::dataform::QueryWorkflowInvocationActions;
4331 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4332 /// use google_cloud_gax::paginator::ItemPaginator;
4333 ///
4334 /// let builder = prepare_request_builder();
4335 /// let mut items = builder.by_item();
4336 /// while let Some(result) = items.next().await {
4337 /// let item = result?;
4338 /// }
4339 /// # Ok(()) }
4340 ///
4341 /// fn prepare_request_builder() -> QueryWorkflowInvocationActions {
4342 /// # panic!();
4343 /// // ... details omitted ...
4344 /// }
4345 /// ```
4346 #[derive(Clone, Debug)]
4347 pub struct QueryWorkflowInvocationActions(
4348 RequestBuilder<crate::model::QueryWorkflowInvocationActionsRequest>,
4349 );
4350
4351 impl QueryWorkflowInvocationActions {
4352 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4353 Self(RequestBuilder::new(stub))
4354 }
4355
4356 /// Sets the full request, replacing any prior values.
4357 pub fn with_request<V: Into<crate::model::QueryWorkflowInvocationActionsRequest>>(
4358 mut self,
4359 v: V,
4360 ) -> Self {
4361 self.0.request = v.into();
4362 self
4363 }
4364
4365 /// Sets all the options, replacing any prior values.
4366 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4367 self.0.options = v.into();
4368 self
4369 }
4370
4371 /// Sends the request.
4372 pub async fn send(self) -> Result<crate::model::QueryWorkflowInvocationActionsResponse> {
4373 (*self.0.stub)
4374 .query_workflow_invocation_actions(self.0.request, self.0.options)
4375 .await
4376 .map(crate::Response::into_body)
4377 }
4378
4379 /// Streams each page in the collection.
4380 pub fn by_page(
4381 self,
4382 ) -> impl google_cloud_gax::paginator::Paginator<
4383 crate::model::QueryWorkflowInvocationActionsResponse,
4384 crate::Error,
4385 > {
4386 use std::clone::Clone;
4387 let token = self.0.request.page_token.clone();
4388 let execute = move |token: String| {
4389 let mut builder = self.clone();
4390 builder.0.request = builder.0.request.set_page_token(token);
4391 builder.send()
4392 };
4393 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4394 }
4395
4396 /// Streams each item in the collection.
4397 pub fn by_item(
4398 self,
4399 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4400 crate::model::QueryWorkflowInvocationActionsResponse,
4401 crate::Error,
4402 > {
4403 use google_cloud_gax::paginator::Paginator;
4404 self.by_page().items()
4405 }
4406
4407 /// Sets the value of [name][crate::model::QueryWorkflowInvocationActionsRequest::name].
4408 ///
4409 /// This is a **required** field for requests.
4410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4411 self.0.request.name = v.into();
4412 self
4413 }
4414
4415 /// Sets the value of [page_size][crate::model::QueryWorkflowInvocationActionsRequest::page_size].
4416 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4417 self.0.request.page_size = v.into();
4418 self
4419 }
4420
4421 /// Sets the value of [page_token][crate::model::QueryWorkflowInvocationActionsRequest::page_token].
4422 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4423 self.0.request.page_token = v.into();
4424 self
4425 }
4426 }
4427
4428 #[doc(hidden)]
4429 impl crate::RequestBuilder for QueryWorkflowInvocationActions {
4430 fn request_options(&mut self) -> &mut crate::RequestOptions {
4431 &mut self.0.options
4432 }
4433 }
4434
4435 /// The request builder for [Dataform::get_config][crate::client::Dataform::get_config] calls.
4436 ///
4437 /// # Example
4438 /// ```
4439 /// # use google_cloud_dataform_v1::builder::dataform::GetConfig;
4440 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4441 ///
4442 /// let builder = prepare_request_builder();
4443 /// let response = builder.send().await?;
4444 /// # Ok(()) }
4445 ///
4446 /// fn prepare_request_builder() -> GetConfig {
4447 /// # panic!();
4448 /// // ... details omitted ...
4449 /// }
4450 /// ```
4451 #[derive(Clone, Debug)]
4452 pub struct GetConfig(RequestBuilder<crate::model::GetConfigRequest>);
4453
4454 impl GetConfig {
4455 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4456 Self(RequestBuilder::new(stub))
4457 }
4458
4459 /// Sets the full request, replacing any prior values.
4460 pub fn with_request<V: Into<crate::model::GetConfigRequest>>(mut self, v: V) -> Self {
4461 self.0.request = v.into();
4462 self
4463 }
4464
4465 /// Sets all the options, replacing any prior values.
4466 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4467 self.0.options = v.into();
4468 self
4469 }
4470
4471 /// Sends the request.
4472 pub async fn send(self) -> Result<crate::model::Config> {
4473 (*self.0.stub)
4474 .get_config(self.0.request, self.0.options)
4475 .await
4476 .map(crate::Response::into_body)
4477 }
4478
4479 /// Sets the value of [name][crate::model::GetConfigRequest::name].
4480 ///
4481 /// This is a **required** field for requests.
4482 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4483 self.0.request.name = v.into();
4484 self
4485 }
4486 }
4487
4488 #[doc(hidden)]
4489 impl crate::RequestBuilder for GetConfig {
4490 fn request_options(&mut self) -> &mut crate::RequestOptions {
4491 &mut self.0.options
4492 }
4493 }
4494
4495 /// The request builder for [Dataform::update_config][crate::client::Dataform::update_config] calls.
4496 ///
4497 /// # Example
4498 /// ```
4499 /// # use google_cloud_dataform_v1::builder::dataform::UpdateConfig;
4500 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4501 ///
4502 /// let builder = prepare_request_builder();
4503 /// let response = builder.send().await?;
4504 /// # Ok(()) }
4505 ///
4506 /// fn prepare_request_builder() -> UpdateConfig {
4507 /// # panic!();
4508 /// // ... details omitted ...
4509 /// }
4510 /// ```
4511 #[derive(Clone, Debug)]
4512 pub struct UpdateConfig(RequestBuilder<crate::model::UpdateConfigRequest>);
4513
4514 impl UpdateConfig {
4515 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4516 Self(RequestBuilder::new(stub))
4517 }
4518
4519 /// Sets the full request, replacing any prior values.
4520 pub fn with_request<V: Into<crate::model::UpdateConfigRequest>>(mut self, v: V) -> Self {
4521 self.0.request = v.into();
4522 self
4523 }
4524
4525 /// Sets all the options, replacing any prior values.
4526 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4527 self.0.options = v.into();
4528 self
4529 }
4530
4531 /// Sends the request.
4532 pub async fn send(self) -> Result<crate::model::Config> {
4533 (*self.0.stub)
4534 .update_config(self.0.request, self.0.options)
4535 .await
4536 .map(crate::Response::into_body)
4537 }
4538
4539 /// Sets the value of [config][crate::model::UpdateConfigRequest::config].
4540 ///
4541 /// This is a **required** field for requests.
4542 pub fn set_config<T>(mut self, v: T) -> Self
4543 where
4544 T: std::convert::Into<crate::model::Config>,
4545 {
4546 self.0.request.config = std::option::Option::Some(v.into());
4547 self
4548 }
4549
4550 /// Sets or clears the value of [config][crate::model::UpdateConfigRequest::config].
4551 ///
4552 /// This is a **required** field for requests.
4553 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
4554 where
4555 T: std::convert::Into<crate::model::Config>,
4556 {
4557 self.0.request.config = v.map(|x| x.into());
4558 self
4559 }
4560
4561 /// Sets the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
4562 pub fn set_update_mask<T>(mut self, v: T) -> Self
4563 where
4564 T: std::convert::Into<wkt::FieldMask>,
4565 {
4566 self.0.request.update_mask = std::option::Option::Some(v.into());
4567 self
4568 }
4569
4570 /// Sets or clears the value of [update_mask][crate::model::UpdateConfigRequest::update_mask].
4571 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4572 where
4573 T: std::convert::Into<wkt::FieldMask>,
4574 {
4575 self.0.request.update_mask = v.map(|x| x.into());
4576 self
4577 }
4578 }
4579
4580 #[doc(hidden)]
4581 impl crate::RequestBuilder for UpdateConfig {
4582 fn request_options(&mut self) -> &mut crate::RequestOptions {
4583 &mut self.0.options
4584 }
4585 }
4586
4587 /// The request builder for [Dataform::list_locations][crate::client::Dataform::list_locations] calls.
4588 ///
4589 /// # Example
4590 /// ```
4591 /// # use google_cloud_dataform_v1::builder::dataform::ListLocations;
4592 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4593 /// use google_cloud_gax::paginator::ItemPaginator;
4594 ///
4595 /// let builder = prepare_request_builder();
4596 /// let mut items = builder.by_item();
4597 /// while let Some(result) = items.next().await {
4598 /// let item = result?;
4599 /// }
4600 /// # Ok(()) }
4601 ///
4602 /// fn prepare_request_builder() -> ListLocations {
4603 /// # panic!();
4604 /// // ... details omitted ...
4605 /// }
4606 /// ```
4607 #[derive(Clone, Debug)]
4608 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4609
4610 impl ListLocations {
4611 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4612 Self(RequestBuilder::new(stub))
4613 }
4614
4615 /// Sets the full request, replacing any prior values.
4616 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4617 mut self,
4618 v: V,
4619 ) -> Self {
4620 self.0.request = v.into();
4621 self
4622 }
4623
4624 /// Sets all the options, replacing any prior values.
4625 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4626 self.0.options = v.into();
4627 self
4628 }
4629
4630 /// Sends the request.
4631 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4632 (*self.0.stub)
4633 .list_locations(self.0.request, self.0.options)
4634 .await
4635 .map(crate::Response::into_body)
4636 }
4637
4638 /// Streams each page in the collection.
4639 pub fn by_page(
4640 self,
4641 ) -> impl google_cloud_gax::paginator::Paginator<
4642 google_cloud_location::model::ListLocationsResponse,
4643 crate::Error,
4644 > {
4645 use std::clone::Clone;
4646 let token = self.0.request.page_token.clone();
4647 let execute = move |token: String| {
4648 let mut builder = self.clone();
4649 builder.0.request = builder.0.request.set_page_token(token);
4650 builder.send()
4651 };
4652 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4653 }
4654
4655 /// Streams each item in the collection.
4656 pub fn by_item(
4657 self,
4658 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4659 google_cloud_location::model::ListLocationsResponse,
4660 crate::Error,
4661 > {
4662 use google_cloud_gax::paginator::Paginator;
4663 self.by_page().items()
4664 }
4665
4666 /// Sets the value of [name][google_cloud_location::model::ListLocationsRequest::name].
4667 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4668 self.0.request.name = v.into();
4669 self
4670 }
4671
4672 /// Sets the value of [filter][google_cloud_location::model::ListLocationsRequest::filter].
4673 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4674 self.0.request.filter = v.into();
4675 self
4676 }
4677
4678 /// Sets the value of [page_size][google_cloud_location::model::ListLocationsRequest::page_size].
4679 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4680 self.0.request.page_size = v.into();
4681 self
4682 }
4683
4684 /// Sets the value of [page_token][google_cloud_location::model::ListLocationsRequest::page_token].
4685 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4686 self.0.request.page_token = v.into();
4687 self
4688 }
4689 }
4690
4691 #[doc(hidden)]
4692 impl crate::RequestBuilder for ListLocations {
4693 fn request_options(&mut self) -> &mut crate::RequestOptions {
4694 &mut self.0.options
4695 }
4696 }
4697
4698 /// The request builder for [Dataform::get_location][crate::client::Dataform::get_location] calls.
4699 ///
4700 /// # Example
4701 /// ```
4702 /// # use google_cloud_dataform_v1::builder::dataform::GetLocation;
4703 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4704 ///
4705 /// let builder = prepare_request_builder();
4706 /// let response = builder.send().await?;
4707 /// # Ok(()) }
4708 ///
4709 /// fn prepare_request_builder() -> GetLocation {
4710 /// # panic!();
4711 /// // ... details omitted ...
4712 /// }
4713 /// ```
4714 #[derive(Clone, Debug)]
4715 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4716
4717 impl GetLocation {
4718 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4719 Self(RequestBuilder::new(stub))
4720 }
4721
4722 /// Sets the full request, replacing any prior values.
4723 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4724 mut self,
4725 v: V,
4726 ) -> Self {
4727 self.0.request = v.into();
4728 self
4729 }
4730
4731 /// Sets all the options, replacing any prior values.
4732 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4733 self.0.options = v.into();
4734 self
4735 }
4736
4737 /// Sends the request.
4738 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4739 (*self.0.stub)
4740 .get_location(self.0.request, self.0.options)
4741 .await
4742 .map(crate::Response::into_body)
4743 }
4744
4745 /// Sets the value of [name][google_cloud_location::model::GetLocationRequest::name].
4746 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4747 self.0.request.name = v.into();
4748 self
4749 }
4750 }
4751
4752 #[doc(hidden)]
4753 impl crate::RequestBuilder for GetLocation {
4754 fn request_options(&mut self) -> &mut crate::RequestOptions {
4755 &mut self.0.options
4756 }
4757 }
4758
4759 /// The request builder for [Dataform::set_iam_policy][crate::client::Dataform::set_iam_policy] calls.
4760 ///
4761 /// # Example
4762 /// ```
4763 /// # use google_cloud_dataform_v1::builder::dataform::SetIamPolicy;
4764 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4765 ///
4766 /// let builder = prepare_request_builder();
4767 /// let response = builder.send().await?;
4768 /// # Ok(()) }
4769 ///
4770 /// fn prepare_request_builder() -> SetIamPolicy {
4771 /// # panic!();
4772 /// // ... details omitted ...
4773 /// }
4774 /// ```
4775 #[derive(Clone, Debug)]
4776 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4777
4778 impl SetIamPolicy {
4779 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4780 Self(RequestBuilder::new(stub))
4781 }
4782
4783 /// Sets the full request, replacing any prior values.
4784 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4785 mut self,
4786 v: V,
4787 ) -> Self {
4788 self.0.request = v.into();
4789 self
4790 }
4791
4792 /// Sets all the options, replacing any prior values.
4793 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4794 self.0.options = v.into();
4795 self
4796 }
4797
4798 /// Sends the request.
4799 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4800 (*self.0.stub)
4801 .set_iam_policy(self.0.request, self.0.options)
4802 .await
4803 .map(crate::Response::into_body)
4804 }
4805
4806 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4807 ///
4808 /// This is a **required** field for requests.
4809 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4810 self.0.request.resource = v.into();
4811 self
4812 }
4813
4814 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4815 ///
4816 /// This is a **required** field for requests.
4817 pub fn set_policy<T>(mut self, v: T) -> Self
4818 where
4819 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4820 {
4821 self.0.request.policy = std::option::Option::Some(v.into());
4822 self
4823 }
4824
4825 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4826 ///
4827 /// This is a **required** field for requests.
4828 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4829 where
4830 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4831 {
4832 self.0.request.policy = v.map(|x| x.into());
4833 self
4834 }
4835
4836 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4837 pub fn set_update_mask<T>(mut self, v: T) -> Self
4838 where
4839 T: std::convert::Into<wkt::FieldMask>,
4840 {
4841 self.0.request.update_mask = std::option::Option::Some(v.into());
4842 self
4843 }
4844
4845 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4846 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4847 where
4848 T: std::convert::Into<wkt::FieldMask>,
4849 {
4850 self.0.request.update_mask = v.map(|x| x.into());
4851 self
4852 }
4853 }
4854
4855 #[doc(hidden)]
4856 impl crate::RequestBuilder for SetIamPolicy {
4857 fn request_options(&mut self) -> &mut crate::RequestOptions {
4858 &mut self.0.options
4859 }
4860 }
4861
4862 /// The request builder for [Dataform::get_iam_policy][crate::client::Dataform::get_iam_policy] calls.
4863 ///
4864 /// # Example
4865 /// ```
4866 /// # use google_cloud_dataform_v1::builder::dataform::GetIamPolicy;
4867 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4868 ///
4869 /// let builder = prepare_request_builder();
4870 /// let response = builder.send().await?;
4871 /// # Ok(()) }
4872 ///
4873 /// fn prepare_request_builder() -> GetIamPolicy {
4874 /// # panic!();
4875 /// // ... details omitted ...
4876 /// }
4877 /// ```
4878 #[derive(Clone, Debug)]
4879 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4880
4881 impl GetIamPolicy {
4882 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4883 Self(RequestBuilder::new(stub))
4884 }
4885
4886 /// Sets the full request, replacing any prior values.
4887 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4888 mut self,
4889 v: V,
4890 ) -> Self {
4891 self.0.request = v.into();
4892 self
4893 }
4894
4895 /// Sets all the options, replacing any prior values.
4896 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4897 self.0.options = v.into();
4898 self
4899 }
4900
4901 /// Sends the request.
4902 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4903 (*self.0.stub)
4904 .get_iam_policy(self.0.request, self.0.options)
4905 .await
4906 .map(crate::Response::into_body)
4907 }
4908
4909 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4910 ///
4911 /// This is a **required** field for requests.
4912 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4913 self.0.request.resource = v.into();
4914 self
4915 }
4916
4917 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4918 pub fn set_options<T>(mut self, v: T) -> Self
4919 where
4920 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4921 {
4922 self.0.request.options = std::option::Option::Some(v.into());
4923 self
4924 }
4925
4926 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4927 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4928 where
4929 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4930 {
4931 self.0.request.options = v.map(|x| x.into());
4932 self
4933 }
4934 }
4935
4936 #[doc(hidden)]
4937 impl crate::RequestBuilder for GetIamPolicy {
4938 fn request_options(&mut self) -> &mut crate::RequestOptions {
4939 &mut self.0.options
4940 }
4941 }
4942
4943 /// The request builder for [Dataform::test_iam_permissions][crate::client::Dataform::test_iam_permissions] calls.
4944 ///
4945 /// # Example
4946 /// ```
4947 /// # use google_cloud_dataform_v1::builder::dataform::TestIamPermissions;
4948 /// # async fn sample() -> google_cloud_dataform_v1::Result<()> {
4949 ///
4950 /// let builder = prepare_request_builder();
4951 /// let response = builder.send().await?;
4952 /// # Ok(()) }
4953 ///
4954 /// fn prepare_request_builder() -> TestIamPermissions {
4955 /// # panic!();
4956 /// // ... details omitted ...
4957 /// }
4958 /// ```
4959 #[derive(Clone, Debug)]
4960 pub struct TestIamPermissions(
4961 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4962 );
4963
4964 impl TestIamPermissions {
4965 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Dataform>) -> Self {
4966 Self(RequestBuilder::new(stub))
4967 }
4968
4969 /// Sets the full request, replacing any prior values.
4970 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4971 mut self,
4972 v: V,
4973 ) -> Self {
4974 self.0.request = v.into();
4975 self
4976 }
4977
4978 /// Sets all the options, replacing any prior values.
4979 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4980 self.0.options = v.into();
4981 self
4982 }
4983
4984 /// Sends the request.
4985 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4986 (*self.0.stub)
4987 .test_iam_permissions(self.0.request, self.0.options)
4988 .await
4989 .map(crate::Response::into_body)
4990 }
4991
4992 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4993 ///
4994 /// This is a **required** field for requests.
4995 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4996 self.0.request.resource = v.into();
4997 self
4998 }
4999
5000 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
5001 ///
5002 /// This is a **required** field for requests.
5003 pub fn set_permissions<T, V>(mut self, v: T) -> Self
5004 where
5005 T: std::iter::IntoIterator<Item = V>,
5006 V: std::convert::Into<std::string::String>,
5007 {
5008 use std::iter::Iterator;
5009 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
5010 self
5011 }
5012 }
5013
5014 #[doc(hidden)]
5015 impl crate::RequestBuilder for TestIamPermissions {
5016 fn request_options(&mut self) -> &mut crate::RequestOptions {
5017 &mut self.0.options
5018 }
5019 }
5020}