google_cloud_datacatalog_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 data_catalog {
18 use crate::Result;
19
20 /// A builder for [DataCatalog][crate::client::DataCatalog].
21 ///
22 /// ```
23 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
24 /// # use google_cloud_datacatalog_v1::*;
25 /// # use builder::data_catalog::ClientBuilder;
26 /// # use client::DataCatalog;
27 /// let builder : ClientBuilder = DataCatalog::builder();
28 /// let client = builder
29 /// .with_endpoint("https://datacatalog.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::DataCatalog;
37 pub struct Factory;
38 impl crate::ClientFactory for Factory {
39 type Client = DataCatalog;
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::DataCatalog] 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::DataCatalog>,
54 request: R,
55 options: crate::RequestOptions,
56 }
57
58 impl<R> RequestBuilder<R>
59 where
60 R: std::default::Default,
61 {
62 pub(crate) fn new(
63 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
64 ) -> Self {
65 Self {
66 stub,
67 request: R::default(),
68 options: crate::RequestOptions::default(),
69 }
70 }
71 }
72
73 /// The request builder for [DataCatalog::search_catalog][crate::client::DataCatalog::search_catalog] calls.
74 ///
75 /// # Example
76 /// ```
77 /// # use google_cloud_datacatalog_v1::builder::data_catalog::SearchCatalog;
78 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
79 /// use google_cloud_gax::paginator::ItemPaginator;
80 ///
81 /// let builder = prepare_request_builder();
82 /// let mut items = builder.by_item();
83 /// while let Some(result) = items.next().await {
84 /// let item = result?;
85 /// }
86 /// # Ok(()) }
87 ///
88 /// fn prepare_request_builder() -> SearchCatalog {
89 /// # panic!();
90 /// // ... details omitted ...
91 /// }
92 /// ```
93 #[derive(Clone, Debug)]
94 pub struct SearchCatalog(RequestBuilder<crate::model::SearchCatalogRequest>);
95
96 impl SearchCatalog {
97 pub(crate) fn new(
98 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
99 ) -> Self {
100 Self(RequestBuilder::new(stub))
101 }
102
103 /// Sets the full request, replacing any prior values.
104 pub fn with_request<V: Into<crate::model::SearchCatalogRequest>>(mut self, v: V) -> Self {
105 self.0.request = v.into();
106 self
107 }
108
109 /// Sets all the options, replacing any prior values.
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
111 self.0.options = v.into();
112 self
113 }
114
115 /// Sends the request.
116 pub async fn send(self) -> Result<crate::model::SearchCatalogResponse> {
117 (*self.0.stub)
118 .search_catalog(self.0.request, self.0.options)
119 .await
120 .map(crate::Response::into_body)
121 }
122
123 /// Streams each page in the collection.
124 pub fn by_page(
125 self,
126 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchCatalogResponse, crate::Error>
127 {
128 use std::clone::Clone;
129 let token = self.0.request.page_token.clone();
130 let execute = move |token: String| {
131 let mut builder = self.clone();
132 builder.0.request = builder.0.request.set_page_token(token);
133 builder.send()
134 };
135 google_cloud_gax::paginator::internal::new_paginator(token, execute)
136 }
137
138 /// Streams each item in the collection.
139 pub fn by_item(
140 self,
141 ) -> impl google_cloud_gax::paginator::ItemPaginator<
142 crate::model::SearchCatalogResponse,
143 crate::Error,
144 > {
145 use google_cloud_gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 /// Sets the value of [scope][crate::model::SearchCatalogRequest::scope].
150 ///
151 /// This is a **required** field for requests.
152 pub fn set_scope<T>(mut self, v: T) -> Self
153 where
154 T: std::convert::Into<crate::model::search_catalog_request::Scope>,
155 {
156 self.0.request.scope = std::option::Option::Some(v.into());
157 self
158 }
159
160 /// Sets or clears the value of [scope][crate::model::SearchCatalogRequest::scope].
161 ///
162 /// This is a **required** field for requests.
163 pub fn set_or_clear_scope<T>(mut self, v: std::option::Option<T>) -> Self
164 where
165 T: std::convert::Into<crate::model::search_catalog_request::Scope>,
166 {
167 self.0.request.scope = v.map(|x| x.into());
168 self
169 }
170
171 /// Sets the value of [query][crate::model::SearchCatalogRequest::query].
172 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
173 self.0.request.query = v.into();
174 self
175 }
176
177 /// Sets the value of [page_size][crate::model::SearchCatalogRequest::page_size].
178 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
179 self.0.request.page_size = v.into();
180 self
181 }
182
183 /// Sets the value of [page_token][crate::model::SearchCatalogRequest::page_token].
184 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
185 self.0.request.page_token = v.into();
186 self
187 }
188
189 /// Sets the value of [order_by][crate::model::SearchCatalogRequest::order_by].
190 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
191 self.0.request.order_by = v.into();
192 self
193 }
194
195 /// Sets the value of [admin_search][crate::model::SearchCatalogRequest::admin_search].
196 pub fn set_admin_search<T: Into<bool>>(mut self, v: T) -> Self {
197 self.0.request.admin_search = v.into();
198 self
199 }
200 }
201
202 #[doc(hidden)]
203 impl crate::RequestBuilder for SearchCatalog {
204 fn request_options(&mut self) -> &mut crate::RequestOptions {
205 &mut self.0.options
206 }
207 }
208
209 /// The request builder for [DataCatalog::create_entry_group][crate::client::DataCatalog::create_entry_group] calls.
210 ///
211 /// # Example
212 /// ```
213 /// # use google_cloud_datacatalog_v1::builder::data_catalog::CreateEntryGroup;
214 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
215 ///
216 /// let builder = prepare_request_builder();
217 /// let response = builder.send().await?;
218 /// # Ok(()) }
219 ///
220 /// fn prepare_request_builder() -> CreateEntryGroup {
221 /// # panic!();
222 /// // ... details omitted ...
223 /// }
224 /// ```
225 #[derive(Clone, Debug)]
226 pub struct CreateEntryGroup(RequestBuilder<crate::model::CreateEntryGroupRequest>);
227
228 impl CreateEntryGroup {
229 pub(crate) fn new(
230 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
231 ) -> Self {
232 Self(RequestBuilder::new(stub))
233 }
234
235 /// Sets the full request, replacing any prior values.
236 pub fn with_request<V: Into<crate::model::CreateEntryGroupRequest>>(
237 mut self,
238 v: V,
239 ) -> Self {
240 self.0.request = v.into();
241 self
242 }
243
244 /// Sets all the options, replacing any prior values.
245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
246 self.0.options = v.into();
247 self
248 }
249
250 /// Sends the request.
251 pub async fn send(self) -> Result<crate::model::EntryGroup> {
252 (*self.0.stub)
253 .create_entry_group(self.0.request, self.0.options)
254 .await
255 .map(crate::Response::into_body)
256 }
257
258 /// Sets the value of [parent][crate::model::CreateEntryGroupRequest::parent].
259 ///
260 /// This is a **required** field for requests.
261 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
262 self.0.request.parent = v.into();
263 self
264 }
265
266 /// Sets the value of [entry_group_id][crate::model::CreateEntryGroupRequest::entry_group_id].
267 ///
268 /// This is a **required** field for requests.
269 pub fn set_entry_group_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
270 self.0.request.entry_group_id = v.into();
271 self
272 }
273
274 /// Sets the value of [entry_group][crate::model::CreateEntryGroupRequest::entry_group].
275 pub fn set_entry_group<T>(mut self, v: T) -> Self
276 where
277 T: std::convert::Into<crate::model::EntryGroup>,
278 {
279 self.0.request.entry_group = std::option::Option::Some(v.into());
280 self
281 }
282
283 /// Sets or clears the value of [entry_group][crate::model::CreateEntryGroupRequest::entry_group].
284 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
285 where
286 T: std::convert::Into<crate::model::EntryGroup>,
287 {
288 self.0.request.entry_group = v.map(|x| x.into());
289 self
290 }
291 }
292
293 #[doc(hidden)]
294 impl crate::RequestBuilder for CreateEntryGroup {
295 fn request_options(&mut self) -> &mut crate::RequestOptions {
296 &mut self.0.options
297 }
298 }
299
300 /// The request builder for [DataCatalog::get_entry_group][crate::client::DataCatalog::get_entry_group] calls.
301 ///
302 /// # Example
303 /// ```
304 /// # use google_cloud_datacatalog_v1::builder::data_catalog::GetEntryGroup;
305 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
306 ///
307 /// let builder = prepare_request_builder();
308 /// let response = builder.send().await?;
309 /// # Ok(()) }
310 ///
311 /// fn prepare_request_builder() -> GetEntryGroup {
312 /// # panic!();
313 /// // ... details omitted ...
314 /// }
315 /// ```
316 #[derive(Clone, Debug)]
317 pub struct GetEntryGroup(RequestBuilder<crate::model::GetEntryGroupRequest>);
318
319 impl GetEntryGroup {
320 pub(crate) fn new(
321 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
322 ) -> Self {
323 Self(RequestBuilder::new(stub))
324 }
325
326 /// Sets the full request, replacing any prior values.
327 pub fn with_request<V: Into<crate::model::GetEntryGroupRequest>>(mut self, v: V) -> Self {
328 self.0.request = v.into();
329 self
330 }
331
332 /// Sets all the options, replacing any prior values.
333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
334 self.0.options = v.into();
335 self
336 }
337
338 /// Sends the request.
339 pub async fn send(self) -> Result<crate::model::EntryGroup> {
340 (*self.0.stub)
341 .get_entry_group(self.0.request, self.0.options)
342 .await
343 .map(crate::Response::into_body)
344 }
345
346 /// Sets the value of [name][crate::model::GetEntryGroupRequest::name].
347 ///
348 /// This is a **required** field for requests.
349 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
350 self.0.request.name = v.into();
351 self
352 }
353
354 /// Sets the value of [read_mask][crate::model::GetEntryGroupRequest::read_mask].
355 pub fn set_read_mask<T>(mut self, v: T) -> Self
356 where
357 T: std::convert::Into<wkt::FieldMask>,
358 {
359 self.0.request.read_mask = std::option::Option::Some(v.into());
360 self
361 }
362
363 /// Sets or clears the value of [read_mask][crate::model::GetEntryGroupRequest::read_mask].
364 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
365 where
366 T: std::convert::Into<wkt::FieldMask>,
367 {
368 self.0.request.read_mask = v.map(|x| x.into());
369 self
370 }
371 }
372
373 #[doc(hidden)]
374 impl crate::RequestBuilder for GetEntryGroup {
375 fn request_options(&mut self) -> &mut crate::RequestOptions {
376 &mut self.0.options
377 }
378 }
379
380 /// The request builder for [DataCatalog::update_entry_group][crate::client::DataCatalog::update_entry_group] calls.
381 ///
382 /// # Example
383 /// ```
384 /// # use google_cloud_datacatalog_v1::builder::data_catalog::UpdateEntryGroup;
385 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
386 ///
387 /// let builder = prepare_request_builder();
388 /// let response = builder.send().await?;
389 /// # Ok(()) }
390 ///
391 /// fn prepare_request_builder() -> UpdateEntryGroup {
392 /// # panic!();
393 /// // ... details omitted ...
394 /// }
395 /// ```
396 #[derive(Clone, Debug)]
397 pub struct UpdateEntryGroup(RequestBuilder<crate::model::UpdateEntryGroupRequest>);
398
399 impl UpdateEntryGroup {
400 pub(crate) fn new(
401 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
402 ) -> Self {
403 Self(RequestBuilder::new(stub))
404 }
405
406 /// Sets the full request, replacing any prior values.
407 pub fn with_request<V: Into<crate::model::UpdateEntryGroupRequest>>(
408 mut self,
409 v: V,
410 ) -> Self {
411 self.0.request = v.into();
412 self
413 }
414
415 /// Sets all the options, replacing any prior values.
416 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
417 self.0.options = v.into();
418 self
419 }
420
421 /// Sends the request.
422 pub async fn send(self) -> Result<crate::model::EntryGroup> {
423 (*self.0.stub)
424 .update_entry_group(self.0.request, self.0.options)
425 .await
426 .map(crate::Response::into_body)
427 }
428
429 /// Sets the value of [entry_group][crate::model::UpdateEntryGroupRequest::entry_group].
430 ///
431 /// This is a **required** field for requests.
432 pub fn set_entry_group<T>(mut self, v: T) -> Self
433 where
434 T: std::convert::Into<crate::model::EntryGroup>,
435 {
436 self.0.request.entry_group = std::option::Option::Some(v.into());
437 self
438 }
439
440 /// Sets or clears the value of [entry_group][crate::model::UpdateEntryGroupRequest::entry_group].
441 ///
442 /// This is a **required** field for requests.
443 pub fn set_or_clear_entry_group<T>(mut self, v: std::option::Option<T>) -> Self
444 where
445 T: std::convert::Into<crate::model::EntryGroup>,
446 {
447 self.0.request.entry_group = v.map(|x| x.into());
448 self
449 }
450
451 /// Sets the value of [update_mask][crate::model::UpdateEntryGroupRequest::update_mask].
452 pub fn set_update_mask<T>(mut self, v: T) -> Self
453 where
454 T: std::convert::Into<wkt::FieldMask>,
455 {
456 self.0.request.update_mask = std::option::Option::Some(v.into());
457 self
458 }
459
460 /// Sets or clears the value of [update_mask][crate::model::UpdateEntryGroupRequest::update_mask].
461 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
462 where
463 T: std::convert::Into<wkt::FieldMask>,
464 {
465 self.0.request.update_mask = v.map(|x| x.into());
466 self
467 }
468 }
469
470 #[doc(hidden)]
471 impl crate::RequestBuilder for UpdateEntryGroup {
472 fn request_options(&mut self) -> &mut crate::RequestOptions {
473 &mut self.0.options
474 }
475 }
476
477 /// The request builder for [DataCatalog::delete_entry_group][crate::client::DataCatalog::delete_entry_group] calls.
478 ///
479 /// # Example
480 /// ```
481 /// # use google_cloud_datacatalog_v1::builder::data_catalog::DeleteEntryGroup;
482 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
483 ///
484 /// let builder = prepare_request_builder();
485 /// let response = builder.send().await?;
486 /// # Ok(()) }
487 ///
488 /// fn prepare_request_builder() -> DeleteEntryGroup {
489 /// # panic!();
490 /// // ... details omitted ...
491 /// }
492 /// ```
493 #[derive(Clone, Debug)]
494 pub struct DeleteEntryGroup(RequestBuilder<crate::model::DeleteEntryGroupRequest>);
495
496 impl DeleteEntryGroup {
497 pub(crate) fn new(
498 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
499 ) -> Self {
500 Self(RequestBuilder::new(stub))
501 }
502
503 /// Sets the full request, replacing any prior values.
504 pub fn with_request<V: Into<crate::model::DeleteEntryGroupRequest>>(
505 mut self,
506 v: V,
507 ) -> Self {
508 self.0.request = v.into();
509 self
510 }
511
512 /// Sets all the options, replacing any prior values.
513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
514 self.0.options = v.into();
515 self
516 }
517
518 /// Sends the request.
519 pub async fn send(self) -> Result<()> {
520 (*self.0.stub)
521 .delete_entry_group(self.0.request, self.0.options)
522 .await
523 .map(crate::Response::into_body)
524 }
525
526 /// Sets the value of [name][crate::model::DeleteEntryGroupRequest::name].
527 ///
528 /// This is a **required** field for requests.
529 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
530 self.0.request.name = v.into();
531 self
532 }
533
534 /// Sets the value of [force][crate::model::DeleteEntryGroupRequest::force].
535 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
536 self.0.request.force = v.into();
537 self
538 }
539 }
540
541 #[doc(hidden)]
542 impl crate::RequestBuilder for DeleteEntryGroup {
543 fn request_options(&mut self) -> &mut crate::RequestOptions {
544 &mut self.0.options
545 }
546 }
547
548 /// The request builder for [DataCatalog::list_entry_groups][crate::client::DataCatalog::list_entry_groups] calls.
549 ///
550 /// # Example
551 /// ```
552 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ListEntryGroups;
553 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
554 /// use google_cloud_gax::paginator::ItemPaginator;
555 ///
556 /// let builder = prepare_request_builder();
557 /// let mut items = builder.by_item();
558 /// while let Some(result) = items.next().await {
559 /// let item = result?;
560 /// }
561 /// # Ok(()) }
562 ///
563 /// fn prepare_request_builder() -> ListEntryGroups {
564 /// # panic!();
565 /// // ... details omitted ...
566 /// }
567 /// ```
568 #[derive(Clone, Debug)]
569 pub struct ListEntryGroups(RequestBuilder<crate::model::ListEntryGroupsRequest>);
570
571 impl ListEntryGroups {
572 pub(crate) fn new(
573 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
574 ) -> Self {
575 Self(RequestBuilder::new(stub))
576 }
577
578 /// Sets the full request, replacing any prior values.
579 pub fn with_request<V: Into<crate::model::ListEntryGroupsRequest>>(mut self, v: V) -> Self {
580 self.0.request = v.into();
581 self
582 }
583
584 /// Sets all the options, replacing any prior values.
585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
586 self.0.options = v.into();
587 self
588 }
589
590 /// Sends the request.
591 pub async fn send(self) -> Result<crate::model::ListEntryGroupsResponse> {
592 (*self.0.stub)
593 .list_entry_groups(self.0.request, self.0.options)
594 .await
595 .map(crate::Response::into_body)
596 }
597
598 /// Streams each page in the collection.
599 pub fn by_page(
600 self,
601 ) -> impl google_cloud_gax::paginator::Paginator<
602 crate::model::ListEntryGroupsResponse,
603 crate::Error,
604 > {
605 use std::clone::Clone;
606 let token = self.0.request.page_token.clone();
607 let execute = move |token: String| {
608 let mut builder = self.clone();
609 builder.0.request = builder.0.request.set_page_token(token);
610 builder.send()
611 };
612 google_cloud_gax::paginator::internal::new_paginator(token, execute)
613 }
614
615 /// Streams each item in the collection.
616 pub fn by_item(
617 self,
618 ) -> impl google_cloud_gax::paginator::ItemPaginator<
619 crate::model::ListEntryGroupsResponse,
620 crate::Error,
621 > {
622 use google_cloud_gax::paginator::Paginator;
623 self.by_page().items()
624 }
625
626 /// Sets the value of [parent][crate::model::ListEntryGroupsRequest::parent].
627 ///
628 /// This is a **required** field for requests.
629 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
630 self.0.request.parent = v.into();
631 self
632 }
633
634 /// Sets the value of [page_size][crate::model::ListEntryGroupsRequest::page_size].
635 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
636 self.0.request.page_size = v.into();
637 self
638 }
639
640 /// Sets the value of [page_token][crate::model::ListEntryGroupsRequest::page_token].
641 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
642 self.0.request.page_token = v.into();
643 self
644 }
645 }
646
647 #[doc(hidden)]
648 impl crate::RequestBuilder for ListEntryGroups {
649 fn request_options(&mut self) -> &mut crate::RequestOptions {
650 &mut self.0.options
651 }
652 }
653
654 /// The request builder for [DataCatalog::create_entry][crate::client::DataCatalog::create_entry] calls.
655 ///
656 /// # Example
657 /// ```
658 /// # use google_cloud_datacatalog_v1::builder::data_catalog::CreateEntry;
659 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
660 ///
661 /// let builder = prepare_request_builder();
662 /// let response = builder.send().await?;
663 /// # Ok(()) }
664 ///
665 /// fn prepare_request_builder() -> CreateEntry {
666 /// # panic!();
667 /// // ... details omitted ...
668 /// }
669 /// ```
670 #[derive(Clone, Debug)]
671 pub struct CreateEntry(RequestBuilder<crate::model::CreateEntryRequest>);
672
673 impl CreateEntry {
674 pub(crate) fn new(
675 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
676 ) -> Self {
677 Self(RequestBuilder::new(stub))
678 }
679
680 /// Sets the full request, replacing any prior values.
681 pub fn with_request<V: Into<crate::model::CreateEntryRequest>>(mut self, v: V) -> Self {
682 self.0.request = v.into();
683 self
684 }
685
686 /// Sets all the options, replacing any prior values.
687 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
688 self.0.options = v.into();
689 self
690 }
691
692 /// Sends the request.
693 pub async fn send(self) -> Result<crate::model::Entry> {
694 (*self.0.stub)
695 .create_entry(self.0.request, self.0.options)
696 .await
697 .map(crate::Response::into_body)
698 }
699
700 /// Sets the value of [parent][crate::model::CreateEntryRequest::parent].
701 ///
702 /// This is a **required** field for requests.
703 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
704 self.0.request.parent = v.into();
705 self
706 }
707
708 /// Sets the value of [entry_id][crate::model::CreateEntryRequest::entry_id].
709 ///
710 /// This is a **required** field for requests.
711 pub fn set_entry_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
712 self.0.request.entry_id = v.into();
713 self
714 }
715
716 /// Sets the value of [entry][crate::model::CreateEntryRequest::entry].
717 ///
718 /// This is a **required** field for requests.
719 pub fn set_entry<T>(mut self, v: T) -> Self
720 where
721 T: std::convert::Into<crate::model::Entry>,
722 {
723 self.0.request.entry = std::option::Option::Some(v.into());
724 self
725 }
726
727 /// Sets or clears the value of [entry][crate::model::CreateEntryRequest::entry].
728 ///
729 /// This is a **required** field for requests.
730 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
731 where
732 T: std::convert::Into<crate::model::Entry>,
733 {
734 self.0.request.entry = v.map(|x| x.into());
735 self
736 }
737 }
738
739 #[doc(hidden)]
740 impl crate::RequestBuilder for CreateEntry {
741 fn request_options(&mut self) -> &mut crate::RequestOptions {
742 &mut self.0.options
743 }
744 }
745
746 /// The request builder for [DataCatalog::update_entry][crate::client::DataCatalog::update_entry] calls.
747 ///
748 /// # Example
749 /// ```
750 /// # use google_cloud_datacatalog_v1::builder::data_catalog::UpdateEntry;
751 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
752 ///
753 /// let builder = prepare_request_builder();
754 /// let response = builder.send().await?;
755 /// # Ok(()) }
756 ///
757 /// fn prepare_request_builder() -> UpdateEntry {
758 /// # panic!();
759 /// // ... details omitted ...
760 /// }
761 /// ```
762 #[derive(Clone, Debug)]
763 pub struct UpdateEntry(RequestBuilder<crate::model::UpdateEntryRequest>);
764
765 impl UpdateEntry {
766 pub(crate) fn new(
767 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
768 ) -> Self {
769 Self(RequestBuilder::new(stub))
770 }
771
772 /// Sets the full request, replacing any prior values.
773 pub fn with_request<V: Into<crate::model::UpdateEntryRequest>>(mut self, v: V) -> Self {
774 self.0.request = v.into();
775 self
776 }
777
778 /// Sets all the options, replacing any prior values.
779 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
780 self.0.options = v.into();
781 self
782 }
783
784 /// Sends the request.
785 pub async fn send(self) -> Result<crate::model::Entry> {
786 (*self.0.stub)
787 .update_entry(self.0.request, self.0.options)
788 .await
789 .map(crate::Response::into_body)
790 }
791
792 /// Sets the value of [entry][crate::model::UpdateEntryRequest::entry].
793 ///
794 /// This is a **required** field for requests.
795 pub fn set_entry<T>(mut self, v: T) -> Self
796 where
797 T: std::convert::Into<crate::model::Entry>,
798 {
799 self.0.request.entry = std::option::Option::Some(v.into());
800 self
801 }
802
803 /// Sets or clears the value of [entry][crate::model::UpdateEntryRequest::entry].
804 ///
805 /// This is a **required** field for requests.
806 pub fn set_or_clear_entry<T>(mut self, v: std::option::Option<T>) -> Self
807 where
808 T: std::convert::Into<crate::model::Entry>,
809 {
810 self.0.request.entry = v.map(|x| x.into());
811 self
812 }
813
814 /// Sets the value of [update_mask][crate::model::UpdateEntryRequest::update_mask].
815 pub fn set_update_mask<T>(mut self, v: T) -> Self
816 where
817 T: std::convert::Into<wkt::FieldMask>,
818 {
819 self.0.request.update_mask = std::option::Option::Some(v.into());
820 self
821 }
822
823 /// Sets or clears the value of [update_mask][crate::model::UpdateEntryRequest::update_mask].
824 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
825 where
826 T: std::convert::Into<wkt::FieldMask>,
827 {
828 self.0.request.update_mask = v.map(|x| x.into());
829 self
830 }
831 }
832
833 #[doc(hidden)]
834 impl crate::RequestBuilder for UpdateEntry {
835 fn request_options(&mut self) -> &mut crate::RequestOptions {
836 &mut self.0.options
837 }
838 }
839
840 /// The request builder for [DataCatalog::delete_entry][crate::client::DataCatalog::delete_entry] calls.
841 ///
842 /// # Example
843 /// ```
844 /// # use google_cloud_datacatalog_v1::builder::data_catalog::DeleteEntry;
845 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
846 ///
847 /// let builder = prepare_request_builder();
848 /// let response = builder.send().await?;
849 /// # Ok(()) }
850 ///
851 /// fn prepare_request_builder() -> DeleteEntry {
852 /// # panic!();
853 /// // ... details omitted ...
854 /// }
855 /// ```
856 #[derive(Clone, Debug)]
857 pub struct DeleteEntry(RequestBuilder<crate::model::DeleteEntryRequest>);
858
859 impl DeleteEntry {
860 pub(crate) fn new(
861 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
862 ) -> Self {
863 Self(RequestBuilder::new(stub))
864 }
865
866 /// Sets the full request, replacing any prior values.
867 pub fn with_request<V: Into<crate::model::DeleteEntryRequest>>(mut self, v: V) -> Self {
868 self.0.request = v.into();
869 self
870 }
871
872 /// Sets all the options, replacing any prior values.
873 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
874 self.0.options = v.into();
875 self
876 }
877
878 /// Sends the request.
879 pub async fn send(self) -> Result<()> {
880 (*self.0.stub)
881 .delete_entry(self.0.request, self.0.options)
882 .await
883 .map(crate::Response::into_body)
884 }
885
886 /// Sets the value of [name][crate::model::DeleteEntryRequest::name].
887 ///
888 /// This is a **required** field for requests.
889 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
890 self.0.request.name = v.into();
891 self
892 }
893 }
894
895 #[doc(hidden)]
896 impl crate::RequestBuilder for DeleteEntry {
897 fn request_options(&mut self) -> &mut crate::RequestOptions {
898 &mut self.0.options
899 }
900 }
901
902 /// The request builder for [DataCatalog::get_entry][crate::client::DataCatalog::get_entry] calls.
903 ///
904 /// # Example
905 /// ```
906 /// # use google_cloud_datacatalog_v1::builder::data_catalog::GetEntry;
907 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
908 ///
909 /// let builder = prepare_request_builder();
910 /// let response = builder.send().await?;
911 /// # Ok(()) }
912 ///
913 /// fn prepare_request_builder() -> GetEntry {
914 /// # panic!();
915 /// // ... details omitted ...
916 /// }
917 /// ```
918 #[derive(Clone, Debug)]
919 pub struct GetEntry(RequestBuilder<crate::model::GetEntryRequest>);
920
921 impl GetEntry {
922 pub(crate) fn new(
923 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
924 ) -> Self {
925 Self(RequestBuilder::new(stub))
926 }
927
928 /// Sets the full request, replacing any prior values.
929 pub fn with_request<V: Into<crate::model::GetEntryRequest>>(mut self, v: V) -> Self {
930 self.0.request = v.into();
931 self
932 }
933
934 /// Sets all the options, replacing any prior values.
935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
936 self.0.options = v.into();
937 self
938 }
939
940 /// Sends the request.
941 pub async fn send(self) -> Result<crate::model::Entry> {
942 (*self.0.stub)
943 .get_entry(self.0.request, self.0.options)
944 .await
945 .map(crate::Response::into_body)
946 }
947
948 /// Sets the value of [name][crate::model::GetEntryRequest::name].
949 ///
950 /// This is a **required** field for requests.
951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
952 self.0.request.name = v.into();
953 self
954 }
955 }
956
957 #[doc(hidden)]
958 impl crate::RequestBuilder for GetEntry {
959 fn request_options(&mut self) -> &mut crate::RequestOptions {
960 &mut self.0.options
961 }
962 }
963
964 /// The request builder for [DataCatalog::lookup_entry][crate::client::DataCatalog::lookup_entry] calls.
965 ///
966 /// # Example
967 /// ```
968 /// # use google_cloud_datacatalog_v1::builder::data_catalog::LookupEntry;
969 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
970 ///
971 /// let builder = prepare_request_builder();
972 /// let response = builder.send().await?;
973 /// # Ok(()) }
974 ///
975 /// fn prepare_request_builder() -> LookupEntry {
976 /// # panic!();
977 /// // ... details omitted ...
978 /// }
979 /// ```
980 #[derive(Clone, Debug)]
981 pub struct LookupEntry(RequestBuilder<crate::model::LookupEntryRequest>);
982
983 impl LookupEntry {
984 pub(crate) fn new(
985 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
986 ) -> Self {
987 Self(RequestBuilder::new(stub))
988 }
989
990 /// Sets the full request, replacing any prior values.
991 pub fn with_request<V: Into<crate::model::LookupEntryRequest>>(mut self, v: V) -> Self {
992 self.0.request = v.into();
993 self
994 }
995
996 /// Sets all the options, replacing any prior values.
997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
998 self.0.options = v.into();
999 self
1000 }
1001
1002 /// Sends the request.
1003 pub async fn send(self) -> Result<crate::model::Entry> {
1004 (*self.0.stub)
1005 .lookup_entry(self.0.request, self.0.options)
1006 .await
1007 .map(crate::Response::into_body)
1008 }
1009
1010 /// Sets the value of [project][crate::model::LookupEntryRequest::project].
1011 pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
1012 self.0.request.project = v.into();
1013 self
1014 }
1015
1016 /// Sets the value of [location][crate::model::LookupEntryRequest::location].
1017 pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
1018 self.0.request.location = v.into();
1019 self
1020 }
1021
1022 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name].
1023 ///
1024 /// Note that all the setters affecting `target_name` are
1025 /// mutually exclusive.
1026 pub fn set_target_name<T: Into<Option<crate::model::lookup_entry_request::TargetName>>>(
1027 mut self,
1028 v: T,
1029 ) -> Self {
1030 self.0.request.target_name = v.into();
1031 self
1032 }
1033
1034 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name]
1035 /// to hold a `LinkedResource`.
1036 ///
1037 /// Note that all the setters affecting `target_name` are
1038 /// mutually exclusive.
1039 pub fn set_linked_resource<T: std::convert::Into<std::string::String>>(
1040 mut self,
1041 v: T,
1042 ) -> Self {
1043 self.0.request = self.0.request.set_linked_resource(v);
1044 self
1045 }
1046
1047 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name]
1048 /// to hold a `SqlResource`.
1049 ///
1050 /// Note that all the setters affecting `target_name` are
1051 /// mutually exclusive.
1052 pub fn set_sql_resource<T: std::convert::Into<std::string::String>>(
1053 mut self,
1054 v: T,
1055 ) -> Self {
1056 self.0.request = self.0.request.set_sql_resource(v);
1057 self
1058 }
1059
1060 /// Sets the value of [target_name][crate::model::LookupEntryRequest::target_name]
1061 /// to hold a `FullyQualifiedName`.
1062 ///
1063 /// Note that all the setters affecting `target_name` are
1064 /// mutually exclusive.
1065 pub fn set_fully_qualified_name<T: std::convert::Into<std::string::String>>(
1066 mut self,
1067 v: T,
1068 ) -> Self {
1069 self.0.request = self.0.request.set_fully_qualified_name(v);
1070 self
1071 }
1072 }
1073
1074 #[doc(hidden)]
1075 impl crate::RequestBuilder for LookupEntry {
1076 fn request_options(&mut self) -> &mut crate::RequestOptions {
1077 &mut self.0.options
1078 }
1079 }
1080
1081 /// The request builder for [DataCatalog::list_entries][crate::client::DataCatalog::list_entries] calls.
1082 ///
1083 /// # Example
1084 /// ```
1085 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ListEntries;
1086 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1087 /// use google_cloud_gax::paginator::ItemPaginator;
1088 ///
1089 /// let builder = prepare_request_builder();
1090 /// let mut items = builder.by_item();
1091 /// while let Some(result) = items.next().await {
1092 /// let item = result?;
1093 /// }
1094 /// # Ok(()) }
1095 ///
1096 /// fn prepare_request_builder() -> ListEntries {
1097 /// # panic!();
1098 /// // ... details omitted ...
1099 /// }
1100 /// ```
1101 #[derive(Clone, Debug)]
1102 pub struct ListEntries(RequestBuilder<crate::model::ListEntriesRequest>);
1103
1104 impl ListEntries {
1105 pub(crate) fn new(
1106 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1107 ) -> Self {
1108 Self(RequestBuilder::new(stub))
1109 }
1110
1111 /// Sets the full request, replacing any prior values.
1112 pub fn with_request<V: Into<crate::model::ListEntriesRequest>>(mut self, v: V) -> Self {
1113 self.0.request = v.into();
1114 self
1115 }
1116
1117 /// Sets all the options, replacing any prior values.
1118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1119 self.0.options = v.into();
1120 self
1121 }
1122
1123 /// Sends the request.
1124 pub async fn send(self) -> Result<crate::model::ListEntriesResponse> {
1125 (*self.0.stub)
1126 .list_entries(self.0.request, self.0.options)
1127 .await
1128 .map(crate::Response::into_body)
1129 }
1130
1131 /// Streams each page in the collection.
1132 pub fn by_page(
1133 self,
1134 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListEntriesResponse, crate::Error>
1135 {
1136 use std::clone::Clone;
1137 let token = self.0.request.page_token.clone();
1138 let execute = move |token: String| {
1139 let mut builder = self.clone();
1140 builder.0.request = builder.0.request.set_page_token(token);
1141 builder.send()
1142 };
1143 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1144 }
1145
1146 /// Streams each item in the collection.
1147 pub fn by_item(
1148 self,
1149 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1150 crate::model::ListEntriesResponse,
1151 crate::Error,
1152 > {
1153 use google_cloud_gax::paginator::Paginator;
1154 self.by_page().items()
1155 }
1156
1157 /// Sets the value of [parent][crate::model::ListEntriesRequest::parent].
1158 ///
1159 /// This is a **required** field for requests.
1160 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1161 self.0.request.parent = v.into();
1162 self
1163 }
1164
1165 /// Sets the value of [page_size][crate::model::ListEntriesRequest::page_size].
1166 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1167 self.0.request.page_size = v.into();
1168 self
1169 }
1170
1171 /// Sets the value of [page_token][crate::model::ListEntriesRequest::page_token].
1172 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1173 self.0.request.page_token = v.into();
1174 self
1175 }
1176
1177 /// Sets the value of [read_mask][crate::model::ListEntriesRequest::read_mask].
1178 pub fn set_read_mask<T>(mut self, v: T) -> Self
1179 where
1180 T: std::convert::Into<wkt::FieldMask>,
1181 {
1182 self.0.request.read_mask = std::option::Option::Some(v.into());
1183 self
1184 }
1185
1186 /// Sets or clears the value of [read_mask][crate::model::ListEntriesRequest::read_mask].
1187 pub fn set_or_clear_read_mask<T>(mut self, v: std::option::Option<T>) -> Self
1188 where
1189 T: std::convert::Into<wkt::FieldMask>,
1190 {
1191 self.0.request.read_mask = v.map(|x| x.into());
1192 self
1193 }
1194 }
1195
1196 #[doc(hidden)]
1197 impl crate::RequestBuilder for ListEntries {
1198 fn request_options(&mut self) -> &mut crate::RequestOptions {
1199 &mut self.0.options
1200 }
1201 }
1202
1203 /// The request builder for [DataCatalog::modify_entry_overview][crate::client::DataCatalog::modify_entry_overview] calls.
1204 ///
1205 /// # Example
1206 /// ```
1207 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ModifyEntryOverview;
1208 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1209 ///
1210 /// let builder = prepare_request_builder();
1211 /// let response = builder.send().await?;
1212 /// # Ok(()) }
1213 ///
1214 /// fn prepare_request_builder() -> ModifyEntryOverview {
1215 /// # panic!();
1216 /// // ... details omitted ...
1217 /// }
1218 /// ```
1219 #[derive(Clone, Debug)]
1220 pub struct ModifyEntryOverview(RequestBuilder<crate::model::ModifyEntryOverviewRequest>);
1221
1222 impl ModifyEntryOverview {
1223 pub(crate) fn new(
1224 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1225 ) -> Self {
1226 Self(RequestBuilder::new(stub))
1227 }
1228
1229 /// Sets the full request, replacing any prior values.
1230 pub fn with_request<V: Into<crate::model::ModifyEntryOverviewRequest>>(
1231 mut self,
1232 v: V,
1233 ) -> Self {
1234 self.0.request = v.into();
1235 self
1236 }
1237
1238 /// Sets all the options, replacing any prior values.
1239 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1240 self.0.options = v.into();
1241 self
1242 }
1243
1244 /// Sends the request.
1245 pub async fn send(self) -> Result<crate::model::EntryOverview> {
1246 (*self.0.stub)
1247 .modify_entry_overview(self.0.request, self.0.options)
1248 .await
1249 .map(crate::Response::into_body)
1250 }
1251
1252 /// Sets the value of [name][crate::model::ModifyEntryOverviewRequest::name].
1253 ///
1254 /// This is a **required** field for requests.
1255 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1256 self.0.request.name = v.into();
1257 self
1258 }
1259
1260 /// Sets the value of [entry_overview][crate::model::ModifyEntryOverviewRequest::entry_overview].
1261 ///
1262 /// This is a **required** field for requests.
1263 pub fn set_entry_overview<T>(mut self, v: T) -> Self
1264 where
1265 T: std::convert::Into<crate::model::EntryOverview>,
1266 {
1267 self.0.request.entry_overview = std::option::Option::Some(v.into());
1268 self
1269 }
1270
1271 /// Sets or clears the value of [entry_overview][crate::model::ModifyEntryOverviewRequest::entry_overview].
1272 ///
1273 /// This is a **required** field for requests.
1274 pub fn set_or_clear_entry_overview<T>(mut self, v: std::option::Option<T>) -> Self
1275 where
1276 T: std::convert::Into<crate::model::EntryOverview>,
1277 {
1278 self.0.request.entry_overview = v.map(|x| x.into());
1279 self
1280 }
1281 }
1282
1283 #[doc(hidden)]
1284 impl crate::RequestBuilder for ModifyEntryOverview {
1285 fn request_options(&mut self) -> &mut crate::RequestOptions {
1286 &mut self.0.options
1287 }
1288 }
1289
1290 /// The request builder for [DataCatalog::modify_entry_contacts][crate::client::DataCatalog::modify_entry_contacts] calls.
1291 ///
1292 /// # Example
1293 /// ```
1294 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ModifyEntryContacts;
1295 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1296 ///
1297 /// let builder = prepare_request_builder();
1298 /// let response = builder.send().await?;
1299 /// # Ok(()) }
1300 ///
1301 /// fn prepare_request_builder() -> ModifyEntryContacts {
1302 /// # panic!();
1303 /// // ... details omitted ...
1304 /// }
1305 /// ```
1306 #[derive(Clone, Debug)]
1307 pub struct ModifyEntryContacts(RequestBuilder<crate::model::ModifyEntryContactsRequest>);
1308
1309 impl ModifyEntryContacts {
1310 pub(crate) fn new(
1311 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1312 ) -> Self {
1313 Self(RequestBuilder::new(stub))
1314 }
1315
1316 /// Sets the full request, replacing any prior values.
1317 pub fn with_request<V: Into<crate::model::ModifyEntryContactsRequest>>(
1318 mut self,
1319 v: V,
1320 ) -> Self {
1321 self.0.request = v.into();
1322 self
1323 }
1324
1325 /// Sets all the options, replacing any prior values.
1326 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1327 self.0.options = v.into();
1328 self
1329 }
1330
1331 /// Sends the request.
1332 pub async fn send(self) -> Result<crate::model::Contacts> {
1333 (*self.0.stub)
1334 .modify_entry_contacts(self.0.request, self.0.options)
1335 .await
1336 .map(crate::Response::into_body)
1337 }
1338
1339 /// Sets the value of [name][crate::model::ModifyEntryContactsRequest::name].
1340 ///
1341 /// This is a **required** field for requests.
1342 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1343 self.0.request.name = v.into();
1344 self
1345 }
1346
1347 /// Sets the value of [contacts][crate::model::ModifyEntryContactsRequest::contacts].
1348 ///
1349 /// This is a **required** field for requests.
1350 pub fn set_contacts<T>(mut self, v: T) -> Self
1351 where
1352 T: std::convert::Into<crate::model::Contacts>,
1353 {
1354 self.0.request.contacts = std::option::Option::Some(v.into());
1355 self
1356 }
1357
1358 /// Sets or clears the value of [contacts][crate::model::ModifyEntryContactsRequest::contacts].
1359 ///
1360 /// This is a **required** field for requests.
1361 pub fn set_or_clear_contacts<T>(mut self, v: std::option::Option<T>) -> Self
1362 where
1363 T: std::convert::Into<crate::model::Contacts>,
1364 {
1365 self.0.request.contacts = v.map(|x| x.into());
1366 self
1367 }
1368 }
1369
1370 #[doc(hidden)]
1371 impl crate::RequestBuilder for ModifyEntryContacts {
1372 fn request_options(&mut self) -> &mut crate::RequestOptions {
1373 &mut self.0.options
1374 }
1375 }
1376
1377 /// The request builder for [DataCatalog::create_tag_template][crate::client::DataCatalog::create_tag_template] calls.
1378 ///
1379 /// # Example
1380 /// ```
1381 /// # use google_cloud_datacatalog_v1::builder::data_catalog::CreateTagTemplate;
1382 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1383 ///
1384 /// let builder = prepare_request_builder();
1385 /// let response = builder.send().await?;
1386 /// # Ok(()) }
1387 ///
1388 /// fn prepare_request_builder() -> CreateTagTemplate {
1389 /// # panic!();
1390 /// // ... details omitted ...
1391 /// }
1392 /// ```
1393 #[derive(Clone, Debug)]
1394 pub struct CreateTagTemplate(RequestBuilder<crate::model::CreateTagTemplateRequest>);
1395
1396 impl CreateTagTemplate {
1397 pub(crate) fn new(
1398 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1399 ) -> Self {
1400 Self(RequestBuilder::new(stub))
1401 }
1402
1403 /// Sets the full request, replacing any prior values.
1404 pub fn with_request<V: Into<crate::model::CreateTagTemplateRequest>>(
1405 mut self,
1406 v: V,
1407 ) -> Self {
1408 self.0.request = v.into();
1409 self
1410 }
1411
1412 /// Sets all the options, replacing any prior values.
1413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1414 self.0.options = v.into();
1415 self
1416 }
1417
1418 /// Sends the request.
1419 pub async fn send(self) -> Result<crate::model::TagTemplate> {
1420 (*self.0.stub)
1421 .create_tag_template(self.0.request, self.0.options)
1422 .await
1423 .map(crate::Response::into_body)
1424 }
1425
1426 /// Sets the value of [parent][crate::model::CreateTagTemplateRequest::parent].
1427 ///
1428 /// This is a **required** field for requests.
1429 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1430 self.0.request.parent = v.into();
1431 self
1432 }
1433
1434 /// Sets the value of [tag_template_id][crate::model::CreateTagTemplateRequest::tag_template_id].
1435 ///
1436 /// This is a **required** field for requests.
1437 pub fn set_tag_template_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1438 self.0.request.tag_template_id = v.into();
1439 self
1440 }
1441
1442 /// Sets the value of [tag_template][crate::model::CreateTagTemplateRequest::tag_template].
1443 ///
1444 /// This is a **required** field for requests.
1445 pub fn set_tag_template<T>(mut self, v: T) -> Self
1446 where
1447 T: std::convert::Into<crate::model::TagTemplate>,
1448 {
1449 self.0.request.tag_template = std::option::Option::Some(v.into());
1450 self
1451 }
1452
1453 /// Sets or clears the value of [tag_template][crate::model::CreateTagTemplateRequest::tag_template].
1454 ///
1455 /// This is a **required** field for requests.
1456 pub fn set_or_clear_tag_template<T>(mut self, v: std::option::Option<T>) -> Self
1457 where
1458 T: std::convert::Into<crate::model::TagTemplate>,
1459 {
1460 self.0.request.tag_template = v.map(|x| x.into());
1461 self
1462 }
1463 }
1464
1465 #[doc(hidden)]
1466 impl crate::RequestBuilder for CreateTagTemplate {
1467 fn request_options(&mut self) -> &mut crate::RequestOptions {
1468 &mut self.0.options
1469 }
1470 }
1471
1472 /// The request builder for [DataCatalog::get_tag_template][crate::client::DataCatalog::get_tag_template] calls.
1473 ///
1474 /// # Example
1475 /// ```
1476 /// # use google_cloud_datacatalog_v1::builder::data_catalog::GetTagTemplate;
1477 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1478 ///
1479 /// let builder = prepare_request_builder();
1480 /// let response = builder.send().await?;
1481 /// # Ok(()) }
1482 ///
1483 /// fn prepare_request_builder() -> GetTagTemplate {
1484 /// # panic!();
1485 /// // ... details omitted ...
1486 /// }
1487 /// ```
1488 #[derive(Clone, Debug)]
1489 pub struct GetTagTemplate(RequestBuilder<crate::model::GetTagTemplateRequest>);
1490
1491 impl GetTagTemplate {
1492 pub(crate) fn new(
1493 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1494 ) -> Self {
1495 Self(RequestBuilder::new(stub))
1496 }
1497
1498 /// Sets the full request, replacing any prior values.
1499 pub fn with_request<V: Into<crate::model::GetTagTemplateRequest>>(mut self, v: V) -> Self {
1500 self.0.request = v.into();
1501 self
1502 }
1503
1504 /// Sets all the options, replacing any prior values.
1505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1506 self.0.options = v.into();
1507 self
1508 }
1509
1510 /// Sends the request.
1511 pub async fn send(self) -> Result<crate::model::TagTemplate> {
1512 (*self.0.stub)
1513 .get_tag_template(self.0.request, self.0.options)
1514 .await
1515 .map(crate::Response::into_body)
1516 }
1517
1518 /// Sets the value of [name][crate::model::GetTagTemplateRequest::name].
1519 ///
1520 /// This is a **required** field for requests.
1521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1522 self.0.request.name = v.into();
1523 self
1524 }
1525 }
1526
1527 #[doc(hidden)]
1528 impl crate::RequestBuilder for GetTagTemplate {
1529 fn request_options(&mut self) -> &mut crate::RequestOptions {
1530 &mut self.0.options
1531 }
1532 }
1533
1534 /// The request builder for [DataCatalog::update_tag_template][crate::client::DataCatalog::update_tag_template] calls.
1535 ///
1536 /// # Example
1537 /// ```
1538 /// # use google_cloud_datacatalog_v1::builder::data_catalog::UpdateTagTemplate;
1539 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1540 ///
1541 /// let builder = prepare_request_builder();
1542 /// let response = builder.send().await?;
1543 /// # Ok(()) }
1544 ///
1545 /// fn prepare_request_builder() -> UpdateTagTemplate {
1546 /// # panic!();
1547 /// // ... details omitted ...
1548 /// }
1549 /// ```
1550 #[derive(Clone, Debug)]
1551 pub struct UpdateTagTemplate(RequestBuilder<crate::model::UpdateTagTemplateRequest>);
1552
1553 impl UpdateTagTemplate {
1554 pub(crate) fn new(
1555 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1556 ) -> Self {
1557 Self(RequestBuilder::new(stub))
1558 }
1559
1560 /// Sets the full request, replacing any prior values.
1561 pub fn with_request<V: Into<crate::model::UpdateTagTemplateRequest>>(
1562 mut self,
1563 v: V,
1564 ) -> Self {
1565 self.0.request = v.into();
1566 self
1567 }
1568
1569 /// Sets all the options, replacing any prior values.
1570 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1571 self.0.options = v.into();
1572 self
1573 }
1574
1575 /// Sends the request.
1576 pub async fn send(self) -> Result<crate::model::TagTemplate> {
1577 (*self.0.stub)
1578 .update_tag_template(self.0.request, self.0.options)
1579 .await
1580 .map(crate::Response::into_body)
1581 }
1582
1583 /// Sets the value of [tag_template][crate::model::UpdateTagTemplateRequest::tag_template].
1584 ///
1585 /// This is a **required** field for requests.
1586 pub fn set_tag_template<T>(mut self, v: T) -> Self
1587 where
1588 T: std::convert::Into<crate::model::TagTemplate>,
1589 {
1590 self.0.request.tag_template = std::option::Option::Some(v.into());
1591 self
1592 }
1593
1594 /// Sets or clears the value of [tag_template][crate::model::UpdateTagTemplateRequest::tag_template].
1595 ///
1596 /// This is a **required** field for requests.
1597 pub fn set_or_clear_tag_template<T>(mut self, v: std::option::Option<T>) -> Self
1598 where
1599 T: std::convert::Into<crate::model::TagTemplate>,
1600 {
1601 self.0.request.tag_template = v.map(|x| x.into());
1602 self
1603 }
1604
1605 /// Sets the value of [update_mask][crate::model::UpdateTagTemplateRequest::update_mask].
1606 pub fn set_update_mask<T>(mut self, v: T) -> Self
1607 where
1608 T: std::convert::Into<wkt::FieldMask>,
1609 {
1610 self.0.request.update_mask = std::option::Option::Some(v.into());
1611 self
1612 }
1613
1614 /// Sets or clears the value of [update_mask][crate::model::UpdateTagTemplateRequest::update_mask].
1615 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1616 where
1617 T: std::convert::Into<wkt::FieldMask>,
1618 {
1619 self.0.request.update_mask = v.map(|x| x.into());
1620 self
1621 }
1622 }
1623
1624 #[doc(hidden)]
1625 impl crate::RequestBuilder for UpdateTagTemplate {
1626 fn request_options(&mut self) -> &mut crate::RequestOptions {
1627 &mut self.0.options
1628 }
1629 }
1630
1631 /// The request builder for [DataCatalog::delete_tag_template][crate::client::DataCatalog::delete_tag_template] calls.
1632 ///
1633 /// # Example
1634 /// ```
1635 /// # use google_cloud_datacatalog_v1::builder::data_catalog::DeleteTagTemplate;
1636 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1637 ///
1638 /// let builder = prepare_request_builder();
1639 /// let response = builder.send().await?;
1640 /// # Ok(()) }
1641 ///
1642 /// fn prepare_request_builder() -> DeleteTagTemplate {
1643 /// # panic!();
1644 /// // ... details omitted ...
1645 /// }
1646 /// ```
1647 #[derive(Clone, Debug)]
1648 pub struct DeleteTagTemplate(RequestBuilder<crate::model::DeleteTagTemplateRequest>);
1649
1650 impl DeleteTagTemplate {
1651 pub(crate) fn new(
1652 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1653 ) -> Self {
1654 Self(RequestBuilder::new(stub))
1655 }
1656
1657 /// Sets the full request, replacing any prior values.
1658 pub fn with_request<V: Into<crate::model::DeleteTagTemplateRequest>>(
1659 mut self,
1660 v: V,
1661 ) -> Self {
1662 self.0.request = v.into();
1663 self
1664 }
1665
1666 /// Sets all the options, replacing any prior values.
1667 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1668 self.0.options = v.into();
1669 self
1670 }
1671
1672 /// Sends the request.
1673 pub async fn send(self) -> Result<()> {
1674 (*self.0.stub)
1675 .delete_tag_template(self.0.request, self.0.options)
1676 .await
1677 .map(crate::Response::into_body)
1678 }
1679
1680 /// Sets the value of [name][crate::model::DeleteTagTemplateRequest::name].
1681 ///
1682 /// This is a **required** field for requests.
1683 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1684 self.0.request.name = v.into();
1685 self
1686 }
1687
1688 /// Sets the value of [force][crate::model::DeleteTagTemplateRequest::force].
1689 ///
1690 /// This is a **required** field for requests.
1691 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1692 self.0.request.force = v.into();
1693 self
1694 }
1695 }
1696
1697 #[doc(hidden)]
1698 impl crate::RequestBuilder for DeleteTagTemplate {
1699 fn request_options(&mut self) -> &mut crate::RequestOptions {
1700 &mut self.0.options
1701 }
1702 }
1703
1704 /// The request builder for [DataCatalog::create_tag_template_field][crate::client::DataCatalog::create_tag_template_field] calls.
1705 ///
1706 /// # Example
1707 /// ```
1708 /// # use google_cloud_datacatalog_v1::builder::data_catalog::CreateTagTemplateField;
1709 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1710 ///
1711 /// let builder = prepare_request_builder();
1712 /// let response = builder.send().await?;
1713 /// # Ok(()) }
1714 ///
1715 /// fn prepare_request_builder() -> CreateTagTemplateField {
1716 /// # panic!();
1717 /// // ... details omitted ...
1718 /// }
1719 /// ```
1720 #[derive(Clone, Debug)]
1721 pub struct CreateTagTemplateField(RequestBuilder<crate::model::CreateTagTemplateFieldRequest>);
1722
1723 impl CreateTagTemplateField {
1724 pub(crate) fn new(
1725 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1726 ) -> Self {
1727 Self(RequestBuilder::new(stub))
1728 }
1729
1730 /// Sets the full request, replacing any prior values.
1731 pub fn with_request<V: Into<crate::model::CreateTagTemplateFieldRequest>>(
1732 mut self,
1733 v: V,
1734 ) -> Self {
1735 self.0.request = v.into();
1736 self
1737 }
1738
1739 /// Sets all the options, replacing any prior values.
1740 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1741 self.0.options = v.into();
1742 self
1743 }
1744
1745 /// Sends the request.
1746 pub async fn send(self) -> Result<crate::model::TagTemplateField> {
1747 (*self.0.stub)
1748 .create_tag_template_field(self.0.request, self.0.options)
1749 .await
1750 .map(crate::Response::into_body)
1751 }
1752
1753 /// Sets the value of [parent][crate::model::CreateTagTemplateFieldRequest::parent].
1754 ///
1755 /// This is a **required** field for requests.
1756 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1757 self.0.request.parent = v.into();
1758 self
1759 }
1760
1761 /// Sets the value of [tag_template_field_id][crate::model::CreateTagTemplateFieldRequest::tag_template_field_id].
1762 ///
1763 /// This is a **required** field for requests.
1764 pub fn set_tag_template_field_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1765 self.0.request.tag_template_field_id = v.into();
1766 self
1767 }
1768
1769 /// Sets the value of [tag_template_field][crate::model::CreateTagTemplateFieldRequest::tag_template_field].
1770 ///
1771 /// This is a **required** field for requests.
1772 pub fn set_tag_template_field<T>(mut self, v: T) -> Self
1773 where
1774 T: std::convert::Into<crate::model::TagTemplateField>,
1775 {
1776 self.0.request.tag_template_field = std::option::Option::Some(v.into());
1777 self
1778 }
1779
1780 /// Sets or clears the value of [tag_template_field][crate::model::CreateTagTemplateFieldRequest::tag_template_field].
1781 ///
1782 /// This is a **required** field for requests.
1783 pub fn set_or_clear_tag_template_field<T>(mut self, v: std::option::Option<T>) -> Self
1784 where
1785 T: std::convert::Into<crate::model::TagTemplateField>,
1786 {
1787 self.0.request.tag_template_field = v.map(|x| x.into());
1788 self
1789 }
1790 }
1791
1792 #[doc(hidden)]
1793 impl crate::RequestBuilder for CreateTagTemplateField {
1794 fn request_options(&mut self) -> &mut crate::RequestOptions {
1795 &mut self.0.options
1796 }
1797 }
1798
1799 /// The request builder for [DataCatalog::update_tag_template_field][crate::client::DataCatalog::update_tag_template_field] calls.
1800 ///
1801 /// # Example
1802 /// ```
1803 /// # use google_cloud_datacatalog_v1::builder::data_catalog::UpdateTagTemplateField;
1804 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1805 ///
1806 /// let builder = prepare_request_builder();
1807 /// let response = builder.send().await?;
1808 /// # Ok(()) }
1809 ///
1810 /// fn prepare_request_builder() -> UpdateTagTemplateField {
1811 /// # panic!();
1812 /// // ... details omitted ...
1813 /// }
1814 /// ```
1815 #[derive(Clone, Debug)]
1816 pub struct UpdateTagTemplateField(RequestBuilder<crate::model::UpdateTagTemplateFieldRequest>);
1817
1818 impl UpdateTagTemplateField {
1819 pub(crate) fn new(
1820 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1821 ) -> Self {
1822 Self(RequestBuilder::new(stub))
1823 }
1824
1825 /// Sets the full request, replacing any prior values.
1826 pub fn with_request<V: Into<crate::model::UpdateTagTemplateFieldRequest>>(
1827 mut self,
1828 v: V,
1829 ) -> Self {
1830 self.0.request = v.into();
1831 self
1832 }
1833
1834 /// Sets all the options, replacing any prior values.
1835 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1836 self.0.options = v.into();
1837 self
1838 }
1839
1840 /// Sends the request.
1841 pub async fn send(self) -> Result<crate::model::TagTemplateField> {
1842 (*self.0.stub)
1843 .update_tag_template_field(self.0.request, self.0.options)
1844 .await
1845 .map(crate::Response::into_body)
1846 }
1847
1848 /// Sets the value of [name][crate::model::UpdateTagTemplateFieldRequest::name].
1849 ///
1850 /// This is a **required** field for requests.
1851 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1852 self.0.request.name = v.into();
1853 self
1854 }
1855
1856 /// Sets the value of [tag_template_field][crate::model::UpdateTagTemplateFieldRequest::tag_template_field].
1857 ///
1858 /// This is a **required** field for requests.
1859 pub fn set_tag_template_field<T>(mut self, v: T) -> Self
1860 where
1861 T: std::convert::Into<crate::model::TagTemplateField>,
1862 {
1863 self.0.request.tag_template_field = std::option::Option::Some(v.into());
1864 self
1865 }
1866
1867 /// Sets or clears the value of [tag_template_field][crate::model::UpdateTagTemplateFieldRequest::tag_template_field].
1868 ///
1869 /// This is a **required** field for requests.
1870 pub fn set_or_clear_tag_template_field<T>(mut self, v: std::option::Option<T>) -> Self
1871 where
1872 T: std::convert::Into<crate::model::TagTemplateField>,
1873 {
1874 self.0.request.tag_template_field = v.map(|x| x.into());
1875 self
1876 }
1877
1878 /// Sets the value of [update_mask][crate::model::UpdateTagTemplateFieldRequest::update_mask].
1879 pub fn set_update_mask<T>(mut self, v: T) -> Self
1880 where
1881 T: std::convert::Into<wkt::FieldMask>,
1882 {
1883 self.0.request.update_mask = std::option::Option::Some(v.into());
1884 self
1885 }
1886
1887 /// Sets or clears the value of [update_mask][crate::model::UpdateTagTemplateFieldRequest::update_mask].
1888 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1889 where
1890 T: std::convert::Into<wkt::FieldMask>,
1891 {
1892 self.0.request.update_mask = v.map(|x| x.into());
1893 self
1894 }
1895 }
1896
1897 #[doc(hidden)]
1898 impl crate::RequestBuilder for UpdateTagTemplateField {
1899 fn request_options(&mut self) -> &mut crate::RequestOptions {
1900 &mut self.0.options
1901 }
1902 }
1903
1904 /// The request builder for [DataCatalog::rename_tag_template_field][crate::client::DataCatalog::rename_tag_template_field] calls.
1905 ///
1906 /// # Example
1907 /// ```
1908 /// # use google_cloud_datacatalog_v1::builder::data_catalog::RenameTagTemplateField;
1909 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1910 ///
1911 /// let builder = prepare_request_builder();
1912 /// let response = builder.send().await?;
1913 /// # Ok(()) }
1914 ///
1915 /// fn prepare_request_builder() -> RenameTagTemplateField {
1916 /// # panic!();
1917 /// // ... details omitted ...
1918 /// }
1919 /// ```
1920 #[derive(Clone, Debug)]
1921 pub struct RenameTagTemplateField(RequestBuilder<crate::model::RenameTagTemplateFieldRequest>);
1922
1923 impl RenameTagTemplateField {
1924 pub(crate) fn new(
1925 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
1926 ) -> Self {
1927 Self(RequestBuilder::new(stub))
1928 }
1929
1930 /// Sets the full request, replacing any prior values.
1931 pub fn with_request<V: Into<crate::model::RenameTagTemplateFieldRequest>>(
1932 mut self,
1933 v: V,
1934 ) -> Self {
1935 self.0.request = v.into();
1936 self
1937 }
1938
1939 /// Sets all the options, replacing any prior values.
1940 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1941 self.0.options = v.into();
1942 self
1943 }
1944
1945 /// Sends the request.
1946 pub async fn send(self) -> Result<crate::model::TagTemplateField> {
1947 (*self.0.stub)
1948 .rename_tag_template_field(self.0.request, self.0.options)
1949 .await
1950 .map(crate::Response::into_body)
1951 }
1952
1953 /// Sets the value of [name][crate::model::RenameTagTemplateFieldRequest::name].
1954 ///
1955 /// This is a **required** field for requests.
1956 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1957 self.0.request.name = v.into();
1958 self
1959 }
1960
1961 /// Sets the value of [new_tag_template_field_id][crate::model::RenameTagTemplateFieldRequest::new_tag_template_field_id].
1962 ///
1963 /// This is a **required** field for requests.
1964 pub fn set_new_tag_template_field_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1965 self.0.request.new_tag_template_field_id = v.into();
1966 self
1967 }
1968 }
1969
1970 #[doc(hidden)]
1971 impl crate::RequestBuilder for RenameTagTemplateField {
1972 fn request_options(&mut self) -> &mut crate::RequestOptions {
1973 &mut self.0.options
1974 }
1975 }
1976
1977 /// The request builder for [DataCatalog::rename_tag_template_field_enum_value][crate::client::DataCatalog::rename_tag_template_field_enum_value] calls.
1978 ///
1979 /// # Example
1980 /// ```
1981 /// # use google_cloud_datacatalog_v1::builder::data_catalog::RenameTagTemplateFieldEnumValue;
1982 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
1983 ///
1984 /// let builder = prepare_request_builder();
1985 /// let response = builder.send().await?;
1986 /// # Ok(()) }
1987 ///
1988 /// fn prepare_request_builder() -> RenameTagTemplateFieldEnumValue {
1989 /// # panic!();
1990 /// // ... details omitted ...
1991 /// }
1992 /// ```
1993 #[derive(Clone, Debug)]
1994 pub struct RenameTagTemplateFieldEnumValue(
1995 RequestBuilder<crate::model::RenameTagTemplateFieldEnumValueRequest>,
1996 );
1997
1998 impl RenameTagTemplateFieldEnumValue {
1999 pub(crate) fn new(
2000 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2001 ) -> Self {
2002 Self(RequestBuilder::new(stub))
2003 }
2004
2005 /// Sets the full request, replacing any prior values.
2006 pub fn with_request<V: Into<crate::model::RenameTagTemplateFieldEnumValueRequest>>(
2007 mut self,
2008 v: V,
2009 ) -> Self {
2010 self.0.request = v.into();
2011 self
2012 }
2013
2014 /// Sets all the options, replacing any prior values.
2015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2016 self.0.options = v.into();
2017 self
2018 }
2019
2020 /// Sends the request.
2021 pub async fn send(self) -> Result<crate::model::TagTemplateField> {
2022 (*self.0.stub)
2023 .rename_tag_template_field_enum_value(self.0.request, self.0.options)
2024 .await
2025 .map(crate::Response::into_body)
2026 }
2027
2028 /// Sets the value of [name][crate::model::RenameTagTemplateFieldEnumValueRequest::name].
2029 ///
2030 /// This is a **required** field for requests.
2031 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2032 self.0.request.name = v.into();
2033 self
2034 }
2035
2036 /// Sets the value of [new_enum_value_display_name][crate::model::RenameTagTemplateFieldEnumValueRequest::new_enum_value_display_name].
2037 ///
2038 /// This is a **required** field for requests.
2039 pub fn set_new_enum_value_display_name<T: Into<std::string::String>>(
2040 mut self,
2041 v: T,
2042 ) -> Self {
2043 self.0.request.new_enum_value_display_name = v.into();
2044 self
2045 }
2046 }
2047
2048 #[doc(hidden)]
2049 impl crate::RequestBuilder for RenameTagTemplateFieldEnumValue {
2050 fn request_options(&mut self) -> &mut crate::RequestOptions {
2051 &mut self.0.options
2052 }
2053 }
2054
2055 /// The request builder for [DataCatalog::delete_tag_template_field][crate::client::DataCatalog::delete_tag_template_field] calls.
2056 ///
2057 /// # Example
2058 /// ```
2059 /// # use google_cloud_datacatalog_v1::builder::data_catalog::DeleteTagTemplateField;
2060 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2061 ///
2062 /// let builder = prepare_request_builder();
2063 /// let response = builder.send().await?;
2064 /// # Ok(()) }
2065 ///
2066 /// fn prepare_request_builder() -> DeleteTagTemplateField {
2067 /// # panic!();
2068 /// // ... details omitted ...
2069 /// }
2070 /// ```
2071 #[derive(Clone, Debug)]
2072 pub struct DeleteTagTemplateField(RequestBuilder<crate::model::DeleteTagTemplateFieldRequest>);
2073
2074 impl DeleteTagTemplateField {
2075 pub(crate) fn new(
2076 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2077 ) -> Self {
2078 Self(RequestBuilder::new(stub))
2079 }
2080
2081 /// Sets the full request, replacing any prior values.
2082 pub fn with_request<V: Into<crate::model::DeleteTagTemplateFieldRequest>>(
2083 mut self,
2084 v: V,
2085 ) -> Self {
2086 self.0.request = v.into();
2087 self
2088 }
2089
2090 /// Sets all the options, replacing any prior values.
2091 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2092 self.0.options = v.into();
2093 self
2094 }
2095
2096 /// Sends the request.
2097 pub async fn send(self) -> Result<()> {
2098 (*self.0.stub)
2099 .delete_tag_template_field(self.0.request, self.0.options)
2100 .await
2101 .map(crate::Response::into_body)
2102 }
2103
2104 /// Sets the value of [name][crate::model::DeleteTagTemplateFieldRequest::name].
2105 ///
2106 /// This is a **required** field for requests.
2107 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2108 self.0.request.name = v.into();
2109 self
2110 }
2111
2112 /// Sets the value of [force][crate::model::DeleteTagTemplateFieldRequest::force].
2113 ///
2114 /// This is a **required** field for requests.
2115 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2116 self.0.request.force = v.into();
2117 self
2118 }
2119 }
2120
2121 #[doc(hidden)]
2122 impl crate::RequestBuilder for DeleteTagTemplateField {
2123 fn request_options(&mut self) -> &mut crate::RequestOptions {
2124 &mut self.0.options
2125 }
2126 }
2127
2128 /// The request builder for [DataCatalog::create_tag][crate::client::DataCatalog::create_tag] calls.
2129 ///
2130 /// # Example
2131 /// ```
2132 /// # use google_cloud_datacatalog_v1::builder::data_catalog::CreateTag;
2133 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2134 ///
2135 /// let builder = prepare_request_builder();
2136 /// let response = builder.send().await?;
2137 /// # Ok(()) }
2138 ///
2139 /// fn prepare_request_builder() -> CreateTag {
2140 /// # panic!();
2141 /// // ... details omitted ...
2142 /// }
2143 /// ```
2144 #[derive(Clone, Debug)]
2145 pub struct CreateTag(RequestBuilder<crate::model::CreateTagRequest>);
2146
2147 impl CreateTag {
2148 pub(crate) fn new(
2149 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2150 ) -> Self {
2151 Self(RequestBuilder::new(stub))
2152 }
2153
2154 /// Sets the full request, replacing any prior values.
2155 pub fn with_request<V: Into<crate::model::CreateTagRequest>>(mut self, v: V) -> Self {
2156 self.0.request = v.into();
2157 self
2158 }
2159
2160 /// Sets all the options, replacing any prior values.
2161 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2162 self.0.options = v.into();
2163 self
2164 }
2165
2166 /// Sends the request.
2167 pub async fn send(self) -> Result<crate::model::Tag> {
2168 (*self.0.stub)
2169 .create_tag(self.0.request, self.0.options)
2170 .await
2171 .map(crate::Response::into_body)
2172 }
2173
2174 /// Sets the value of [parent][crate::model::CreateTagRequest::parent].
2175 ///
2176 /// This is a **required** field for requests.
2177 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2178 self.0.request.parent = v.into();
2179 self
2180 }
2181
2182 /// Sets the value of [tag][crate::model::CreateTagRequest::tag].
2183 ///
2184 /// This is a **required** field for requests.
2185 pub fn set_tag<T>(mut self, v: T) -> Self
2186 where
2187 T: std::convert::Into<crate::model::Tag>,
2188 {
2189 self.0.request.tag = std::option::Option::Some(v.into());
2190 self
2191 }
2192
2193 /// Sets or clears the value of [tag][crate::model::CreateTagRequest::tag].
2194 ///
2195 /// This is a **required** field for requests.
2196 pub fn set_or_clear_tag<T>(mut self, v: std::option::Option<T>) -> Self
2197 where
2198 T: std::convert::Into<crate::model::Tag>,
2199 {
2200 self.0.request.tag = v.map(|x| x.into());
2201 self
2202 }
2203 }
2204
2205 #[doc(hidden)]
2206 impl crate::RequestBuilder for CreateTag {
2207 fn request_options(&mut self) -> &mut crate::RequestOptions {
2208 &mut self.0.options
2209 }
2210 }
2211
2212 /// The request builder for [DataCatalog::update_tag][crate::client::DataCatalog::update_tag] calls.
2213 ///
2214 /// # Example
2215 /// ```
2216 /// # use google_cloud_datacatalog_v1::builder::data_catalog::UpdateTag;
2217 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2218 ///
2219 /// let builder = prepare_request_builder();
2220 /// let response = builder.send().await?;
2221 /// # Ok(()) }
2222 ///
2223 /// fn prepare_request_builder() -> UpdateTag {
2224 /// # panic!();
2225 /// // ... details omitted ...
2226 /// }
2227 /// ```
2228 #[derive(Clone, Debug)]
2229 pub struct UpdateTag(RequestBuilder<crate::model::UpdateTagRequest>);
2230
2231 impl UpdateTag {
2232 pub(crate) fn new(
2233 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2234 ) -> Self {
2235 Self(RequestBuilder::new(stub))
2236 }
2237
2238 /// Sets the full request, replacing any prior values.
2239 pub fn with_request<V: Into<crate::model::UpdateTagRequest>>(mut self, v: V) -> Self {
2240 self.0.request = v.into();
2241 self
2242 }
2243
2244 /// Sets all the options, replacing any prior values.
2245 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2246 self.0.options = v.into();
2247 self
2248 }
2249
2250 /// Sends the request.
2251 pub async fn send(self) -> Result<crate::model::Tag> {
2252 (*self.0.stub)
2253 .update_tag(self.0.request, self.0.options)
2254 .await
2255 .map(crate::Response::into_body)
2256 }
2257
2258 /// Sets the value of [tag][crate::model::UpdateTagRequest::tag].
2259 ///
2260 /// This is a **required** field for requests.
2261 pub fn set_tag<T>(mut self, v: T) -> Self
2262 where
2263 T: std::convert::Into<crate::model::Tag>,
2264 {
2265 self.0.request.tag = std::option::Option::Some(v.into());
2266 self
2267 }
2268
2269 /// Sets or clears the value of [tag][crate::model::UpdateTagRequest::tag].
2270 ///
2271 /// This is a **required** field for requests.
2272 pub fn set_or_clear_tag<T>(mut self, v: std::option::Option<T>) -> Self
2273 where
2274 T: std::convert::Into<crate::model::Tag>,
2275 {
2276 self.0.request.tag = v.map(|x| x.into());
2277 self
2278 }
2279
2280 /// Sets the value of [update_mask][crate::model::UpdateTagRequest::update_mask].
2281 pub fn set_update_mask<T>(mut self, v: T) -> Self
2282 where
2283 T: std::convert::Into<wkt::FieldMask>,
2284 {
2285 self.0.request.update_mask = std::option::Option::Some(v.into());
2286 self
2287 }
2288
2289 /// Sets or clears the value of [update_mask][crate::model::UpdateTagRequest::update_mask].
2290 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2291 where
2292 T: std::convert::Into<wkt::FieldMask>,
2293 {
2294 self.0.request.update_mask = v.map(|x| x.into());
2295 self
2296 }
2297 }
2298
2299 #[doc(hidden)]
2300 impl crate::RequestBuilder for UpdateTag {
2301 fn request_options(&mut self) -> &mut crate::RequestOptions {
2302 &mut self.0.options
2303 }
2304 }
2305
2306 /// The request builder for [DataCatalog::delete_tag][crate::client::DataCatalog::delete_tag] calls.
2307 ///
2308 /// # Example
2309 /// ```
2310 /// # use google_cloud_datacatalog_v1::builder::data_catalog::DeleteTag;
2311 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2312 ///
2313 /// let builder = prepare_request_builder();
2314 /// let response = builder.send().await?;
2315 /// # Ok(()) }
2316 ///
2317 /// fn prepare_request_builder() -> DeleteTag {
2318 /// # panic!();
2319 /// // ... details omitted ...
2320 /// }
2321 /// ```
2322 #[derive(Clone, Debug)]
2323 pub struct DeleteTag(RequestBuilder<crate::model::DeleteTagRequest>);
2324
2325 impl DeleteTag {
2326 pub(crate) fn new(
2327 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2328 ) -> Self {
2329 Self(RequestBuilder::new(stub))
2330 }
2331
2332 /// Sets the full request, replacing any prior values.
2333 pub fn with_request<V: Into<crate::model::DeleteTagRequest>>(mut self, v: V) -> Self {
2334 self.0.request = v.into();
2335 self
2336 }
2337
2338 /// Sets all the options, replacing any prior values.
2339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2340 self.0.options = v.into();
2341 self
2342 }
2343
2344 /// Sends the request.
2345 pub async fn send(self) -> Result<()> {
2346 (*self.0.stub)
2347 .delete_tag(self.0.request, self.0.options)
2348 .await
2349 .map(crate::Response::into_body)
2350 }
2351
2352 /// Sets the value of [name][crate::model::DeleteTagRequest::name].
2353 ///
2354 /// This is a **required** field for requests.
2355 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2356 self.0.request.name = v.into();
2357 self
2358 }
2359 }
2360
2361 #[doc(hidden)]
2362 impl crate::RequestBuilder for DeleteTag {
2363 fn request_options(&mut self) -> &mut crate::RequestOptions {
2364 &mut self.0.options
2365 }
2366 }
2367
2368 /// The request builder for [DataCatalog::list_tags][crate::client::DataCatalog::list_tags] calls.
2369 ///
2370 /// # Example
2371 /// ```
2372 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ListTags;
2373 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2374 /// use google_cloud_gax::paginator::ItemPaginator;
2375 ///
2376 /// let builder = prepare_request_builder();
2377 /// let mut items = builder.by_item();
2378 /// while let Some(result) = items.next().await {
2379 /// let item = result?;
2380 /// }
2381 /// # Ok(()) }
2382 ///
2383 /// fn prepare_request_builder() -> ListTags {
2384 /// # panic!();
2385 /// // ... details omitted ...
2386 /// }
2387 /// ```
2388 #[derive(Clone, Debug)]
2389 pub struct ListTags(RequestBuilder<crate::model::ListTagsRequest>);
2390
2391 impl ListTags {
2392 pub(crate) fn new(
2393 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2394 ) -> Self {
2395 Self(RequestBuilder::new(stub))
2396 }
2397
2398 /// Sets the full request, replacing any prior values.
2399 pub fn with_request<V: Into<crate::model::ListTagsRequest>>(mut self, v: V) -> Self {
2400 self.0.request = v.into();
2401 self
2402 }
2403
2404 /// Sets all the options, replacing any prior values.
2405 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2406 self.0.options = v.into();
2407 self
2408 }
2409
2410 /// Sends the request.
2411 pub async fn send(self) -> Result<crate::model::ListTagsResponse> {
2412 (*self.0.stub)
2413 .list_tags(self.0.request, self.0.options)
2414 .await
2415 .map(crate::Response::into_body)
2416 }
2417
2418 /// Streams each page in the collection.
2419 pub fn by_page(
2420 self,
2421 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTagsResponse, crate::Error>
2422 {
2423 use std::clone::Clone;
2424 let token = self.0.request.page_token.clone();
2425 let execute = move |token: String| {
2426 let mut builder = self.clone();
2427 builder.0.request = builder.0.request.set_page_token(token);
2428 builder.send()
2429 };
2430 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2431 }
2432
2433 /// Streams each item in the collection.
2434 pub fn by_item(
2435 self,
2436 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListTagsResponse, crate::Error>
2437 {
2438 use google_cloud_gax::paginator::Paginator;
2439 self.by_page().items()
2440 }
2441
2442 /// Sets the value of [parent][crate::model::ListTagsRequest::parent].
2443 ///
2444 /// This is a **required** field for requests.
2445 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2446 self.0.request.parent = v.into();
2447 self
2448 }
2449
2450 /// Sets the value of [page_size][crate::model::ListTagsRequest::page_size].
2451 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2452 self.0.request.page_size = v.into();
2453 self
2454 }
2455
2456 /// Sets the value of [page_token][crate::model::ListTagsRequest::page_token].
2457 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2458 self.0.request.page_token = v.into();
2459 self
2460 }
2461 }
2462
2463 #[doc(hidden)]
2464 impl crate::RequestBuilder for ListTags {
2465 fn request_options(&mut self) -> &mut crate::RequestOptions {
2466 &mut self.0.options
2467 }
2468 }
2469
2470 /// The request builder for [DataCatalog::reconcile_tags][crate::client::DataCatalog::reconcile_tags] calls.
2471 ///
2472 /// # Example
2473 /// ```
2474 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ReconcileTags;
2475 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2476 /// use google_cloud_lro::Poller;
2477 ///
2478 /// let builder = prepare_request_builder();
2479 /// let response = builder.poller().until_done().await?;
2480 /// # Ok(()) }
2481 ///
2482 /// fn prepare_request_builder() -> ReconcileTags {
2483 /// # panic!();
2484 /// // ... details omitted ...
2485 /// }
2486 /// ```
2487 #[derive(Clone, Debug)]
2488 pub struct ReconcileTags(RequestBuilder<crate::model::ReconcileTagsRequest>);
2489
2490 impl ReconcileTags {
2491 pub(crate) fn new(
2492 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2493 ) -> Self {
2494 Self(RequestBuilder::new(stub))
2495 }
2496
2497 /// Sets the full request, replacing any prior values.
2498 pub fn with_request<V: Into<crate::model::ReconcileTagsRequest>>(mut self, v: V) -> Self {
2499 self.0.request = v.into();
2500 self
2501 }
2502
2503 /// Sets all the options, replacing any prior values.
2504 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2505 self.0.options = v.into();
2506 self
2507 }
2508
2509 /// Sends the request.
2510 ///
2511 /// # Long running operations
2512 ///
2513 /// This starts, but does not poll, a longrunning operation. More information
2514 /// on [reconcile_tags][crate::client::DataCatalog::reconcile_tags].
2515 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2516 (*self.0.stub)
2517 .reconcile_tags(self.0.request, self.0.options)
2518 .await
2519 .map(crate::Response::into_body)
2520 }
2521
2522 /// Creates a [Poller][google_cloud_lro::Poller] to work with `reconcile_tags`.
2523 pub fn poller(
2524 self,
2525 ) -> impl google_cloud_lro::Poller<
2526 crate::model::ReconcileTagsResponse,
2527 crate::model::ReconcileTagsMetadata,
2528 > {
2529 type Operation = google_cloud_lro::internal::Operation<
2530 crate::model::ReconcileTagsResponse,
2531 crate::model::ReconcileTagsMetadata,
2532 >;
2533 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2534 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2535
2536 let stub = self.0.stub.clone();
2537 let mut options = self.0.options.clone();
2538 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2539 let query = move |name| {
2540 let stub = stub.clone();
2541 let options = options.clone();
2542 async {
2543 let op = GetOperation::new(stub)
2544 .set_name(name)
2545 .with_options(options)
2546 .send()
2547 .await?;
2548 Ok(Operation::new(op))
2549 }
2550 };
2551
2552 let start = move || async {
2553 let op = self.send().await?;
2554 Ok(Operation::new(op))
2555 };
2556
2557 google_cloud_lro::internal::new_poller(
2558 polling_error_policy,
2559 polling_backoff_policy,
2560 start,
2561 query,
2562 )
2563 }
2564
2565 /// Sets the value of [parent][crate::model::ReconcileTagsRequest::parent].
2566 ///
2567 /// This is a **required** field for requests.
2568 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2569 self.0.request.parent = v.into();
2570 self
2571 }
2572
2573 /// Sets the value of [tag_template][crate::model::ReconcileTagsRequest::tag_template].
2574 ///
2575 /// This is a **required** field for requests.
2576 pub fn set_tag_template<T: Into<std::string::String>>(mut self, v: T) -> Self {
2577 self.0.request.tag_template = v.into();
2578 self
2579 }
2580
2581 /// Sets the value of [force_delete_missing][crate::model::ReconcileTagsRequest::force_delete_missing].
2582 pub fn set_force_delete_missing<T: Into<bool>>(mut self, v: T) -> Self {
2583 self.0.request.force_delete_missing = v.into();
2584 self
2585 }
2586
2587 /// Sets the value of [tags][crate::model::ReconcileTagsRequest::tags].
2588 pub fn set_tags<T, V>(mut self, v: T) -> Self
2589 where
2590 T: std::iter::IntoIterator<Item = V>,
2591 V: std::convert::Into<crate::model::Tag>,
2592 {
2593 use std::iter::Iterator;
2594 self.0.request.tags = v.into_iter().map(|i| i.into()).collect();
2595 self
2596 }
2597 }
2598
2599 #[doc(hidden)]
2600 impl crate::RequestBuilder for ReconcileTags {
2601 fn request_options(&mut self) -> &mut crate::RequestOptions {
2602 &mut self.0.options
2603 }
2604 }
2605
2606 /// The request builder for [DataCatalog::star_entry][crate::client::DataCatalog::star_entry] calls.
2607 ///
2608 /// # Example
2609 /// ```
2610 /// # use google_cloud_datacatalog_v1::builder::data_catalog::StarEntry;
2611 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2612 ///
2613 /// let builder = prepare_request_builder();
2614 /// let response = builder.send().await?;
2615 /// # Ok(()) }
2616 ///
2617 /// fn prepare_request_builder() -> StarEntry {
2618 /// # panic!();
2619 /// // ... details omitted ...
2620 /// }
2621 /// ```
2622 #[derive(Clone, Debug)]
2623 pub struct StarEntry(RequestBuilder<crate::model::StarEntryRequest>);
2624
2625 impl StarEntry {
2626 pub(crate) fn new(
2627 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2628 ) -> Self {
2629 Self(RequestBuilder::new(stub))
2630 }
2631
2632 /// Sets the full request, replacing any prior values.
2633 pub fn with_request<V: Into<crate::model::StarEntryRequest>>(mut self, v: V) -> Self {
2634 self.0.request = v.into();
2635 self
2636 }
2637
2638 /// Sets all the options, replacing any prior values.
2639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2640 self.0.options = v.into();
2641 self
2642 }
2643
2644 /// Sends the request.
2645 pub async fn send(self) -> Result<crate::model::StarEntryResponse> {
2646 (*self.0.stub)
2647 .star_entry(self.0.request, self.0.options)
2648 .await
2649 .map(crate::Response::into_body)
2650 }
2651
2652 /// Sets the value of [name][crate::model::StarEntryRequest::name].
2653 ///
2654 /// This is a **required** field for requests.
2655 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2656 self.0.request.name = v.into();
2657 self
2658 }
2659 }
2660
2661 #[doc(hidden)]
2662 impl crate::RequestBuilder for StarEntry {
2663 fn request_options(&mut self) -> &mut crate::RequestOptions {
2664 &mut self.0.options
2665 }
2666 }
2667
2668 /// The request builder for [DataCatalog::unstar_entry][crate::client::DataCatalog::unstar_entry] calls.
2669 ///
2670 /// # Example
2671 /// ```
2672 /// # use google_cloud_datacatalog_v1::builder::data_catalog::UnstarEntry;
2673 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2674 ///
2675 /// let builder = prepare_request_builder();
2676 /// let response = builder.send().await?;
2677 /// # Ok(()) }
2678 ///
2679 /// fn prepare_request_builder() -> UnstarEntry {
2680 /// # panic!();
2681 /// // ... details omitted ...
2682 /// }
2683 /// ```
2684 #[derive(Clone, Debug)]
2685 pub struct UnstarEntry(RequestBuilder<crate::model::UnstarEntryRequest>);
2686
2687 impl UnstarEntry {
2688 pub(crate) fn new(
2689 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2690 ) -> Self {
2691 Self(RequestBuilder::new(stub))
2692 }
2693
2694 /// Sets the full request, replacing any prior values.
2695 pub fn with_request<V: Into<crate::model::UnstarEntryRequest>>(mut self, v: V) -> Self {
2696 self.0.request = v.into();
2697 self
2698 }
2699
2700 /// Sets all the options, replacing any prior values.
2701 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2702 self.0.options = v.into();
2703 self
2704 }
2705
2706 /// Sends the request.
2707 pub async fn send(self) -> Result<crate::model::UnstarEntryResponse> {
2708 (*self.0.stub)
2709 .unstar_entry(self.0.request, self.0.options)
2710 .await
2711 .map(crate::Response::into_body)
2712 }
2713
2714 /// Sets the value of [name][crate::model::UnstarEntryRequest::name].
2715 ///
2716 /// This is a **required** field for requests.
2717 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2718 self.0.request.name = v.into();
2719 self
2720 }
2721 }
2722
2723 #[doc(hidden)]
2724 impl crate::RequestBuilder for UnstarEntry {
2725 fn request_options(&mut self) -> &mut crate::RequestOptions {
2726 &mut self.0.options
2727 }
2728 }
2729
2730 /// The request builder for [DataCatalog::set_iam_policy][crate::client::DataCatalog::set_iam_policy] calls.
2731 ///
2732 /// # Example
2733 /// ```
2734 /// # use google_cloud_datacatalog_v1::builder::data_catalog::SetIamPolicy;
2735 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2736 ///
2737 /// let builder = prepare_request_builder();
2738 /// let response = builder.send().await?;
2739 /// # Ok(()) }
2740 ///
2741 /// fn prepare_request_builder() -> SetIamPolicy {
2742 /// # panic!();
2743 /// // ... details omitted ...
2744 /// }
2745 /// ```
2746 #[derive(Clone, Debug)]
2747 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
2748
2749 impl SetIamPolicy {
2750 pub(crate) fn new(
2751 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2752 ) -> Self {
2753 Self(RequestBuilder::new(stub))
2754 }
2755
2756 /// Sets the full request, replacing any prior values.
2757 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
2758 mut self,
2759 v: V,
2760 ) -> Self {
2761 self.0.request = v.into();
2762 self
2763 }
2764
2765 /// Sets all the options, replacing any prior values.
2766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2767 self.0.options = v.into();
2768 self
2769 }
2770
2771 /// Sends the request.
2772 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2773 (*self.0.stub)
2774 .set_iam_policy(self.0.request, self.0.options)
2775 .await
2776 .map(crate::Response::into_body)
2777 }
2778
2779 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
2780 ///
2781 /// This is a **required** field for requests.
2782 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2783 self.0.request.resource = v.into();
2784 self
2785 }
2786
2787 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2788 ///
2789 /// This is a **required** field for requests.
2790 pub fn set_policy<T>(mut self, v: T) -> Self
2791 where
2792 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2793 {
2794 self.0.request.policy = std::option::Option::Some(v.into());
2795 self
2796 }
2797
2798 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
2799 ///
2800 /// This is a **required** field for requests.
2801 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
2802 where
2803 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
2804 {
2805 self.0.request.policy = v.map(|x| x.into());
2806 self
2807 }
2808
2809 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2810 pub fn set_update_mask<T>(mut self, v: T) -> Self
2811 where
2812 T: std::convert::Into<wkt::FieldMask>,
2813 {
2814 self.0.request.update_mask = std::option::Option::Some(v.into());
2815 self
2816 }
2817
2818 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
2819 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2820 where
2821 T: std::convert::Into<wkt::FieldMask>,
2822 {
2823 self.0.request.update_mask = v.map(|x| x.into());
2824 self
2825 }
2826 }
2827
2828 #[doc(hidden)]
2829 impl crate::RequestBuilder for SetIamPolicy {
2830 fn request_options(&mut self) -> &mut crate::RequestOptions {
2831 &mut self.0.options
2832 }
2833 }
2834
2835 /// The request builder for [DataCatalog::get_iam_policy][crate::client::DataCatalog::get_iam_policy] calls.
2836 ///
2837 /// # Example
2838 /// ```
2839 /// # use google_cloud_datacatalog_v1::builder::data_catalog::GetIamPolicy;
2840 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2841 ///
2842 /// let builder = prepare_request_builder();
2843 /// let response = builder.send().await?;
2844 /// # Ok(()) }
2845 ///
2846 /// fn prepare_request_builder() -> GetIamPolicy {
2847 /// # panic!();
2848 /// // ... details omitted ...
2849 /// }
2850 /// ```
2851 #[derive(Clone, Debug)]
2852 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
2853
2854 impl GetIamPolicy {
2855 pub(crate) fn new(
2856 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2857 ) -> Self {
2858 Self(RequestBuilder::new(stub))
2859 }
2860
2861 /// Sets the full request, replacing any prior values.
2862 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
2863 mut self,
2864 v: V,
2865 ) -> Self {
2866 self.0.request = v.into();
2867 self
2868 }
2869
2870 /// Sets all the options, replacing any prior values.
2871 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2872 self.0.options = v.into();
2873 self
2874 }
2875
2876 /// Sends the request.
2877 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
2878 (*self.0.stub)
2879 .get_iam_policy(self.0.request, self.0.options)
2880 .await
2881 .map(crate::Response::into_body)
2882 }
2883
2884 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
2885 ///
2886 /// This is a **required** field for requests.
2887 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2888 self.0.request.resource = v.into();
2889 self
2890 }
2891
2892 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2893 pub fn set_options<T>(mut self, v: T) -> Self
2894 where
2895 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2896 {
2897 self.0.request.options = std::option::Option::Some(v.into());
2898 self
2899 }
2900
2901 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
2902 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
2903 where
2904 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
2905 {
2906 self.0.request.options = v.map(|x| x.into());
2907 self
2908 }
2909 }
2910
2911 #[doc(hidden)]
2912 impl crate::RequestBuilder for GetIamPolicy {
2913 fn request_options(&mut self) -> &mut crate::RequestOptions {
2914 &mut self.0.options
2915 }
2916 }
2917
2918 /// The request builder for [DataCatalog::test_iam_permissions][crate::client::DataCatalog::test_iam_permissions] calls.
2919 ///
2920 /// # Example
2921 /// ```
2922 /// # use google_cloud_datacatalog_v1::builder::data_catalog::TestIamPermissions;
2923 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
2924 ///
2925 /// let builder = prepare_request_builder();
2926 /// let response = builder.send().await?;
2927 /// # Ok(()) }
2928 ///
2929 /// fn prepare_request_builder() -> TestIamPermissions {
2930 /// # panic!();
2931 /// // ... details omitted ...
2932 /// }
2933 /// ```
2934 #[derive(Clone, Debug)]
2935 pub struct TestIamPermissions(
2936 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
2937 );
2938
2939 impl TestIamPermissions {
2940 pub(crate) fn new(
2941 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
2942 ) -> Self {
2943 Self(RequestBuilder::new(stub))
2944 }
2945
2946 /// Sets the full request, replacing any prior values.
2947 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
2948 mut self,
2949 v: V,
2950 ) -> Self {
2951 self.0.request = v.into();
2952 self
2953 }
2954
2955 /// Sets all the options, replacing any prior values.
2956 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2957 self.0.options = v.into();
2958 self
2959 }
2960
2961 /// Sends the request.
2962 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
2963 (*self.0.stub)
2964 .test_iam_permissions(self.0.request, self.0.options)
2965 .await
2966 .map(crate::Response::into_body)
2967 }
2968
2969 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
2970 ///
2971 /// This is a **required** field for requests.
2972 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
2973 self.0.request.resource = v.into();
2974 self
2975 }
2976
2977 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
2978 ///
2979 /// This is a **required** field for requests.
2980 pub fn set_permissions<T, V>(mut self, v: T) -> Self
2981 where
2982 T: std::iter::IntoIterator<Item = V>,
2983 V: std::convert::Into<std::string::String>,
2984 {
2985 use std::iter::Iterator;
2986 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
2987 self
2988 }
2989 }
2990
2991 #[doc(hidden)]
2992 impl crate::RequestBuilder for TestIamPermissions {
2993 fn request_options(&mut self) -> &mut crate::RequestOptions {
2994 &mut self.0.options
2995 }
2996 }
2997
2998 /// The request builder for [DataCatalog::import_entries][crate::client::DataCatalog::import_entries] calls.
2999 ///
3000 /// # Example
3001 /// ```
3002 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ImportEntries;
3003 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3004 /// use google_cloud_lro::Poller;
3005 ///
3006 /// let builder = prepare_request_builder();
3007 /// let response = builder.poller().until_done().await?;
3008 /// # Ok(()) }
3009 ///
3010 /// fn prepare_request_builder() -> ImportEntries {
3011 /// # panic!();
3012 /// // ... details omitted ...
3013 /// }
3014 /// ```
3015 #[derive(Clone, Debug)]
3016 pub struct ImportEntries(RequestBuilder<crate::model::ImportEntriesRequest>);
3017
3018 impl ImportEntries {
3019 pub(crate) fn new(
3020 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3021 ) -> Self {
3022 Self(RequestBuilder::new(stub))
3023 }
3024
3025 /// Sets the full request, replacing any prior values.
3026 pub fn with_request<V: Into<crate::model::ImportEntriesRequest>>(mut self, v: V) -> Self {
3027 self.0.request = v.into();
3028 self
3029 }
3030
3031 /// Sets all the options, replacing any prior values.
3032 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3033 self.0.options = v.into();
3034 self
3035 }
3036
3037 /// Sends the request.
3038 ///
3039 /// # Long running operations
3040 ///
3041 /// This starts, but does not poll, a longrunning operation. More information
3042 /// on [import_entries][crate::client::DataCatalog::import_entries].
3043 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3044 (*self.0.stub)
3045 .import_entries(self.0.request, self.0.options)
3046 .await
3047 .map(crate::Response::into_body)
3048 }
3049
3050 /// Creates a [Poller][google_cloud_lro::Poller] to work with `import_entries`.
3051 pub fn poller(
3052 self,
3053 ) -> impl google_cloud_lro::Poller<
3054 crate::model::ImportEntriesResponse,
3055 crate::model::ImportEntriesMetadata,
3056 > {
3057 type Operation = google_cloud_lro::internal::Operation<
3058 crate::model::ImportEntriesResponse,
3059 crate::model::ImportEntriesMetadata,
3060 >;
3061 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3062 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3063
3064 let stub = self.0.stub.clone();
3065 let mut options = self.0.options.clone();
3066 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3067 let query = move |name| {
3068 let stub = stub.clone();
3069 let options = options.clone();
3070 async {
3071 let op = GetOperation::new(stub)
3072 .set_name(name)
3073 .with_options(options)
3074 .send()
3075 .await?;
3076 Ok(Operation::new(op))
3077 }
3078 };
3079
3080 let start = move || async {
3081 let op = self.send().await?;
3082 Ok(Operation::new(op))
3083 };
3084
3085 google_cloud_lro::internal::new_poller(
3086 polling_error_policy,
3087 polling_backoff_policy,
3088 start,
3089 query,
3090 )
3091 }
3092
3093 /// Sets the value of [parent][crate::model::ImportEntriesRequest::parent].
3094 ///
3095 /// This is a **required** field for requests.
3096 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3097 self.0.request.parent = v.into();
3098 self
3099 }
3100
3101 /// Sets the value of [job_id][crate::model::ImportEntriesRequest::job_id].
3102 pub fn set_job_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3103 self.0.request.job_id = v.into();
3104 self
3105 }
3106
3107 /// Sets the value of [source][crate::model::ImportEntriesRequest::source].
3108 ///
3109 /// Note that all the setters affecting `source` are
3110 /// mutually exclusive.
3111 pub fn set_source<T: Into<Option<crate::model::import_entries_request::Source>>>(
3112 mut self,
3113 v: T,
3114 ) -> Self {
3115 self.0.request.source = v.into();
3116 self
3117 }
3118
3119 /// Sets the value of [source][crate::model::ImportEntriesRequest::source]
3120 /// to hold a `GcsBucketPath`.
3121 ///
3122 /// Note that all the setters affecting `source` are
3123 /// mutually exclusive.
3124 pub fn set_gcs_bucket_path<T: std::convert::Into<std::string::String>>(
3125 mut self,
3126 v: T,
3127 ) -> Self {
3128 self.0.request = self.0.request.set_gcs_bucket_path(v);
3129 self
3130 }
3131 }
3132
3133 #[doc(hidden)]
3134 impl crate::RequestBuilder for ImportEntries {
3135 fn request_options(&mut self) -> &mut crate::RequestOptions {
3136 &mut self.0.options
3137 }
3138 }
3139
3140 /// The request builder for [DataCatalog::set_config][crate::client::DataCatalog::set_config] calls.
3141 ///
3142 /// # Example
3143 /// ```
3144 /// # use google_cloud_datacatalog_v1::builder::data_catalog::SetConfig;
3145 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3146 ///
3147 /// let builder = prepare_request_builder();
3148 /// let response = builder.send().await?;
3149 /// # Ok(()) }
3150 ///
3151 /// fn prepare_request_builder() -> SetConfig {
3152 /// # panic!();
3153 /// // ... details omitted ...
3154 /// }
3155 /// ```
3156 #[derive(Clone, Debug)]
3157 pub struct SetConfig(RequestBuilder<crate::model::SetConfigRequest>);
3158
3159 impl SetConfig {
3160 pub(crate) fn new(
3161 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3162 ) -> Self {
3163 Self(RequestBuilder::new(stub))
3164 }
3165
3166 /// Sets the full request, replacing any prior values.
3167 pub fn with_request<V: Into<crate::model::SetConfigRequest>>(mut self, v: V) -> Self {
3168 self.0.request = v.into();
3169 self
3170 }
3171
3172 /// Sets all the options, replacing any prior values.
3173 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3174 self.0.options = v.into();
3175 self
3176 }
3177
3178 /// Sends the request.
3179 pub async fn send(self) -> Result<crate::model::MigrationConfig> {
3180 (*self.0.stub)
3181 .set_config(self.0.request, self.0.options)
3182 .await
3183 .map(crate::Response::into_body)
3184 }
3185
3186 /// Sets the value of [name][crate::model::SetConfigRequest::name].
3187 ///
3188 /// This is a **required** field for requests.
3189 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3190 self.0.request.name = v.into();
3191 self
3192 }
3193
3194 /// Sets the value of [configuration][crate::model::SetConfigRequest::configuration].
3195 ///
3196 /// Note that all the setters affecting `configuration` are
3197 /// mutually exclusive.
3198 pub fn set_configuration<
3199 T: Into<Option<crate::model::set_config_request::Configuration>>,
3200 >(
3201 mut self,
3202 v: T,
3203 ) -> Self {
3204 self.0.request.configuration = v.into();
3205 self
3206 }
3207
3208 /// Sets the value of [configuration][crate::model::SetConfigRequest::configuration]
3209 /// to hold a `TagTemplateMigration`.
3210 ///
3211 /// Note that all the setters affecting `configuration` are
3212 /// mutually exclusive.
3213 pub fn set_tag_template_migration<
3214 T: std::convert::Into<crate::model::TagTemplateMigration>,
3215 >(
3216 mut self,
3217 v: T,
3218 ) -> Self {
3219 self.0.request = self.0.request.set_tag_template_migration(v);
3220 self
3221 }
3222
3223 /// Sets the value of [configuration][crate::model::SetConfigRequest::configuration]
3224 /// to hold a `CatalogUiExperience`.
3225 ///
3226 /// Note that all the setters affecting `configuration` are
3227 /// mutually exclusive.
3228 pub fn set_catalog_ui_experience<
3229 T: std::convert::Into<crate::model::CatalogUIExperience>,
3230 >(
3231 mut self,
3232 v: T,
3233 ) -> Self {
3234 self.0.request = self.0.request.set_catalog_ui_experience(v);
3235 self
3236 }
3237 }
3238
3239 #[doc(hidden)]
3240 impl crate::RequestBuilder for SetConfig {
3241 fn request_options(&mut self) -> &mut crate::RequestOptions {
3242 &mut self.0.options
3243 }
3244 }
3245
3246 /// The request builder for [DataCatalog::retrieve_config][crate::client::DataCatalog::retrieve_config] calls.
3247 ///
3248 /// # Example
3249 /// ```
3250 /// # use google_cloud_datacatalog_v1::builder::data_catalog::RetrieveConfig;
3251 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3252 ///
3253 /// let builder = prepare_request_builder();
3254 /// let response = builder.send().await?;
3255 /// # Ok(()) }
3256 ///
3257 /// fn prepare_request_builder() -> RetrieveConfig {
3258 /// # panic!();
3259 /// // ... details omitted ...
3260 /// }
3261 /// ```
3262 #[derive(Clone, Debug)]
3263 pub struct RetrieveConfig(RequestBuilder<crate::model::RetrieveConfigRequest>);
3264
3265 impl RetrieveConfig {
3266 pub(crate) fn new(
3267 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3268 ) -> Self {
3269 Self(RequestBuilder::new(stub))
3270 }
3271
3272 /// Sets the full request, replacing any prior values.
3273 pub fn with_request<V: Into<crate::model::RetrieveConfigRequest>>(mut self, v: V) -> Self {
3274 self.0.request = v.into();
3275 self
3276 }
3277
3278 /// Sets all the options, replacing any prior values.
3279 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3280 self.0.options = v.into();
3281 self
3282 }
3283
3284 /// Sends the request.
3285 pub async fn send(self) -> Result<crate::model::OrganizationConfig> {
3286 (*self.0.stub)
3287 .retrieve_config(self.0.request, self.0.options)
3288 .await
3289 .map(crate::Response::into_body)
3290 }
3291
3292 /// Sets the value of [name][crate::model::RetrieveConfigRequest::name].
3293 ///
3294 /// This is a **required** field for requests.
3295 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3296 self.0.request.name = v.into();
3297 self
3298 }
3299 }
3300
3301 #[doc(hidden)]
3302 impl crate::RequestBuilder for RetrieveConfig {
3303 fn request_options(&mut self) -> &mut crate::RequestOptions {
3304 &mut self.0.options
3305 }
3306 }
3307
3308 /// The request builder for [DataCatalog::retrieve_effective_config][crate::client::DataCatalog::retrieve_effective_config] calls.
3309 ///
3310 /// # Example
3311 /// ```
3312 /// # use google_cloud_datacatalog_v1::builder::data_catalog::RetrieveEffectiveConfig;
3313 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3314 ///
3315 /// let builder = prepare_request_builder();
3316 /// let response = builder.send().await?;
3317 /// # Ok(()) }
3318 ///
3319 /// fn prepare_request_builder() -> RetrieveEffectiveConfig {
3320 /// # panic!();
3321 /// // ... details omitted ...
3322 /// }
3323 /// ```
3324 #[derive(Clone, Debug)]
3325 pub struct RetrieveEffectiveConfig(
3326 RequestBuilder<crate::model::RetrieveEffectiveConfigRequest>,
3327 );
3328
3329 impl RetrieveEffectiveConfig {
3330 pub(crate) fn new(
3331 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3332 ) -> Self {
3333 Self(RequestBuilder::new(stub))
3334 }
3335
3336 /// Sets the full request, replacing any prior values.
3337 pub fn with_request<V: Into<crate::model::RetrieveEffectiveConfigRequest>>(
3338 mut self,
3339 v: V,
3340 ) -> Self {
3341 self.0.request = v.into();
3342 self
3343 }
3344
3345 /// Sets all the options, replacing any prior values.
3346 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3347 self.0.options = v.into();
3348 self
3349 }
3350
3351 /// Sends the request.
3352 pub async fn send(self) -> Result<crate::model::MigrationConfig> {
3353 (*self.0.stub)
3354 .retrieve_effective_config(self.0.request, self.0.options)
3355 .await
3356 .map(crate::Response::into_body)
3357 }
3358
3359 /// Sets the value of [name][crate::model::RetrieveEffectiveConfigRequest::name].
3360 ///
3361 /// This is a **required** field for requests.
3362 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3363 self.0.request.name = v.into();
3364 self
3365 }
3366 }
3367
3368 #[doc(hidden)]
3369 impl crate::RequestBuilder for RetrieveEffectiveConfig {
3370 fn request_options(&mut self) -> &mut crate::RequestOptions {
3371 &mut self.0.options
3372 }
3373 }
3374
3375 /// The request builder for [DataCatalog::list_operations][crate::client::DataCatalog::list_operations] calls.
3376 ///
3377 /// # Example
3378 /// ```
3379 /// # use google_cloud_datacatalog_v1::builder::data_catalog::ListOperations;
3380 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3381 /// use google_cloud_gax::paginator::ItemPaginator;
3382 ///
3383 /// let builder = prepare_request_builder();
3384 /// let mut items = builder.by_item();
3385 /// while let Some(result) = items.next().await {
3386 /// let item = result?;
3387 /// }
3388 /// # Ok(()) }
3389 ///
3390 /// fn prepare_request_builder() -> ListOperations {
3391 /// # panic!();
3392 /// // ... details omitted ...
3393 /// }
3394 /// ```
3395 #[derive(Clone, Debug)]
3396 pub struct ListOperations(
3397 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3398 );
3399
3400 impl ListOperations {
3401 pub(crate) fn new(
3402 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3403 ) -> Self {
3404 Self(RequestBuilder::new(stub))
3405 }
3406
3407 /// Sets the full request, replacing any prior values.
3408 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3409 mut self,
3410 v: V,
3411 ) -> Self {
3412 self.0.request = v.into();
3413 self
3414 }
3415
3416 /// Sets all the options, replacing any prior values.
3417 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3418 self.0.options = v.into();
3419 self
3420 }
3421
3422 /// Sends the request.
3423 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3424 (*self.0.stub)
3425 .list_operations(self.0.request, self.0.options)
3426 .await
3427 .map(crate::Response::into_body)
3428 }
3429
3430 /// Streams each page in the collection.
3431 pub fn by_page(
3432 self,
3433 ) -> impl google_cloud_gax::paginator::Paginator<
3434 google_cloud_longrunning::model::ListOperationsResponse,
3435 crate::Error,
3436 > {
3437 use std::clone::Clone;
3438 let token = self.0.request.page_token.clone();
3439 let execute = move |token: String| {
3440 let mut builder = self.clone();
3441 builder.0.request = builder.0.request.set_page_token(token);
3442 builder.send()
3443 };
3444 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3445 }
3446
3447 /// Streams each item in the collection.
3448 pub fn by_item(
3449 self,
3450 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3451 google_cloud_longrunning::model::ListOperationsResponse,
3452 crate::Error,
3453 > {
3454 use google_cloud_gax::paginator::Paginator;
3455 self.by_page().items()
3456 }
3457
3458 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
3459 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3460 self.0.request.name = v.into();
3461 self
3462 }
3463
3464 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
3465 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3466 self.0.request.filter = v.into();
3467 self
3468 }
3469
3470 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
3471 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3472 self.0.request.page_size = v.into();
3473 self
3474 }
3475
3476 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
3477 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3478 self.0.request.page_token = v.into();
3479 self
3480 }
3481
3482 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
3483 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3484 self.0.request.return_partial_success = v.into();
3485 self
3486 }
3487 }
3488
3489 #[doc(hidden)]
3490 impl crate::RequestBuilder for ListOperations {
3491 fn request_options(&mut self) -> &mut crate::RequestOptions {
3492 &mut self.0.options
3493 }
3494 }
3495
3496 /// The request builder for [DataCatalog::get_operation][crate::client::DataCatalog::get_operation] calls.
3497 ///
3498 /// # Example
3499 /// ```
3500 /// # use google_cloud_datacatalog_v1::builder::data_catalog::GetOperation;
3501 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3502 ///
3503 /// let builder = prepare_request_builder();
3504 /// let response = builder.send().await?;
3505 /// # Ok(()) }
3506 ///
3507 /// fn prepare_request_builder() -> GetOperation {
3508 /// # panic!();
3509 /// // ... details omitted ...
3510 /// }
3511 /// ```
3512 #[derive(Clone, Debug)]
3513 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3514
3515 impl GetOperation {
3516 pub(crate) fn new(
3517 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3518 ) -> Self {
3519 Self(RequestBuilder::new(stub))
3520 }
3521
3522 /// Sets the full request, replacing any prior values.
3523 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3524 mut self,
3525 v: V,
3526 ) -> Self {
3527 self.0.request = v.into();
3528 self
3529 }
3530
3531 /// Sets all the options, replacing any prior values.
3532 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3533 self.0.options = v.into();
3534 self
3535 }
3536
3537 /// Sends the request.
3538 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3539 (*self.0.stub)
3540 .get_operation(self.0.request, self.0.options)
3541 .await
3542 .map(crate::Response::into_body)
3543 }
3544
3545 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
3546 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3547 self.0.request.name = v.into();
3548 self
3549 }
3550 }
3551
3552 #[doc(hidden)]
3553 impl crate::RequestBuilder for GetOperation {
3554 fn request_options(&mut self) -> &mut crate::RequestOptions {
3555 &mut self.0.options
3556 }
3557 }
3558
3559 /// The request builder for [DataCatalog::delete_operation][crate::client::DataCatalog::delete_operation] calls.
3560 ///
3561 /// # Example
3562 /// ```
3563 /// # use google_cloud_datacatalog_v1::builder::data_catalog::DeleteOperation;
3564 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3565 ///
3566 /// let builder = prepare_request_builder();
3567 /// let response = builder.send().await?;
3568 /// # Ok(()) }
3569 ///
3570 /// fn prepare_request_builder() -> DeleteOperation {
3571 /// # panic!();
3572 /// // ... details omitted ...
3573 /// }
3574 /// ```
3575 #[derive(Clone, Debug)]
3576 pub struct DeleteOperation(
3577 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
3578 );
3579
3580 impl DeleteOperation {
3581 pub(crate) fn new(
3582 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3583 ) -> Self {
3584 Self(RequestBuilder::new(stub))
3585 }
3586
3587 /// Sets the full request, replacing any prior values.
3588 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
3589 mut self,
3590 v: V,
3591 ) -> Self {
3592 self.0.request = v.into();
3593 self
3594 }
3595
3596 /// Sets all the options, replacing any prior values.
3597 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3598 self.0.options = v.into();
3599 self
3600 }
3601
3602 /// Sends the request.
3603 pub async fn send(self) -> Result<()> {
3604 (*self.0.stub)
3605 .delete_operation(self.0.request, self.0.options)
3606 .await
3607 .map(crate::Response::into_body)
3608 }
3609
3610 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
3611 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3612 self.0.request.name = v.into();
3613 self
3614 }
3615 }
3616
3617 #[doc(hidden)]
3618 impl crate::RequestBuilder for DeleteOperation {
3619 fn request_options(&mut self) -> &mut crate::RequestOptions {
3620 &mut self.0.options
3621 }
3622 }
3623
3624 /// The request builder for [DataCatalog::cancel_operation][crate::client::DataCatalog::cancel_operation] calls.
3625 ///
3626 /// # Example
3627 /// ```
3628 /// # use google_cloud_datacatalog_v1::builder::data_catalog::CancelOperation;
3629 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3630 ///
3631 /// let builder = prepare_request_builder();
3632 /// let response = builder.send().await?;
3633 /// # Ok(()) }
3634 ///
3635 /// fn prepare_request_builder() -> CancelOperation {
3636 /// # panic!();
3637 /// // ... details omitted ...
3638 /// }
3639 /// ```
3640 #[derive(Clone, Debug)]
3641 pub struct CancelOperation(
3642 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
3643 );
3644
3645 impl CancelOperation {
3646 pub(crate) fn new(
3647 stub: std::sync::Arc<dyn super::super::stub::dynamic::DataCatalog>,
3648 ) -> Self {
3649 Self(RequestBuilder::new(stub))
3650 }
3651
3652 /// Sets the full request, replacing any prior values.
3653 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
3654 mut self,
3655 v: V,
3656 ) -> Self {
3657 self.0.request = v.into();
3658 self
3659 }
3660
3661 /// Sets all the options, replacing any prior values.
3662 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3663 self.0.options = v.into();
3664 self
3665 }
3666
3667 /// Sends the request.
3668 pub async fn send(self) -> Result<()> {
3669 (*self.0.stub)
3670 .cancel_operation(self.0.request, self.0.options)
3671 .await
3672 .map(crate::Response::into_body)
3673 }
3674
3675 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
3676 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3677 self.0.request.name = v.into();
3678 self
3679 }
3680 }
3681
3682 #[doc(hidden)]
3683 impl crate::RequestBuilder for CancelOperation {
3684 fn request_options(&mut self) -> &mut crate::RequestOptions {
3685 &mut self.0.options
3686 }
3687 }
3688}
3689
3690pub mod policy_tag_manager {
3691 use crate::Result;
3692
3693 /// A builder for [PolicyTagManager][crate::client::PolicyTagManager].
3694 ///
3695 /// ```
3696 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
3697 /// # use google_cloud_datacatalog_v1::*;
3698 /// # use builder::policy_tag_manager::ClientBuilder;
3699 /// # use client::PolicyTagManager;
3700 /// let builder : ClientBuilder = PolicyTagManager::builder();
3701 /// let client = builder
3702 /// .with_endpoint("https://datacatalog.googleapis.com")
3703 /// .build().await?;
3704 /// # Ok(()) }
3705 /// ```
3706 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3707
3708 pub(crate) mod client {
3709 use super::super::super::client::PolicyTagManager;
3710 pub struct Factory;
3711 impl crate::ClientFactory for Factory {
3712 type Client = PolicyTagManager;
3713 type Credentials = gaxi::options::Credentials;
3714 async fn build(
3715 self,
3716 config: gaxi::options::ClientConfig,
3717 ) -> crate::ClientBuilderResult<Self::Client> {
3718 Self::Client::new(config).await
3719 }
3720 }
3721 }
3722
3723 /// Common implementation for [crate::client::PolicyTagManager] request builders.
3724 #[derive(Clone, Debug)]
3725 pub(crate) struct RequestBuilder<R: std::default::Default> {
3726 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
3727 request: R,
3728 options: crate::RequestOptions,
3729 }
3730
3731 impl<R> RequestBuilder<R>
3732 where
3733 R: std::default::Default,
3734 {
3735 pub(crate) fn new(
3736 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
3737 ) -> Self {
3738 Self {
3739 stub,
3740 request: R::default(),
3741 options: crate::RequestOptions::default(),
3742 }
3743 }
3744 }
3745
3746 /// The request builder for [PolicyTagManager::create_taxonomy][crate::client::PolicyTagManager::create_taxonomy] calls.
3747 ///
3748 /// # Example
3749 /// ```
3750 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::CreateTaxonomy;
3751 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3752 ///
3753 /// let builder = prepare_request_builder();
3754 /// let response = builder.send().await?;
3755 /// # Ok(()) }
3756 ///
3757 /// fn prepare_request_builder() -> CreateTaxonomy {
3758 /// # panic!();
3759 /// // ... details omitted ...
3760 /// }
3761 /// ```
3762 #[derive(Clone, Debug)]
3763 pub struct CreateTaxonomy(RequestBuilder<crate::model::CreateTaxonomyRequest>);
3764
3765 impl CreateTaxonomy {
3766 pub(crate) fn new(
3767 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
3768 ) -> Self {
3769 Self(RequestBuilder::new(stub))
3770 }
3771
3772 /// Sets the full request, replacing any prior values.
3773 pub fn with_request<V: Into<crate::model::CreateTaxonomyRequest>>(mut self, v: V) -> Self {
3774 self.0.request = v.into();
3775 self
3776 }
3777
3778 /// Sets all the options, replacing any prior values.
3779 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3780 self.0.options = v.into();
3781 self
3782 }
3783
3784 /// Sends the request.
3785 pub async fn send(self) -> Result<crate::model::Taxonomy> {
3786 (*self.0.stub)
3787 .create_taxonomy(self.0.request, self.0.options)
3788 .await
3789 .map(crate::Response::into_body)
3790 }
3791
3792 /// Sets the value of [parent][crate::model::CreateTaxonomyRequest::parent].
3793 ///
3794 /// This is a **required** field for requests.
3795 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3796 self.0.request.parent = v.into();
3797 self
3798 }
3799
3800 /// Sets the value of [taxonomy][crate::model::CreateTaxonomyRequest::taxonomy].
3801 pub fn set_taxonomy<T>(mut self, v: T) -> Self
3802 where
3803 T: std::convert::Into<crate::model::Taxonomy>,
3804 {
3805 self.0.request.taxonomy = std::option::Option::Some(v.into());
3806 self
3807 }
3808
3809 /// Sets or clears the value of [taxonomy][crate::model::CreateTaxonomyRequest::taxonomy].
3810 pub fn set_or_clear_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
3811 where
3812 T: std::convert::Into<crate::model::Taxonomy>,
3813 {
3814 self.0.request.taxonomy = v.map(|x| x.into());
3815 self
3816 }
3817 }
3818
3819 #[doc(hidden)]
3820 impl crate::RequestBuilder for CreateTaxonomy {
3821 fn request_options(&mut self) -> &mut crate::RequestOptions {
3822 &mut self.0.options
3823 }
3824 }
3825
3826 /// The request builder for [PolicyTagManager::delete_taxonomy][crate::client::PolicyTagManager::delete_taxonomy] calls.
3827 ///
3828 /// # Example
3829 /// ```
3830 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::DeleteTaxonomy;
3831 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3832 ///
3833 /// let builder = prepare_request_builder();
3834 /// let response = builder.send().await?;
3835 /// # Ok(()) }
3836 ///
3837 /// fn prepare_request_builder() -> DeleteTaxonomy {
3838 /// # panic!();
3839 /// // ... details omitted ...
3840 /// }
3841 /// ```
3842 #[derive(Clone, Debug)]
3843 pub struct DeleteTaxonomy(RequestBuilder<crate::model::DeleteTaxonomyRequest>);
3844
3845 impl DeleteTaxonomy {
3846 pub(crate) fn new(
3847 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
3848 ) -> Self {
3849 Self(RequestBuilder::new(stub))
3850 }
3851
3852 /// Sets the full request, replacing any prior values.
3853 pub fn with_request<V: Into<crate::model::DeleteTaxonomyRequest>>(mut self, v: V) -> Self {
3854 self.0.request = v.into();
3855 self
3856 }
3857
3858 /// Sets all the options, replacing any prior values.
3859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3860 self.0.options = v.into();
3861 self
3862 }
3863
3864 /// Sends the request.
3865 pub async fn send(self) -> Result<()> {
3866 (*self.0.stub)
3867 .delete_taxonomy(self.0.request, self.0.options)
3868 .await
3869 .map(crate::Response::into_body)
3870 }
3871
3872 /// Sets the value of [name][crate::model::DeleteTaxonomyRequest::name].
3873 ///
3874 /// This is a **required** field for requests.
3875 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3876 self.0.request.name = v.into();
3877 self
3878 }
3879 }
3880
3881 #[doc(hidden)]
3882 impl crate::RequestBuilder for DeleteTaxonomy {
3883 fn request_options(&mut self) -> &mut crate::RequestOptions {
3884 &mut self.0.options
3885 }
3886 }
3887
3888 /// The request builder for [PolicyTagManager::update_taxonomy][crate::client::PolicyTagManager::update_taxonomy] calls.
3889 ///
3890 /// # Example
3891 /// ```
3892 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::UpdateTaxonomy;
3893 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3894 ///
3895 /// let builder = prepare_request_builder();
3896 /// let response = builder.send().await?;
3897 /// # Ok(()) }
3898 ///
3899 /// fn prepare_request_builder() -> UpdateTaxonomy {
3900 /// # panic!();
3901 /// // ... details omitted ...
3902 /// }
3903 /// ```
3904 #[derive(Clone, Debug)]
3905 pub struct UpdateTaxonomy(RequestBuilder<crate::model::UpdateTaxonomyRequest>);
3906
3907 impl UpdateTaxonomy {
3908 pub(crate) fn new(
3909 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
3910 ) -> Self {
3911 Self(RequestBuilder::new(stub))
3912 }
3913
3914 /// Sets the full request, replacing any prior values.
3915 pub fn with_request<V: Into<crate::model::UpdateTaxonomyRequest>>(mut self, v: V) -> Self {
3916 self.0.request = v.into();
3917 self
3918 }
3919
3920 /// Sets all the options, replacing any prior values.
3921 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3922 self.0.options = v.into();
3923 self
3924 }
3925
3926 /// Sends the request.
3927 pub async fn send(self) -> Result<crate::model::Taxonomy> {
3928 (*self.0.stub)
3929 .update_taxonomy(self.0.request, self.0.options)
3930 .await
3931 .map(crate::Response::into_body)
3932 }
3933
3934 /// Sets the value of [taxonomy][crate::model::UpdateTaxonomyRequest::taxonomy].
3935 pub fn set_taxonomy<T>(mut self, v: T) -> Self
3936 where
3937 T: std::convert::Into<crate::model::Taxonomy>,
3938 {
3939 self.0.request.taxonomy = std::option::Option::Some(v.into());
3940 self
3941 }
3942
3943 /// Sets or clears the value of [taxonomy][crate::model::UpdateTaxonomyRequest::taxonomy].
3944 pub fn set_or_clear_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
3945 where
3946 T: std::convert::Into<crate::model::Taxonomy>,
3947 {
3948 self.0.request.taxonomy = v.map(|x| x.into());
3949 self
3950 }
3951
3952 /// Sets the value of [update_mask][crate::model::UpdateTaxonomyRequest::update_mask].
3953 pub fn set_update_mask<T>(mut self, v: T) -> Self
3954 where
3955 T: std::convert::Into<wkt::FieldMask>,
3956 {
3957 self.0.request.update_mask = std::option::Option::Some(v.into());
3958 self
3959 }
3960
3961 /// Sets or clears the value of [update_mask][crate::model::UpdateTaxonomyRequest::update_mask].
3962 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3963 where
3964 T: std::convert::Into<wkt::FieldMask>,
3965 {
3966 self.0.request.update_mask = v.map(|x| x.into());
3967 self
3968 }
3969 }
3970
3971 #[doc(hidden)]
3972 impl crate::RequestBuilder for UpdateTaxonomy {
3973 fn request_options(&mut self) -> &mut crate::RequestOptions {
3974 &mut self.0.options
3975 }
3976 }
3977
3978 /// The request builder for [PolicyTagManager::list_taxonomies][crate::client::PolicyTagManager::list_taxonomies] calls.
3979 ///
3980 /// # Example
3981 /// ```
3982 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::ListTaxonomies;
3983 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
3984 /// use google_cloud_gax::paginator::ItemPaginator;
3985 ///
3986 /// let builder = prepare_request_builder();
3987 /// let mut items = builder.by_item();
3988 /// while let Some(result) = items.next().await {
3989 /// let item = result?;
3990 /// }
3991 /// # Ok(()) }
3992 ///
3993 /// fn prepare_request_builder() -> ListTaxonomies {
3994 /// # panic!();
3995 /// // ... details omitted ...
3996 /// }
3997 /// ```
3998 #[derive(Clone, Debug)]
3999 pub struct ListTaxonomies(RequestBuilder<crate::model::ListTaxonomiesRequest>);
4000
4001 impl ListTaxonomies {
4002 pub(crate) fn new(
4003 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4004 ) -> Self {
4005 Self(RequestBuilder::new(stub))
4006 }
4007
4008 /// Sets the full request, replacing any prior values.
4009 pub fn with_request<V: Into<crate::model::ListTaxonomiesRequest>>(mut self, v: V) -> Self {
4010 self.0.request = v.into();
4011 self
4012 }
4013
4014 /// Sets all the options, replacing any prior values.
4015 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4016 self.0.options = v.into();
4017 self
4018 }
4019
4020 /// Sends the request.
4021 pub async fn send(self) -> Result<crate::model::ListTaxonomiesResponse> {
4022 (*self.0.stub)
4023 .list_taxonomies(self.0.request, self.0.options)
4024 .await
4025 .map(crate::Response::into_body)
4026 }
4027
4028 /// Streams each page in the collection.
4029 pub fn by_page(
4030 self,
4031 ) -> impl google_cloud_gax::paginator::Paginator<
4032 crate::model::ListTaxonomiesResponse,
4033 crate::Error,
4034 > {
4035 use std::clone::Clone;
4036 let token = self.0.request.page_token.clone();
4037 let execute = move |token: String| {
4038 let mut builder = self.clone();
4039 builder.0.request = builder.0.request.set_page_token(token);
4040 builder.send()
4041 };
4042 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4043 }
4044
4045 /// Streams each item in the collection.
4046 pub fn by_item(
4047 self,
4048 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4049 crate::model::ListTaxonomiesResponse,
4050 crate::Error,
4051 > {
4052 use google_cloud_gax::paginator::Paginator;
4053 self.by_page().items()
4054 }
4055
4056 /// Sets the value of [parent][crate::model::ListTaxonomiesRequest::parent].
4057 ///
4058 /// This is a **required** field for requests.
4059 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4060 self.0.request.parent = v.into();
4061 self
4062 }
4063
4064 /// Sets the value of [page_size][crate::model::ListTaxonomiesRequest::page_size].
4065 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4066 self.0.request.page_size = v.into();
4067 self
4068 }
4069
4070 /// Sets the value of [page_token][crate::model::ListTaxonomiesRequest::page_token].
4071 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4072 self.0.request.page_token = v.into();
4073 self
4074 }
4075
4076 /// Sets the value of [filter][crate::model::ListTaxonomiesRequest::filter].
4077 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4078 self.0.request.filter = v.into();
4079 self
4080 }
4081 }
4082
4083 #[doc(hidden)]
4084 impl crate::RequestBuilder for ListTaxonomies {
4085 fn request_options(&mut self) -> &mut crate::RequestOptions {
4086 &mut self.0.options
4087 }
4088 }
4089
4090 /// The request builder for [PolicyTagManager::get_taxonomy][crate::client::PolicyTagManager::get_taxonomy] calls.
4091 ///
4092 /// # Example
4093 /// ```
4094 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::GetTaxonomy;
4095 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4096 ///
4097 /// let builder = prepare_request_builder();
4098 /// let response = builder.send().await?;
4099 /// # Ok(()) }
4100 ///
4101 /// fn prepare_request_builder() -> GetTaxonomy {
4102 /// # panic!();
4103 /// // ... details omitted ...
4104 /// }
4105 /// ```
4106 #[derive(Clone, Debug)]
4107 pub struct GetTaxonomy(RequestBuilder<crate::model::GetTaxonomyRequest>);
4108
4109 impl GetTaxonomy {
4110 pub(crate) fn new(
4111 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4112 ) -> Self {
4113 Self(RequestBuilder::new(stub))
4114 }
4115
4116 /// Sets the full request, replacing any prior values.
4117 pub fn with_request<V: Into<crate::model::GetTaxonomyRequest>>(mut self, v: V) -> Self {
4118 self.0.request = v.into();
4119 self
4120 }
4121
4122 /// Sets all the options, replacing any prior values.
4123 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4124 self.0.options = v.into();
4125 self
4126 }
4127
4128 /// Sends the request.
4129 pub async fn send(self) -> Result<crate::model::Taxonomy> {
4130 (*self.0.stub)
4131 .get_taxonomy(self.0.request, self.0.options)
4132 .await
4133 .map(crate::Response::into_body)
4134 }
4135
4136 /// Sets the value of [name][crate::model::GetTaxonomyRequest::name].
4137 ///
4138 /// This is a **required** field for requests.
4139 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4140 self.0.request.name = v.into();
4141 self
4142 }
4143 }
4144
4145 #[doc(hidden)]
4146 impl crate::RequestBuilder for GetTaxonomy {
4147 fn request_options(&mut self) -> &mut crate::RequestOptions {
4148 &mut self.0.options
4149 }
4150 }
4151
4152 /// The request builder for [PolicyTagManager::create_policy_tag][crate::client::PolicyTagManager::create_policy_tag] calls.
4153 ///
4154 /// # Example
4155 /// ```
4156 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::CreatePolicyTag;
4157 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4158 ///
4159 /// let builder = prepare_request_builder();
4160 /// let response = builder.send().await?;
4161 /// # Ok(()) }
4162 ///
4163 /// fn prepare_request_builder() -> CreatePolicyTag {
4164 /// # panic!();
4165 /// // ... details omitted ...
4166 /// }
4167 /// ```
4168 #[derive(Clone, Debug)]
4169 pub struct CreatePolicyTag(RequestBuilder<crate::model::CreatePolicyTagRequest>);
4170
4171 impl CreatePolicyTag {
4172 pub(crate) fn new(
4173 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4174 ) -> Self {
4175 Self(RequestBuilder::new(stub))
4176 }
4177
4178 /// Sets the full request, replacing any prior values.
4179 pub fn with_request<V: Into<crate::model::CreatePolicyTagRequest>>(mut self, v: V) -> Self {
4180 self.0.request = v.into();
4181 self
4182 }
4183
4184 /// Sets all the options, replacing any prior values.
4185 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4186 self.0.options = v.into();
4187 self
4188 }
4189
4190 /// Sends the request.
4191 pub async fn send(self) -> Result<crate::model::PolicyTag> {
4192 (*self.0.stub)
4193 .create_policy_tag(self.0.request, self.0.options)
4194 .await
4195 .map(crate::Response::into_body)
4196 }
4197
4198 /// Sets the value of [parent][crate::model::CreatePolicyTagRequest::parent].
4199 ///
4200 /// This is a **required** field for requests.
4201 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4202 self.0.request.parent = v.into();
4203 self
4204 }
4205
4206 /// Sets the value of [policy_tag][crate::model::CreatePolicyTagRequest::policy_tag].
4207 pub fn set_policy_tag<T>(mut self, v: T) -> Self
4208 where
4209 T: std::convert::Into<crate::model::PolicyTag>,
4210 {
4211 self.0.request.policy_tag = std::option::Option::Some(v.into());
4212 self
4213 }
4214
4215 /// Sets or clears the value of [policy_tag][crate::model::CreatePolicyTagRequest::policy_tag].
4216 pub fn set_or_clear_policy_tag<T>(mut self, v: std::option::Option<T>) -> Self
4217 where
4218 T: std::convert::Into<crate::model::PolicyTag>,
4219 {
4220 self.0.request.policy_tag = v.map(|x| x.into());
4221 self
4222 }
4223 }
4224
4225 #[doc(hidden)]
4226 impl crate::RequestBuilder for CreatePolicyTag {
4227 fn request_options(&mut self) -> &mut crate::RequestOptions {
4228 &mut self.0.options
4229 }
4230 }
4231
4232 /// The request builder for [PolicyTagManager::delete_policy_tag][crate::client::PolicyTagManager::delete_policy_tag] calls.
4233 ///
4234 /// # Example
4235 /// ```
4236 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::DeletePolicyTag;
4237 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4238 ///
4239 /// let builder = prepare_request_builder();
4240 /// let response = builder.send().await?;
4241 /// # Ok(()) }
4242 ///
4243 /// fn prepare_request_builder() -> DeletePolicyTag {
4244 /// # panic!();
4245 /// // ... details omitted ...
4246 /// }
4247 /// ```
4248 #[derive(Clone, Debug)]
4249 pub struct DeletePolicyTag(RequestBuilder<crate::model::DeletePolicyTagRequest>);
4250
4251 impl DeletePolicyTag {
4252 pub(crate) fn new(
4253 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4254 ) -> Self {
4255 Self(RequestBuilder::new(stub))
4256 }
4257
4258 /// Sets the full request, replacing any prior values.
4259 pub fn with_request<V: Into<crate::model::DeletePolicyTagRequest>>(mut self, v: V) -> Self {
4260 self.0.request = v.into();
4261 self
4262 }
4263
4264 /// Sets all the options, replacing any prior values.
4265 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4266 self.0.options = v.into();
4267 self
4268 }
4269
4270 /// Sends the request.
4271 pub async fn send(self) -> Result<()> {
4272 (*self.0.stub)
4273 .delete_policy_tag(self.0.request, self.0.options)
4274 .await
4275 .map(crate::Response::into_body)
4276 }
4277
4278 /// Sets the value of [name][crate::model::DeletePolicyTagRequest::name].
4279 ///
4280 /// This is a **required** field for requests.
4281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4282 self.0.request.name = v.into();
4283 self
4284 }
4285 }
4286
4287 #[doc(hidden)]
4288 impl crate::RequestBuilder for DeletePolicyTag {
4289 fn request_options(&mut self) -> &mut crate::RequestOptions {
4290 &mut self.0.options
4291 }
4292 }
4293
4294 /// The request builder for [PolicyTagManager::update_policy_tag][crate::client::PolicyTagManager::update_policy_tag] calls.
4295 ///
4296 /// # Example
4297 /// ```
4298 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::UpdatePolicyTag;
4299 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4300 ///
4301 /// let builder = prepare_request_builder();
4302 /// let response = builder.send().await?;
4303 /// # Ok(()) }
4304 ///
4305 /// fn prepare_request_builder() -> UpdatePolicyTag {
4306 /// # panic!();
4307 /// // ... details omitted ...
4308 /// }
4309 /// ```
4310 #[derive(Clone, Debug)]
4311 pub struct UpdatePolicyTag(RequestBuilder<crate::model::UpdatePolicyTagRequest>);
4312
4313 impl UpdatePolicyTag {
4314 pub(crate) fn new(
4315 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4316 ) -> Self {
4317 Self(RequestBuilder::new(stub))
4318 }
4319
4320 /// Sets the full request, replacing any prior values.
4321 pub fn with_request<V: Into<crate::model::UpdatePolicyTagRequest>>(mut self, v: V) -> Self {
4322 self.0.request = v.into();
4323 self
4324 }
4325
4326 /// Sets all the options, replacing any prior values.
4327 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4328 self.0.options = v.into();
4329 self
4330 }
4331
4332 /// Sends the request.
4333 pub async fn send(self) -> Result<crate::model::PolicyTag> {
4334 (*self.0.stub)
4335 .update_policy_tag(self.0.request, self.0.options)
4336 .await
4337 .map(crate::Response::into_body)
4338 }
4339
4340 /// Sets the value of [policy_tag][crate::model::UpdatePolicyTagRequest::policy_tag].
4341 pub fn set_policy_tag<T>(mut self, v: T) -> Self
4342 where
4343 T: std::convert::Into<crate::model::PolicyTag>,
4344 {
4345 self.0.request.policy_tag = std::option::Option::Some(v.into());
4346 self
4347 }
4348
4349 /// Sets or clears the value of [policy_tag][crate::model::UpdatePolicyTagRequest::policy_tag].
4350 pub fn set_or_clear_policy_tag<T>(mut self, v: std::option::Option<T>) -> Self
4351 where
4352 T: std::convert::Into<crate::model::PolicyTag>,
4353 {
4354 self.0.request.policy_tag = v.map(|x| x.into());
4355 self
4356 }
4357
4358 /// Sets the value of [update_mask][crate::model::UpdatePolicyTagRequest::update_mask].
4359 pub fn set_update_mask<T>(mut self, v: T) -> Self
4360 where
4361 T: std::convert::Into<wkt::FieldMask>,
4362 {
4363 self.0.request.update_mask = std::option::Option::Some(v.into());
4364 self
4365 }
4366
4367 /// Sets or clears the value of [update_mask][crate::model::UpdatePolicyTagRequest::update_mask].
4368 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4369 where
4370 T: std::convert::Into<wkt::FieldMask>,
4371 {
4372 self.0.request.update_mask = v.map(|x| x.into());
4373 self
4374 }
4375 }
4376
4377 #[doc(hidden)]
4378 impl crate::RequestBuilder for UpdatePolicyTag {
4379 fn request_options(&mut self) -> &mut crate::RequestOptions {
4380 &mut self.0.options
4381 }
4382 }
4383
4384 /// The request builder for [PolicyTagManager::list_policy_tags][crate::client::PolicyTagManager::list_policy_tags] calls.
4385 ///
4386 /// # Example
4387 /// ```
4388 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::ListPolicyTags;
4389 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4390 /// use google_cloud_gax::paginator::ItemPaginator;
4391 ///
4392 /// let builder = prepare_request_builder();
4393 /// let mut items = builder.by_item();
4394 /// while let Some(result) = items.next().await {
4395 /// let item = result?;
4396 /// }
4397 /// # Ok(()) }
4398 ///
4399 /// fn prepare_request_builder() -> ListPolicyTags {
4400 /// # panic!();
4401 /// // ... details omitted ...
4402 /// }
4403 /// ```
4404 #[derive(Clone, Debug)]
4405 pub struct ListPolicyTags(RequestBuilder<crate::model::ListPolicyTagsRequest>);
4406
4407 impl ListPolicyTags {
4408 pub(crate) fn new(
4409 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4410 ) -> Self {
4411 Self(RequestBuilder::new(stub))
4412 }
4413
4414 /// Sets the full request, replacing any prior values.
4415 pub fn with_request<V: Into<crate::model::ListPolicyTagsRequest>>(mut self, v: V) -> Self {
4416 self.0.request = v.into();
4417 self
4418 }
4419
4420 /// Sets all the options, replacing any prior values.
4421 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4422 self.0.options = v.into();
4423 self
4424 }
4425
4426 /// Sends the request.
4427 pub async fn send(self) -> Result<crate::model::ListPolicyTagsResponse> {
4428 (*self.0.stub)
4429 .list_policy_tags(self.0.request, self.0.options)
4430 .await
4431 .map(crate::Response::into_body)
4432 }
4433
4434 /// Streams each page in the collection.
4435 pub fn by_page(
4436 self,
4437 ) -> impl google_cloud_gax::paginator::Paginator<
4438 crate::model::ListPolicyTagsResponse,
4439 crate::Error,
4440 > {
4441 use std::clone::Clone;
4442 let token = self.0.request.page_token.clone();
4443 let execute = move |token: String| {
4444 let mut builder = self.clone();
4445 builder.0.request = builder.0.request.set_page_token(token);
4446 builder.send()
4447 };
4448 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4449 }
4450
4451 /// Streams each item in the collection.
4452 pub fn by_item(
4453 self,
4454 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4455 crate::model::ListPolicyTagsResponse,
4456 crate::Error,
4457 > {
4458 use google_cloud_gax::paginator::Paginator;
4459 self.by_page().items()
4460 }
4461
4462 /// Sets the value of [parent][crate::model::ListPolicyTagsRequest::parent].
4463 ///
4464 /// This is a **required** field for requests.
4465 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4466 self.0.request.parent = v.into();
4467 self
4468 }
4469
4470 /// Sets the value of [page_size][crate::model::ListPolicyTagsRequest::page_size].
4471 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4472 self.0.request.page_size = v.into();
4473 self
4474 }
4475
4476 /// Sets the value of [page_token][crate::model::ListPolicyTagsRequest::page_token].
4477 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4478 self.0.request.page_token = v.into();
4479 self
4480 }
4481 }
4482
4483 #[doc(hidden)]
4484 impl crate::RequestBuilder for ListPolicyTags {
4485 fn request_options(&mut self) -> &mut crate::RequestOptions {
4486 &mut self.0.options
4487 }
4488 }
4489
4490 /// The request builder for [PolicyTagManager::get_policy_tag][crate::client::PolicyTagManager::get_policy_tag] calls.
4491 ///
4492 /// # Example
4493 /// ```
4494 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::GetPolicyTag;
4495 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4496 ///
4497 /// let builder = prepare_request_builder();
4498 /// let response = builder.send().await?;
4499 /// # Ok(()) }
4500 ///
4501 /// fn prepare_request_builder() -> GetPolicyTag {
4502 /// # panic!();
4503 /// // ... details omitted ...
4504 /// }
4505 /// ```
4506 #[derive(Clone, Debug)]
4507 pub struct GetPolicyTag(RequestBuilder<crate::model::GetPolicyTagRequest>);
4508
4509 impl GetPolicyTag {
4510 pub(crate) fn new(
4511 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4512 ) -> Self {
4513 Self(RequestBuilder::new(stub))
4514 }
4515
4516 /// Sets the full request, replacing any prior values.
4517 pub fn with_request<V: Into<crate::model::GetPolicyTagRequest>>(mut self, v: V) -> Self {
4518 self.0.request = v.into();
4519 self
4520 }
4521
4522 /// Sets all the options, replacing any prior values.
4523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4524 self.0.options = v.into();
4525 self
4526 }
4527
4528 /// Sends the request.
4529 pub async fn send(self) -> Result<crate::model::PolicyTag> {
4530 (*self.0.stub)
4531 .get_policy_tag(self.0.request, self.0.options)
4532 .await
4533 .map(crate::Response::into_body)
4534 }
4535
4536 /// Sets the value of [name][crate::model::GetPolicyTagRequest::name].
4537 ///
4538 /// This is a **required** field for requests.
4539 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4540 self.0.request.name = v.into();
4541 self
4542 }
4543 }
4544
4545 #[doc(hidden)]
4546 impl crate::RequestBuilder for GetPolicyTag {
4547 fn request_options(&mut self) -> &mut crate::RequestOptions {
4548 &mut self.0.options
4549 }
4550 }
4551
4552 /// The request builder for [PolicyTagManager::get_iam_policy][crate::client::PolicyTagManager::get_iam_policy] calls.
4553 ///
4554 /// # Example
4555 /// ```
4556 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::GetIamPolicy;
4557 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4558 ///
4559 /// let builder = prepare_request_builder();
4560 /// let response = builder.send().await?;
4561 /// # Ok(()) }
4562 ///
4563 /// fn prepare_request_builder() -> GetIamPolicy {
4564 /// # panic!();
4565 /// // ... details omitted ...
4566 /// }
4567 /// ```
4568 #[derive(Clone, Debug)]
4569 pub struct GetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::GetIamPolicyRequest>);
4570
4571 impl GetIamPolicy {
4572 pub(crate) fn new(
4573 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4574 ) -> Self {
4575 Self(RequestBuilder::new(stub))
4576 }
4577
4578 /// Sets the full request, replacing any prior values.
4579 pub fn with_request<V: Into<google_cloud_iam_v1::model::GetIamPolicyRequest>>(
4580 mut self,
4581 v: V,
4582 ) -> Self {
4583 self.0.request = v.into();
4584 self
4585 }
4586
4587 /// Sets all the options, replacing any prior values.
4588 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4589 self.0.options = v.into();
4590 self
4591 }
4592
4593 /// Sends the request.
4594 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4595 (*self.0.stub)
4596 .get_iam_policy(self.0.request, self.0.options)
4597 .await
4598 .map(crate::Response::into_body)
4599 }
4600
4601 /// Sets the value of [resource][google_cloud_iam_v1::model::GetIamPolicyRequest::resource].
4602 ///
4603 /// This is a **required** field for requests.
4604 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4605 self.0.request.resource = v.into();
4606 self
4607 }
4608
4609 /// Sets the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4610 pub fn set_options<T>(mut self, v: T) -> Self
4611 where
4612 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4613 {
4614 self.0.request.options = std::option::Option::Some(v.into());
4615 self
4616 }
4617
4618 /// Sets or clears the value of [options][google_cloud_iam_v1::model::GetIamPolicyRequest::options].
4619 pub fn set_or_clear_options<T>(mut self, v: std::option::Option<T>) -> Self
4620 where
4621 T: std::convert::Into<google_cloud_iam_v1::model::GetPolicyOptions>,
4622 {
4623 self.0.request.options = v.map(|x| x.into());
4624 self
4625 }
4626 }
4627
4628 #[doc(hidden)]
4629 impl crate::RequestBuilder for GetIamPolicy {
4630 fn request_options(&mut self) -> &mut crate::RequestOptions {
4631 &mut self.0.options
4632 }
4633 }
4634
4635 /// The request builder for [PolicyTagManager::set_iam_policy][crate::client::PolicyTagManager::set_iam_policy] calls.
4636 ///
4637 /// # Example
4638 /// ```
4639 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::SetIamPolicy;
4640 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4641 ///
4642 /// let builder = prepare_request_builder();
4643 /// let response = builder.send().await?;
4644 /// # Ok(()) }
4645 ///
4646 /// fn prepare_request_builder() -> SetIamPolicy {
4647 /// # panic!();
4648 /// // ... details omitted ...
4649 /// }
4650 /// ```
4651 #[derive(Clone, Debug)]
4652 pub struct SetIamPolicy(RequestBuilder<google_cloud_iam_v1::model::SetIamPolicyRequest>);
4653
4654 impl SetIamPolicy {
4655 pub(crate) fn new(
4656 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4657 ) -> Self {
4658 Self(RequestBuilder::new(stub))
4659 }
4660
4661 /// Sets the full request, replacing any prior values.
4662 pub fn with_request<V: Into<google_cloud_iam_v1::model::SetIamPolicyRequest>>(
4663 mut self,
4664 v: V,
4665 ) -> Self {
4666 self.0.request = v.into();
4667 self
4668 }
4669
4670 /// Sets all the options, replacing any prior values.
4671 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4672 self.0.options = v.into();
4673 self
4674 }
4675
4676 /// Sends the request.
4677 pub async fn send(self) -> Result<google_cloud_iam_v1::model::Policy> {
4678 (*self.0.stub)
4679 .set_iam_policy(self.0.request, self.0.options)
4680 .await
4681 .map(crate::Response::into_body)
4682 }
4683
4684 /// Sets the value of [resource][google_cloud_iam_v1::model::SetIamPolicyRequest::resource].
4685 ///
4686 /// This is a **required** field for requests.
4687 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4688 self.0.request.resource = v.into();
4689 self
4690 }
4691
4692 /// Sets the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4693 ///
4694 /// This is a **required** field for requests.
4695 pub fn set_policy<T>(mut self, v: T) -> Self
4696 where
4697 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4698 {
4699 self.0.request.policy = std::option::Option::Some(v.into());
4700 self
4701 }
4702
4703 /// Sets or clears the value of [policy][google_cloud_iam_v1::model::SetIamPolicyRequest::policy].
4704 ///
4705 /// This is a **required** field for requests.
4706 pub fn set_or_clear_policy<T>(mut self, v: std::option::Option<T>) -> Self
4707 where
4708 T: std::convert::Into<google_cloud_iam_v1::model::Policy>,
4709 {
4710 self.0.request.policy = v.map(|x| x.into());
4711 self
4712 }
4713
4714 /// Sets the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4715 pub fn set_update_mask<T>(mut self, v: T) -> Self
4716 where
4717 T: std::convert::Into<wkt::FieldMask>,
4718 {
4719 self.0.request.update_mask = std::option::Option::Some(v.into());
4720 self
4721 }
4722
4723 /// Sets or clears the value of [update_mask][google_cloud_iam_v1::model::SetIamPolicyRequest::update_mask].
4724 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4725 where
4726 T: std::convert::Into<wkt::FieldMask>,
4727 {
4728 self.0.request.update_mask = v.map(|x| x.into());
4729 self
4730 }
4731 }
4732
4733 #[doc(hidden)]
4734 impl crate::RequestBuilder for SetIamPolicy {
4735 fn request_options(&mut self) -> &mut crate::RequestOptions {
4736 &mut self.0.options
4737 }
4738 }
4739
4740 /// The request builder for [PolicyTagManager::test_iam_permissions][crate::client::PolicyTagManager::test_iam_permissions] calls.
4741 ///
4742 /// # Example
4743 /// ```
4744 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::TestIamPermissions;
4745 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4746 ///
4747 /// let builder = prepare_request_builder();
4748 /// let response = builder.send().await?;
4749 /// # Ok(()) }
4750 ///
4751 /// fn prepare_request_builder() -> TestIamPermissions {
4752 /// # panic!();
4753 /// // ... details omitted ...
4754 /// }
4755 /// ```
4756 #[derive(Clone, Debug)]
4757 pub struct TestIamPermissions(
4758 RequestBuilder<google_cloud_iam_v1::model::TestIamPermissionsRequest>,
4759 );
4760
4761 impl TestIamPermissions {
4762 pub(crate) fn new(
4763 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4764 ) -> Self {
4765 Self(RequestBuilder::new(stub))
4766 }
4767
4768 /// Sets the full request, replacing any prior values.
4769 pub fn with_request<V: Into<google_cloud_iam_v1::model::TestIamPermissionsRequest>>(
4770 mut self,
4771 v: V,
4772 ) -> Self {
4773 self.0.request = v.into();
4774 self
4775 }
4776
4777 /// Sets all the options, replacing any prior values.
4778 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4779 self.0.options = v.into();
4780 self
4781 }
4782
4783 /// Sends the request.
4784 pub async fn send(self) -> Result<google_cloud_iam_v1::model::TestIamPermissionsResponse> {
4785 (*self.0.stub)
4786 .test_iam_permissions(self.0.request, self.0.options)
4787 .await
4788 .map(crate::Response::into_body)
4789 }
4790
4791 /// Sets the value of [resource][google_cloud_iam_v1::model::TestIamPermissionsRequest::resource].
4792 ///
4793 /// This is a **required** field for requests.
4794 pub fn set_resource<T: Into<std::string::String>>(mut self, v: T) -> Self {
4795 self.0.request.resource = v.into();
4796 self
4797 }
4798
4799 /// Sets the value of [permissions][google_cloud_iam_v1::model::TestIamPermissionsRequest::permissions].
4800 ///
4801 /// This is a **required** field for requests.
4802 pub fn set_permissions<T, V>(mut self, v: T) -> Self
4803 where
4804 T: std::iter::IntoIterator<Item = V>,
4805 V: std::convert::Into<std::string::String>,
4806 {
4807 use std::iter::Iterator;
4808 self.0.request.permissions = v.into_iter().map(|i| i.into()).collect();
4809 self
4810 }
4811 }
4812
4813 #[doc(hidden)]
4814 impl crate::RequestBuilder for TestIamPermissions {
4815 fn request_options(&mut self) -> &mut crate::RequestOptions {
4816 &mut self.0.options
4817 }
4818 }
4819
4820 /// The request builder for [PolicyTagManager::list_operations][crate::client::PolicyTagManager::list_operations] calls.
4821 ///
4822 /// # Example
4823 /// ```
4824 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::ListOperations;
4825 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4826 /// use google_cloud_gax::paginator::ItemPaginator;
4827 ///
4828 /// let builder = prepare_request_builder();
4829 /// let mut items = builder.by_item();
4830 /// while let Some(result) = items.next().await {
4831 /// let item = result?;
4832 /// }
4833 /// # Ok(()) }
4834 ///
4835 /// fn prepare_request_builder() -> ListOperations {
4836 /// # panic!();
4837 /// // ... details omitted ...
4838 /// }
4839 /// ```
4840 #[derive(Clone, Debug)]
4841 pub struct ListOperations(
4842 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4843 );
4844
4845 impl ListOperations {
4846 pub(crate) fn new(
4847 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4848 ) -> Self {
4849 Self(RequestBuilder::new(stub))
4850 }
4851
4852 /// Sets the full request, replacing any prior values.
4853 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4854 mut self,
4855 v: V,
4856 ) -> Self {
4857 self.0.request = v.into();
4858 self
4859 }
4860
4861 /// Sets all the options, replacing any prior values.
4862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4863 self.0.options = v.into();
4864 self
4865 }
4866
4867 /// Sends the request.
4868 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4869 (*self.0.stub)
4870 .list_operations(self.0.request, self.0.options)
4871 .await
4872 .map(crate::Response::into_body)
4873 }
4874
4875 /// Streams each page in the collection.
4876 pub fn by_page(
4877 self,
4878 ) -> impl google_cloud_gax::paginator::Paginator<
4879 google_cloud_longrunning::model::ListOperationsResponse,
4880 crate::Error,
4881 > {
4882 use std::clone::Clone;
4883 let token = self.0.request.page_token.clone();
4884 let execute = move |token: String| {
4885 let mut builder = self.clone();
4886 builder.0.request = builder.0.request.set_page_token(token);
4887 builder.send()
4888 };
4889 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4890 }
4891
4892 /// Streams each item in the collection.
4893 pub fn by_item(
4894 self,
4895 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4896 google_cloud_longrunning::model::ListOperationsResponse,
4897 crate::Error,
4898 > {
4899 use google_cloud_gax::paginator::Paginator;
4900 self.by_page().items()
4901 }
4902
4903 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
4904 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4905 self.0.request.name = v.into();
4906 self
4907 }
4908
4909 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
4910 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4911 self.0.request.filter = v.into();
4912 self
4913 }
4914
4915 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
4916 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4917 self.0.request.page_size = v.into();
4918 self
4919 }
4920
4921 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
4922 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4923 self.0.request.page_token = v.into();
4924 self
4925 }
4926
4927 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
4928 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4929 self.0.request.return_partial_success = v.into();
4930 self
4931 }
4932 }
4933
4934 #[doc(hidden)]
4935 impl crate::RequestBuilder for ListOperations {
4936 fn request_options(&mut self) -> &mut crate::RequestOptions {
4937 &mut self.0.options
4938 }
4939 }
4940
4941 /// The request builder for [PolicyTagManager::get_operation][crate::client::PolicyTagManager::get_operation] calls.
4942 ///
4943 /// # Example
4944 /// ```
4945 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::GetOperation;
4946 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
4947 ///
4948 /// let builder = prepare_request_builder();
4949 /// let response = builder.send().await?;
4950 /// # Ok(()) }
4951 ///
4952 /// fn prepare_request_builder() -> GetOperation {
4953 /// # panic!();
4954 /// // ... details omitted ...
4955 /// }
4956 /// ```
4957 #[derive(Clone, Debug)]
4958 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4959
4960 impl GetOperation {
4961 pub(crate) fn new(
4962 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
4963 ) -> Self {
4964 Self(RequestBuilder::new(stub))
4965 }
4966
4967 /// Sets the full request, replacing any prior values.
4968 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4969 mut self,
4970 v: V,
4971 ) -> Self {
4972 self.0.request = v.into();
4973 self
4974 }
4975
4976 /// Sets all the options, replacing any prior values.
4977 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4978 self.0.options = v.into();
4979 self
4980 }
4981
4982 /// Sends the request.
4983 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4984 (*self.0.stub)
4985 .get_operation(self.0.request, self.0.options)
4986 .await
4987 .map(crate::Response::into_body)
4988 }
4989
4990 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
4991 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4992 self.0.request.name = v.into();
4993 self
4994 }
4995 }
4996
4997 #[doc(hidden)]
4998 impl crate::RequestBuilder for GetOperation {
4999 fn request_options(&mut self) -> &mut crate::RequestOptions {
5000 &mut self.0.options
5001 }
5002 }
5003
5004 /// The request builder for [PolicyTagManager::delete_operation][crate::client::PolicyTagManager::delete_operation] calls.
5005 ///
5006 /// # Example
5007 /// ```
5008 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::DeleteOperation;
5009 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5010 ///
5011 /// let builder = prepare_request_builder();
5012 /// let response = builder.send().await?;
5013 /// # Ok(()) }
5014 ///
5015 /// fn prepare_request_builder() -> DeleteOperation {
5016 /// # panic!();
5017 /// // ... details omitted ...
5018 /// }
5019 /// ```
5020 #[derive(Clone, Debug)]
5021 pub struct DeleteOperation(
5022 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5023 );
5024
5025 impl DeleteOperation {
5026 pub(crate) fn new(
5027 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
5028 ) -> Self {
5029 Self(RequestBuilder::new(stub))
5030 }
5031
5032 /// Sets the full request, replacing any prior values.
5033 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5034 mut self,
5035 v: V,
5036 ) -> Self {
5037 self.0.request = v.into();
5038 self
5039 }
5040
5041 /// Sets all the options, replacing any prior values.
5042 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5043 self.0.options = v.into();
5044 self
5045 }
5046
5047 /// Sends the request.
5048 pub async fn send(self) -> Result<()> {
5049 (*self.0.stub)
5050 .delete_operation(self.0.request, self.0.options)
5051 .await
5052 .map(crate::Response::into_body)
5053 }
5054
5055 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5056 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5057 self.0.request.name = v.into();
5058 self
5059 }
5060 }
5061
5062 #[doc(hidden)]
5063 impl crate::RequestBuilder for DeleteOperation {
5064 fn request_options(&mut self) -> &mut crate::RequestOptions {
5065 &mut self.0.options
5066 }
5067 }
5068
5069 /// The request builder for [PolicyTagManager::cancel_operation][crate::client::PolicyTagManager::cancel_operation] calls.
5070 ///
5071 /// # Example
5072 /// ```
5073 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager::CancelOperation;
5074 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5075 ///
5076 /// let builder = prepare_request_builder();
5077 /// let response = builder.send().await?;
5078 /// # Ok(()) }
5079 ///
5080 /// fn prepare_request_builder() -> CancelOperation {
5081 /// # panic!();
5082 /// // ... details omitted ...
5083 /// }
5084 /// ```
5085 #[derive(Clone, Debug)]
5086 pub struct CancelOperation(
5087 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5088 );
5089
5090 impl CancelOperation {
5091 pub(crate) fn new(
5092 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManager>,
5093 ) -> Self {
5094 Self(RequestBuilder::new(stub))
5095 }
5096
5097 /// Sets the full request, replacing any prior values.
5098 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5099 mut self,
5100 v: V,
5101 ) -> Self {
5102 self.0.request = v.into();
5103 self
5104 }
5105
5106 /// Sets all the options, replacing any prior values.
5107 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5108 self.0.options = v.into();
5109 self
5110 }
5111
5112 /// Sends the request.
5113 pub async fn send(self) -> Result<()> {
5114 (*self.0.stub)
5115 .cancel_operation(self.0.request, self.0.options)
5116 .await
5117 .map(crate::Response::into_body)
5118 }
5119
5120 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5121 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5122 self.0.request.name = v.into();
5123 self
5124 }
5125 }
5126
5127 #[doc(hidden)]
5128 impl crate::RequestBuilder for CancelOperation {
5129 fn request_options(&mut self) -> &mut crate::RequestOptions {
5130 &mut self.0.options
5131 }
5132 }
5133}
5134
5135pub mod policy_tag_manager_serialization {
5136 use crate::Result;
5137
5138 /// A builder for [PolicyTagManagerSerialization][crate::client::PolicyTagManagerSerialization].
5139 ///
5140 /// ```
5141 /// # async fn sample() -> google_cloud_gax::client_builder::Result<()> {
5142 /// # use google_cloud_datacatalog_v1::*;
5143 /// # use builder::policy_tag_manager_serialization::ClientBuilder;
5144 /// # use client::PolicyTagManagerSerialization;
5145 /// let builder : ClientBuilder = PolicyTagManagerSerialization::builder();
5146 /// let client = builder
5147 /// .with_endpoint("https://datacatalog.googleapis.com")
5148 /// .build().await?;
5149 /// # Ok(()) }
5150 /// ```
5151 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5152
5153 pub(crate) mod client {
5154 use super::super::super::client::PolicyTagManagerSerialization;
5155 pub struct Factory;
5156 impl crate::ClientFactory for Factory {
5157 type Client = PolicyTagManagerSerialization;
5158 type Credentials = gaxi::options::Credentials;
5159 async fn build(
5160 self,
5161 config: gaxi::options::ClientConfig,
5162 ) -> crate::ClientBuilderResult<Self::Client> {
5163 Self::Client::new(config).await
5164 }
5165 }
5166 }
5167
5168 /// Common implementation for [crate::client::PolicyTagManagerSerialization] request builders.
5169 #[derive(Clone, Debug)]
5170 pub(crate) struct RequestBuilder<R: std::default::Default> {
5171 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5172 request: R,
5173 options: crate::RequestOptions,
5174 }
5175
5176 impl<R> RequestBuilder<R>
5177 where
5178 R: std::default::Default,
5179 {
5180 pub(crate) fn new(
5181 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5182 ) -> Self {
5183 Self {
5184 stub,
5185 request: R::default(),
5186 options: crate::RequestOptions::default(),
5187 }
5188 }
5189 }
5190
5191 /// The request builder for [PolicyTagManagerSerialization::replace_taxonomy][crate::client::PolicyTagManagerSerialization::replace_taxonomy] calls.
5192 ///
5193 /// # Example
5194 /// ```
5195 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::ReplaceTaxonomy;
5196 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5197 ///
5198 /// let builder = prepare_request_builder();
5199 /// let response = builder.send().await?;
5200 /// # Ok(()) }
5201 ///
5202 /// fn prepare_request_builder() -> ReplaceTaxonomy {
5203 /// # panic!();
5204 /// // ... details omitted ...
5205 /// }
5206 /// ```
5207 #[derive(Clone, Debug)]
5208 pub struct ReplaceTaxonomy(RequestBuilder<crate::model::ReplaceTaxonomyRequest>);
5209
5210 impl ReplaceTaxonomy {
5211 pub(crate) fn new(
5212 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5213 ) -> Self {
5214 Self(RequestBuilder::new(stub))
5215 }
5216
5217 /// Sets the full request, replacing any prior values.
5218 pub fn with_request<V: Into<crate::model::ReplaceTaxonomyRequest>>(mut self, v: V) -> Self {
5219 self.0.request = v.into();
5220 self
5221 }
5222
5223 /// Sets all the options, replacing any prior values.
5224 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5225 self.0.options = v.into();
5226 self
5227 }
5228
5229 /// Sends the request.
5230 pub async fn send(self) -> Result<crate::model::Taxonomy> {
5231 (*self.0.stub)
5232 .replace_taxonomy(self.0.request, self.0.options)
5233 .await
5234 .map(crate::Response::into_body)
5235 }
5236
5237 /// Sets the value of [name][crate::model::ReplaceTaxonomyRequest::name].
5238 ///
5239 /// This is a **required** field for requests.
5240 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5241 self.0.request.name = v.into();
5242 self
5243 }
5244
5245 /// Sets the value of [serialized_taxonomy][crate::model::ReplaceTaxonomyRequest::serialized_taxonomy].
5246 ///
5247 /// This is a **required** field for requests.
5248 pub fn set_serialized_taxonomy<T>(mut self, v: T) -> Self
5249 where
5250 T: std::convert::Into<crate::model::SerializedTaxonomy>,
5251 {
5252 self.0.request.serialized_taxonomy = std::option::Option::Some(v.into());
5253 self
5254 }
5255
5256 /// Sets or clears the value of [serialized_taxonomy][crate::model::ReplaceTaxonomyRequest::serialized_taxonomy].
5257 ///
5258 /// This is a **required** field for requests.
5259 pub fn set_or_clear_serialized_taxonomy<T>(mut self, v: std::option::Option<T>) -> Self
5260 where
5261 T: std::convert::Into<crate::model::SerializedTaxonomy>,
5262 {
5263 self.0.request.serialized_taxonomy = v.map(|x| x.into());
5264 self
5265 }
5266 }
5267
5268 #[doc(hidden)]
5269 impl crate::RequestBuilder for ReplaceTaxonomy {
5270 fn request_options(&mut self) -> &mut crate::RequestOptions {
5271 &mut self.0.options
5272 }
5273 }
5274
5275 /// The request builder for [PolicyTagManagerSerialization::import_taxonomies][crate::client::PolicyTagManagerSerialization::import_taxonomies] calls.
5276 ///
5277 /// # Example
5278 /// ```
5279 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::ImportTaxonomies;
5280 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5281 ///
5282 /// let builder = prepare_request_builder();
5283 /// let response = builder.send().await?;
5284 /// # Ok(()) }
5285 ///
5286 /// fn prepare_request_builder() -> ImportTaxonomies {
5287 /// # panic!();
5288 /// // ... details omitted ...
5289 /// }
5290 /// ```
5291 #[derive(Clone, Debug)]
5292 pub struct ImportTaxonomies(RequestBuilder<crate::model::ImportTaxonomiesRequest>);
5293
5294 impl ImportTaxonomies {
5295 pub(crate) fn new(
5296 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5297 ) -> Self {
5298 Self(RequestBuilder::new(stub))
5299 }
5300
5301 /// Sets the full request, replacing any prior values.
5302 pub fn with_request<V: Into<crate::model::ImportTaxonomiesRequest>>(
5303 mut self,
5304 v: V,
5305 ) -> Self {
5306 self.0.request = v.into();
5307 self
5308 }
5309
5310 /// Sets all the options, replacing any prior values.
5311 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5312 self.0.options = v.into();
5313 self
5314 }
5315
5316 /// Sends the request.
5317 pub async fn send(self) -> Result<crate::model::ImportTaxonomiesResponse> {
5318 (*self.0.stub)
5319 .import_taxonomies(self.0.request, self.0.options)
5320 .await
5321 .map(crate::Response::into_body)
5322 }
5323
5324 /// Sets the value of [parent][crate::model::ImportTaxonomiesRequest::parent].
5325 ///
5326 /// This is a **required** field for requests.
5327 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5328 self.0.request.parent = v.into();
5329 self
5330 }
5331
5332 /// Sets the value of [source][crate::model::ImportTaxonomiesRequest::source].
5333 ///
5334 /// Note that all the setters affecting `source` are
5335 /// mutually exclusive.
5336 pub fn set_source<T: Into<Option<crate::model::import_taxonomies_request::Source>>>(
5337 mut self,
5338 v: T,
5339 ) -> Self {
5340 self.0.request.source = v.into();
5341 self
5342 }
5343
5344 /// Sets the value of [source][crate::model::ImportTaxonomiesRequest::source]
5345 /// to hold a `InlineSource`.
5346 ///
5347 /// Note that all the setters affecting `source` are
5348 /// mutually exclusive.
5349 pub fn set_inline_source<
5350 T: std::convert::Into<std::boxed::Box<crate::model::InlineSource>>,
5351 >(
5352 mut self,
5353 v: T,
5354 ) -> Self {
5355 self.0.request = self.0.request.set_inline_source(v);
5356 self
5357 }
5358
5359 /// Sets the value of [source][crate::model::ImportTaxonomiesRequest::source]
5360 /// to hold a `CrossRegionalSource`.
5361 ///
5362 /// Note that all the setters affecting `source` are
5363 /// mutually exclusive.
5364 pub fn set_cross_regional_source<
5365 T: std::convert::Into<std::boxed::Box<crate::model::CrossRegionalSource>>,
5366 >(
5367 mut self,
5368 v: T,
5369 ) -> Self {
5370 self.0.request = self.0.request.set_cross_regional_source(v);
5371 self
5372 }
5373 }
5374
5375 #[doc(hidden)]
5376 impl crate::RequestBuilder for ImportTaxonomies {
5377 fn request_options(&mut self) -> &mut crate::RequestOptions {
5378 &mut self.0.options
5379 }
5380 }
5381
5382 /// The request builder for [PolicyTagManagerSerialization::export_taxonomies][crate::client::PolicyTagManagerSerialization::export_taxonomies] calls.
5383 ///
5384 /// # Example
5385 /// ```
5386 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::ExportTaxonomies;
5387 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5388 ///
5389 /// let builder = prepare_request_builder();
5390 /// let response = builder.send().await?;
5391 /// # Ok(()) }
5392 ///
5393 /// fn prepare_request_builder() -> ExportTaxonomies {
5394 /// # panic!();
5395 /// // ... details omitted ...
5396 /// }
5397 /// ```
5398 #[derive(Clone, Debug)]
5399 pub struct ExportTaxonomies(RequestBuilder<crate::model::ExportTaxonomiesRequest>);
5400
5401 impl ExportTaxonomies {
5402 pub(crate) fn new(
5403 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5404 ) -> Self {
5405 Self(RequestBuilder::new(stub))
5406 }
5407
5408 /// Sets the full request, replacing any prior values.
5409 pub fn with_request<V: Into<crate::model::ExportTaxonomiesRequest>>(
5410 mut self,
5411 v: V,
5412 ) -> Self {
5413 self.0.request = v.into();
5414 self
5415 }
5416
5417 /// Sets all the options, replacing any prior values.
5418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5419 self.0.options = v.into();
5420 self
5421 }
5422
5423 /// Sends the request.
5424 pub async fn send(self) -> Result<crate::model::ExportTaxonomiesResponse> {
5425 (*self.0.stub)
5426 .export_taxonomies(self.0.request, self.0.options)
5427 .await
5428 .map(crate::Response::into_body)
5429 }
5430
5431 /// Sets the value of [parent][crate::model::ExportTaxonomiesRequest::parent].
5432 ///
5433 /// This is a **required** field for requests.
5434 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5435 self.0.request.parent = v.into();
5436 self
5437 }
5438
5439 /// Sets the value of [taxonomies][crate::model::ExportTaxonomiesRequest::taxonomies].
5440 ///
5441 /// This is a **required** field for requests.
5442 pub fn set_taxonomies<T, V>(mut self, v: T) -> Self
5443 where
5444 T: std::iter::IntoIterator<Item = V>,
5445 V: std::convert::Into<std::string::String>,
5446 {
5447 use std::iter::Iterator;
5448 self.0.request.taxonomies = v.into_iter().map(|i| i.into()).collect();
5449 self
5450 }
5451
5452 /// Sets the value of [destination][crate::model::ExportTaxonomiesRequest::destination].
5453 ///
5454 /// Note that all the setters affecting `destination` are
5455 /// mutually exclusive.
5456 pub fn set_destination<
5457 T: Into<Option<crate::model::export_taxonomies_request::Destination>>,
5458 >(
5459 mut self,
5460 v: T,
5461 ) -> Self {
5462 self.0.request.destination = v.into();
5463 self
5464 }
5465
5466 /// Sets the value of [destination][crate::model::ExportTaxonomiesRequest::destination]
5467 /// to hold a `SerializedTaxonomies`.
5468 ///
5469 /// Note that all the setters affecting `destination` are
5470 /// mutually exclusive.
5471 pub fn set_serialized_taxonomies<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
5472 self.0.request = self.0.request.set_serialized_taxonomies(v);
5473 self
5474 }
5475 }
5476
5477 #[doc(hidden)]
5478 impl crate::RequestBuilder for ExportTaxonomies {
5479 fn request_options(&mut self) -> &mut crate::RequestOptions {
5480 &mut self.0.options
5481 }
5482 }
5483
5484 /// The request builder for [PolicyTagManagerSerialization::list_operations][crate::client::PolicyTagManagerSerialization::list_operations] calls.
5485 ///
5486 /// # Example
5487 /// ```
5488 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::ListOperations;
5489 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5490 /// use google_cloud_gax::paginator::ItemPaginator;
5491 ///
5492 /// let builder = prepare_request_builder();
5493 /// let mut items = builder.by_item();
5494 /// while let Some(result) = items.next().await {
5495 /// let item = result?;
5496 /// }
5497 /// # Ok(()) }
5498 ///
5499 /// fn prepare_request_builder() -> ListOperations {
5500 /// # panic!();
5501 /// // ... details omitted ...
5502 /// }
5503 /// ```
5504 #[derive(Clone, Debug)]
5505 pub struct ListOperations(
5506 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5507 );
5508
5509 impl ListOperations {
5510 pub(crate) fn new(
5511 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5512 ) -> Self {
5513 Self(RequestBuilder::new(stub))
5514 }
5515
5516 /// Sets the full request, replacing any prior values.
5517 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5518 mut self,
5519 v: V,
5520 ) -> Self {
5521 self.0.request = v.into();
5522 self
5523 }
5524
5525 /// Sets all the options, replacing any prior values.
5526 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5527 self.0.options = v.into();
5528 self
5529 }
5530
5531 /// Sends the request.
5532 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5533 (*self.0.stub)
5534 .list_operations(self.0.request, self.0.options)
5535 .await
5536 .map(crate::Response::into_body)
5537 }
5538
5539 /// Streams each page in the collection.
5540 pub fn by_page(
5541 self,
5542 ) -> impl google_cloud_gax::paginator::Paginator<
5543 google_cloud_longrunning::model::ListOperationsResponse,
5544 crate::Error,
5545 > {
5546 use std::clone::Clone;
5547 let token = self.0.request.page_token.clone();
5548 let execute = move |token: String| {
5549 let mut builder = self.clone();
5550 builder.0.request = builder.0.request.set_page_token(token);
5551 builder.send()
5552 };
5553 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5554 }
5555
5556 /// Streams each item in the collection.
5557 pub fn by_item(
5558 self,
5559 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5560 google_cloud_longrunning::model::ListOperationsResponse,
5561 crate::Error,
5562 > {
5563 use google_cloud_gax::paginator::Paginator;
5564 self.by_page().items()
5565 }
5566
5567 /// Sets the value of [name][google_cloud_longrunning::model::ListOperationsRequest::name].
5568 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5569 self.0.request.name = v.into();
5570 self
5571 }
5572
5573 /// Sets the value of [filter][google_cloud_longrunning::model::ListOperationsRequest::filter].
5574 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5575 self.0.request.filter = v.into();
5576 self
5577 }
5578
5579 /// Sets the value of [page_size][google_cloud_longrunning::model::ListOperationsRequest::page_size].
5580 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5581 self.0.request.page_size = v.into();
5582 self
5583 }
5584
5585 /// Sets the value of [page_token][google_cloud_longrunning::model::ListOperationsRequest::page_token].
5586 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5587 self.0.request.page_token = v.into();
5588 self
5589 }
5590
5591 /// Sets the value of [return_partial_success][google_cloud_longrunning::model::ListOperationsRequest::return_partial_success].
5592 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5593 self.0.request.return_partial_success = v.into();
5594 self
5595 }
5596 }
5597
5598 #[doc(hidden)]
5599 impl crate::RequestBuilder for ListOperations {
5600 fn request_options(&mut self) -> &mut crate::RequestOptions {
5601 &mut self.0.options
5602 }
5603 }
5604
5605 /// The request builder for [PolicyTagManagerSerialization::get_operation][crate::client::PolicyTagManagerSerialization::get_operation] calls.
5606 ///
5607 /// # Example
5608 /// ```
5609 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::GetOperation;
5610 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5611 ///
5612 /// let builder = prepare_request_builder();
5613 /// let response = builder.send().await?;
5614 /// # Ok(()) }
5615 ///
5616 /// fn prepare_request_builder() -> GetOperation {
5617 /// # panic!();
5618 /// // ... details omitted ...
5619 /// }
5620 /// ```
5621 #[derive(Clone, Debug)]
5622 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5623
5624 impl GetOperation {
5625 pub(crate) fn new(
5626 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5627 ) -> Self {
5628 Self(RequestBuilder::new(stub))
5629 }
5630
5631 /// Sets the full request, replacing any prior values.
5632 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5633 mut self,
5634 v: V,
5635 ) -> Self {
5636 self.0.request = v.into();
5637 self
5638 }
5639
5640 /// Sets all the options, replacing any prior values.
5641 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5642 self.0.options = v.into();
5643 self
5644 }
5645
5646 /// Sends the request.
5647 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5648 (*self.0.stub)
5649 .get_operation(self.0.request, self.0.options)
5650 .await
5651 .map(crate::Response::into_body)
5652 }
5653
5654 /// Sets the value of [name][google_cloud_longrunning::model::GetOperationRequest::name].
5655 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5656 self.0.request.name = v.into();
5657 self
5658 }
5659 }
5660
5661 #[doc(hidden)]
5662 impl crate::RequestBuilder for GetOperation {
5663 fn request_options(&mut self) -> &mut crate::RequestOptions {
5664 &mut self.0.options
5665 }
5666 }
5667
5668 /// The request builder for [PolicyTagManagerSerialization::delete_operation][crate::client::PolicyTagManagerSerialization::delete_operation] calls.
5669 ///
5670 /// # Example
5671 /// ```
5672 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::DeleteOperation;
5673 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5674 ///
5675 /// let builder = prepare_request_builder();
5676 /// let response = builder.send().await?;
5677 /// # Ok(()) }
5678 ///
5679 /// fn prepare_request_builder() -> DeleteOperation {
5680 /// # panic!();
5681 /// // ... details omitted ...
5682 /// }
5683 /// ```
5684 #[derive(Clone, Debug)]
5685 pub struct DeleteOperation(
5686 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5687 );
5688
5689 impl DeleteOperation {
5690 pub(crate) fn new(
5691 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5692 ) -> Self {
5693 Self(RequestBuilder::new(stub))
5694 }
5695
5696 /// Sets the full request, replacing any prior values.
5697 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5698 mut self,
5699 v: V,
5700 ) -> Self {
5701 self.0.request = v.into();
5702 self
5703 }
5704
5705 /// Sets all the options, replacing any prior values.
5706 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5707 self.0.options = v.into();
5708 self
5709 }
5710
5711 /// Sends the request.
5712 pub async fn send(self) -> Result<()> {
5713 (*self.0.stub)
5714 .delete_operation(self.0.request, self.0.options)
5715 .await
5716 .map(crate::Response::into_body)
5717 }
5718
5719 /// Sets the value of [name][google_cloud_longrunning::model::DeleteOperationRequest::name].
5720 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5721 self.0.request.name = v.into();
5722 self
5723 }
5724 }
5725
5726 #[doc(hidden)]
5727 impl crate::RequestBuilder for DeleteOperation {
5728 fn request_options(&mut self) -> &mut crate::RequestOptions {
5729 &mut self.0.options
5730 }
5731 }
5732
5733 /// The request builder for [PolicyTagManagerSerialization::cancel_operation][crate::client::PolicyTagManagerSerialization::cancel_operation] calls.
5734 ///
5735 /// # Example
5736 /// ```
5737 /// # use google_cloud_datacatalog_v1::builder::policy_tag_manager_serialization::CancelOperation;
5738 /// # async fn sample() -> google_cloud_datacatalog_v1::Result<()> {
5739 ///
5740 /// let builder = prepare_request_builder();
5741 /// let response = builder.send().await?;
5742 /// # Ok(()) }
5743 ///
5744 /// fn prepare_request_builder() -> CancelOperation {
5745 /// # panic!();
5746 /// // ... details omitted ...
5747 /// }
5748 /// ```
5749 #[derive(Clone, Debug)]
5750 pub struct CancelOperation(
5751 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5752 );
5753
5754 impl CancelOperation {
5755 pub(crate) fn new(
5756 stub: std::sync::Arc<dyn super::super::stub::dynamic::PolicyTagManagerSerialization>,
5757 ) -> Self {
5758 Self(RequestBuilder::new(stub))
5759 }
5760
5761 /// Sets the full request, replacing any prior values.
5762 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5763 mut self,
5764 v: V,
5765 ) -> Self {
5766 self.0.request = v.into();
5767 self
5768 }
5769
5770 /// Sets all the options, replacing any prior values.
5771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5772 self.0.options = v.into();
5773 self
5774 }
5775
5776 /// Sends the request.
5777 pub async fn send(self) -> Result<()> {
5778 (*self.0.stub)
5779 .cancel_operation(self.0.request, self.0.options)
5780 .await
5781 .map(crate::Response::into_body)
5782 }
5783
5784 /// Sets the value of [name][google_cloud_longrunning::model::CancelOperationRequest::name].
5785 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5786 self.0.request.name = v.into();
5787 self
5788 }
5789 }
5790
5791 #[doc(hidden)]
5792 impl crate::RequestBuilder for CancelOperation {
5793 fn request_options(&mut self) -> &mut crate::RequestOptions {
5794 &mut self.0.options
5795 }
5796 }
5797}