1pub mod logging_service_v_2 {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::LoggingServiceV2;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = LoggingServiceV2;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct DeleteLog(RequestBuilder<crate::model::DeleteLogRequest>);
92
93 impl DeleteLog {
94 pub(crate) fn new(
95 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
96 ) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::DeleteLogRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<()> {
114 (*self.0.stub)
115 .delete_log(self.0.request, self.0.options)
116 .await
117 .map(gax::response::Response::into_body)
118 }
119
120 pub fn set_log_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
124 self.0.request.log_name = v.into();
125 self
126 }
127 }
128
129 #[doc(hidden)]
130 impl gax::options::internal::RequestBuilder for DeleteLog {
131 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
132 &mut self.0.options
133 }
134 }
135
136 #[derive(Clone, Debug)]
153 pub struct WriteLogEntries(RequestBuilder<crate::model::WriteLogEntriesRequest>);
154
155 impl WriteLogEntries {
156 pub(crate) fn new(
157 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
158 ) -> Self {
159 Self(RequestBuilder::new(stub))
160 }
161
162 pub fn with_request<V: Into<crate::model::WriteLogEntriesRequest>>(mut self, v: V) -> Self {
164 self.0.request = v.into();
165 self
166 }
167
168 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
170 self.0.options = v.into();
171 self
172 }
173
174 pub async fn send(self) -> Result<crate::model::WriteLogEntriesResponse> {
176 (*self.0.stub)
177 .write_log_entries(self.0.request, self.0.options)
178 .await
179 .map(gax::response::Response::into_body)
180 }
181
182 pub fn set_log_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
184 self.0.request.log_name = v.into();
185 self
186 }
187
188 pub fn set_resource<T>(mut self, v: T) -> Self
190 where
191 T: std::convert::Into<api::model::MonitoredResource>,
192 {
193 self.0.request.resource = std::option::Option::Some(v.into());
194 self
195 }
196
197 pub fn set_or_clear_resource<T>(mut self, v: std::option::Option<T>) -> Self
199 where
200 T: std::convert::Into<api::model::MonitoredResource>,
201 {
202 self.0.request.resource = v.map(|x| x.into());
203 self
204 }
205
206 pub fn set_labels<T, K, V>(mut self, v: T) -> Self
208 where
209 T: std::iter::IntoIterator<Item = (K, V)>,
210 K: std::convert::Into<std::string::String>,
211 V: std::convert::Into<std::string::String>,
212 {
213 self.0.request.labels = v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
214 self
215 }
216
217 pub fn set_entries<T, V>(mut self, v: T) -> Self
221 where
222 T: std::iter::IntoIterator<Item = V>,
223 V: std::convert::Into<crate::model::LogEntry>,
224 {
225 use std::iter::Iterator;
226 self.0.request.entries = v.into_iter().map(|i| i.into()).collect();
227 self
228 }
229
230 pub fn set_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
232 self.0.request.partial_success = v.into();
233 self
234 }
235
236 pub fn set_dry_run<T: Into<bool>>(mut self, v: T) -> Self {
238 self.0.request.dry_run = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl gax::options::internal::RequestBuilder for WriteLogEntries {
245 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
271 pub struct ListLogEntries(RequestBuilder<crate::model::ListLogEntriesRequest>);
272
273 impl ListLogEntries {
274 pub(crate) fn new(
275 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
276 ) -> Self {
277 Self(RequestBuilder::new(stub))
278 }
279
280 pub fn with_request<V: Into<crate::model::ListLogEntriesRequest>>(mut self, v: V) -> Self {
282 self.0.request = v.into();
283 self
284 }
285
286 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
288 self.0.options = v.into();
289 self
290 }
291
292 pub async fn send(self) -> Result<crate::model::ListLogEntriesResponse> {
294 (*self.0.stub)
295 .list_log_entries(self.0.request, self.0.options)
296 .await
297 .map(gax::response::Response::into_body)
298 }
299
300 pub fn by_page(
302 self,
303 ) -> impl gax::paginator::Paginator<crate::model::ListLogEntriesResponse, gax::error::Error>
304 {
305 use std::clone::Clone;
306 let token = self.0.request.page_token.clone();
307 let execute = move |token: String| {
308 let mut builder = self.clone();
309 builder.0.request = builder.0.request.set_page_token(token);
310 builder.send()
311 };
312 gax::paginator::internal::new_paginator(token, execute)
313 }
314
315 pub fn by_item(
317 self,
318 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLogEntriesResponse, gax::error::Error>
319 {
320 use gax::paginator::Paginator;
321 self.by_page().items()
322 }
323
324 pub fn set_resource_names<T, V>(mut self, v: T) -> Self
328 where
329 T: std::iter::IntoIterator<Item = V>,
330 V: std::convert::Into<std::string::String>,
331 {
332 use std::iter::Iterator;
333 self.0.request.resource_names = v.into_iter().map(|i| i.into()).collect();
334 self
335 }
336
337 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
339 self.0.request.filter = v.into();
340 self
341 }
342
343 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
345 self.0.request.order_by = v.into();
346 self
347 }
348
349 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
351 self.0.request.page_size = v.into();
352 self
353 }
354
355 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
357 self.0.request.page_token = v.into();
358 self
359 }
360 }
361
362 #[doc(hidden)]
363 impl gax::options::internal::RequestBuilder for ListLogEntries {
364 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
365 &mut self.0.options
366 }
367 }
368
369 #[derive(Clone, Debug)]
390 pub struct ListMonitoredResourceDescriptors(
391 RequestBuilder<crate::model::ListMonitoredResourceDescriptorsRequest>,
392 );
393
394 impl ListMonitoredResourceDescriptors {
395 pub(crate) fn new(
396 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
397 ) -> Self {
398 Self(RequestBuilder::new(stub))
399 }
400
401 pub fn with_request<V: Into<crate::model::ListMonitoredResourceDescriptorsRequest>>(
403 mut self,
404 v: V,
405 ) -> Self {
406 self.0.request = v.into();
407 self
408 }
409
410 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
412 self.0.options = v.into();
413 self
414 }
415
416 pub async fn send(self) -> Result<crate::model::ListMonitoredResourceDescriptorsResponse> {
418 (*self.0.stub)
419 .list_monitored_resource_descriptors(self.0.request, self.0.options)
420 .await
421 .map(gax::response::Response::into_body)
422 }
423
424 pub fn by_page(
426 self,
427 ) -> impl gax::paginator::Paginator<
428 crate::model::ListMonitoredResourceDescriptorsResponse,
429 gax::error::Error,
430 > {
431 use std::clone::Clone;
432 let token = self.0.request.page_token.clone();
433 let execute = move |token: String| {
434 let mut builder = self.clone();
435 builder.0.request = builder.0.request.set_page_token(token);
436 builder.send()
437 };
438 gax::paginator::internal::new_paginator(token, execute)
439 }
440
441 pub fn by_item(
443 self,
444 ) -> impl gax::paginator::ItemPaginator<
445 crate::model::ListMonitoredResourceDescriptorsResponse,
446 gax::error::Error,
447 > {
448 use gax::paginator::Paginator;
449 self.by_page().items()
450 }
451
452 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
454 self.0.request.page_size = v.into();
455 self
456 }
457
458 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
460 self.0.request.page_token = v.into();
461 self
462 }
463 }
464
465 #[doc(hidden)]
466 impl gax::options::internal::RequestBuilder for ListMonitoredResourceDescriptors {
467 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
468 &mut self.0.options
469 }
470 }
471
472 #[derive(Clone, Debug)]
489 pub struct ListLogs(RequestBuilder<crate::model::ListLogsRequest>);
490
491 impl ListLogs {
492 pub(crate) fn new(
493 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
494 ) -> Self {
495 Self(RequestBuilder::new(stub))
496 }
497
498 pub fn with_request<V: Into<crate::model::ListLogsRequest>>(mut self, v: V) -> Self {
500 self.0.request = v.into();
501 self
502 }
503
504 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
506 self.0.options = v.into();
507 self
508 }
509
510 pub async fn send(self) -> Result<crate::model::ListLogsResponse> {
512 (*self.0.stub)
513 .list_logs(self.0.request, self.0.options)
514 .await
515 .map(gax::response::Response::into_body)
516 }
517
518 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
522 self.0.request.parent = v.into();
523 self
524 }
525
526 pub fn set_resource_names<T, V>(mut self, v: T) -> Self
528 where
529 T: std::iter::IntoIterator<Item = V>,
530 V: std::convert::Into<std::string::String>,
531 {
532 use std::iter::Iterator;
533 self.0.request.resource_names = v.into_iter().map(|i| i.into()).collect();
534 self
535 }
536
537 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
539 self.0.request.page_size = v.into();
540 self
541 }
542
543 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
545 self.0.request.page_token = v.into();
546 self
547 }
548 }
549
550 #[doc(hidden)]
551 impl gax::options::internal::RequestBuilder for ListLogs {
552 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
553 &mut self.0.options
554 }
555 }
556
557 #[derive(Clone, Debug)]
578 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
579
580 impl ListOperations {
581 pub(crate) fn new(
582 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
583 ) -> Self {
584 Self(RequestBuilder::new(stub))
585 }
586
587 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
589 mut self,
590 v: V,
591 ) -> Self {
592 self.0.request = v.into();
593 self
594 }
595
596 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
598 self.0.options = v.into();
599 self
600 }
601
602 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
604 (*self.0.stub)
605 .list_operations(self.0.request, self.0.options)
606 .await
607 .map(gax::response::Response::into_body)
608 }
609
610 pub fn by_page(
612 self,
613 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
614 {
615 use std::clone::Clone;
616 let token = self.0.request.page_token.clone();
617 let execute = move |token: String| {
618 let mut builder = self.clone();
619 builder.0.request = builder.0.request.set_page_token(token);
620 builder.send()
621 };
622 gax::paginator::internal::new_paginator(token, execute)
623 }
624
625 pub fn by_item(
627 self,
628 ) -> impl gax::paginator::ItemPaginator<
629 longrunning::model::ListOperationsResponse,
630 gax::error::Error,
631 > {
632 use gax::paginator::Paginator;
633 self.by_page().items()
634 }
635
636 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
638 self.0.request.name = v.into();
639 self
640 }
641
642 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
644 self.0.request.filter = v.into();
645 self
646 }
647
648 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
650 self.0.request.page_size = v.into();
651 self
652 }
653
654 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
656 self.0.request.page_token = v.into();
657 self
658 }
659
660 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
662 self.0.request.return_partial_success = v.into();
663 self
664 }
665 }
666
667 #[doc(hidden)]
668 impl gax::options::internal::RequestBuilder for ListOperations {
669 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
670 &mut self.0.options
671 }
672 }
673
674 #[derive(Clone, Debug)]
691 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
692
693 impl GetOperation {
694 pub(crate) fn new(
695 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
696 ) -> Self {
697 Self(RequestBuilder::new(stub))
698 }
699
700 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
702 mut self,
703 v: V,
704 ) -> Self {
705 self.0.request = v.into();
706 self
707 }
708
709 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
711 self.0.options = v.into();
712 self
713 }
714
715 pub async fn send(self) -> Result<longrunning::model::Operation> {
717 (*self.0.stub)
718 .get_operation(self.0.request, self.0.options)
719 .await
720 .map(gax::response::Response::into_body)
721 }
722
723 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
725 self.0.request.name = v.into();
726 self
727 }
728 }
729
730 #[doc(hidden)]
731 impl gax::options::internal::RequestBuilder for GetOperation {
732 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
733 &mut self.0.options
734 }
735 }
736
737 #[derive(Clone, Debug)]
754 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
755
756 impl CancelOperation {
757 pub(crate) fn new(
758 stub: std::sync::Arc<dyn super::super::stub::dynamic::LoggingServiceV2>,
759 ) -> Self {
760 Self(RequestBuilder::new(stub))
761 }
762
763 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
765 mut self,
766 v: V,
767 ) -> Self {
768 self.0.request = v.into();
769 self
770 }
771
772 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
774 self.0.options = v.into();
775 self
776 }
777
778 pub async fn send(self) -> Result<()> {
780 (*self.0.stub)
781 .cancel_operation(self.0.request, self.0.options)
782 .await
783 .map(gax::response::Response::into_body)
784 }
785
786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
788 self.0.request.name = v.into();
789 self
790 }
791 }
792
793 #[doc(hidden)]
794 impl gax::options::internal::RequestBuilder for CancelOperation {
795 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
796 &mut self.0.options
797 }
798 }
799}
800
801pub mod config_service_v_2 {
802 use crate::Result;
803
804 pub type ClientBuilder =
818 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
819
820 pub(crate) mod client {
821 use super::super::super::client::ConfigServiceV2;
822 pub struct Factory;
823 impl gax::client_builder::internal::ClientFactory for Factory {
824 type Client = ConfigServiceV2;
825 type Credentials = gaxi::options::Credentials;
826 async fn build(
827 self,
828 config: gaxi::options::ClientConfig,
829 ) -> gax::client_builder::Result<Self::Client> {
830 Self::Client::new(config).await
831 }
832 }
833 }
834
835 #[derive(Clone, Debug)]
837 pub(crate) struct RequestBuilder<R: std::default::Default> {
838 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
839 request: R,
840 options: gax::options::RequestOptions,
841 }
842
843 impl<R> RequestBuilder<R>
844 where
845 R: std::default::Default,
846 {
847 pub(crate) fn new(
848 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
849 ) -> Self {
850 Self {
851 stub,
852 request: R::default(),
853 options: gax::options::RequestOptions::default(),
854 }
855 }
856 }
857
858 #[derive(Clone, Debug)]
879 pub struct ListBuckets(RequestBuilder<crate::model::ListBucketsRequest>);
880
881 impl ListBuckets {
882 pub(crate) fn new(
883 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
884 ) -> Self {
885 Self(RequestBuilder::new(stub))
886 }
887
888 pub fn with_request<V: Into<crate::model::ListBucketsRequest>>(mut self, v: V) -> Self {
890 self.0.request = v.into();
891 self
892 }
893
894 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
896 self.0.options = v.into();
897 self
898 }
899
900 pub async fn send(self) -> Result<crate::model::ListBucketsResponse> {
902 (*self.0.stub)
903 .list_buckets(self.0.request, self.0.options)
904 .await
905 .map(gax::response::Response::into_body)
906 }
907
908 pub fn by_page(
910 self,
911 ) -> impl gax::paginator::Paginator<crate::model::ListBucketsResponse, gax::error::Error>
912 {
913 use std::clone::Clone;
914 let token = self.0.request.page_token.clone();
915 let execute = move |token: String| {
916 let mut builder = self.clone();
917 builder.0.request = builder.0.request.set_page_token(token);
918 builder.send()
919 };
920 gax::paginator::internal::new_paginator(token, execute)
921 }
922
923 pub fn by_item(
925 self,
926 ) -> impl gax::paginator::ItemPaginator<crate::model::ListBucketsResponse, gax::error::Error>
927 {
928 use gax::paginator::Paginator;
929 self.by_page().items()
930 }
931
932 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
936 self.0.request.parent = v.into();
937 self
938 }
939
940 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
942 self.0.request.page_token = v.into();
943 self
944 }
945
946 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
948 self.0.request.page_size = v.into();
949 self
950 }
951 }
952
953 #[doc(hidden)]
954 impl gax::options::internal::RequestBuilder for ListBuckets {
955 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
956 &mut self.0.options
957 }
958 }
959
960 #[derive(Clone, Debug)]
977 pub struct GetBucket(RequestBuilder<crate::model::GetBucketRequest>);
978
979 impl GetBucket {
980 pub(crate) fn new(
981 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
982 ) -> Self {
983 Self(RequestBuilder::new(stub))
984 }
985
986 pub fn with_request<V: Into<crate::model::GetBucketRequest>>(mut self, v: V) -> Self {
988 self.0.request = v.into();
989 self
990 }
991
992 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
994 self.0.options = v.into();
995 self
996 }
997
998 pub async fn send(self) -> Result<crate::model::LogBucket> {
1000 (*self.0.stub)
1001 .get_bucket(self.0.request, self.0.options)
1002 .await
1003 .map(gax::response::Response::into_body)
1004 }
1005
1006 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1010 self.0.request.name = v.into();
1011 self
1012 }
1013 }
1014
1015 #[doc(hidden)]
1016 impl gax::options::internal::RequestBuilder for GetBucket {
1017 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1018 &mut self.0.options
1019 }
1020 }
1021
1022 #[derive(Clone, Debug)]
1040 pub struct CreateBucketAsync(RequestBuilder<crate::model::CreateBucketRequest>);
1041
1042 impl CreateBucketAsync {
1043 pub(crate) fn new(
1044 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1045 ) -> Self {
1046 Self(RequestBuilder::new(stub))
1047 }
1048
1049 pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
1051 self.0.request = v.into();
1052 self
1053 }
1054
1055 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1057 self.0.options = v.into();
1058 self
1059 }
1060
1061 pub async fn send(self) -> Result<longrunning::model::Operation> {
1068 (*self.0.stub)
1069 .create_bucket_async(self.0.request, self.0.options)
1070 .await
1071 .map(gax::response::Response::into_body)
1072 }
1073
1074 pub fn poller(
1076 self,
1077 ) -> impl lro::Poller<crate::model::LogBucket, crate::model::BucketMetadata> {
1078 type Operation =
1079 lro::internal::Operation<crate::model::LogBucket, crate::model::BucketMetadata>;
1080 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1081 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1082
1083 let stub = self.0.stub.clone();
1084 let mut options = self.0.options.clone();
1085 options.set_retry_policy(gax::retry_policy::NeverRetry);
1086 let query = move |name| {
1087 let stub = stub.clone();
1088 let options = options.clone();
1089 async {
1090 let op = GetOperation::new(stub)
1091 .set_name(name)
1092 .with_options(options)
1093 .send()
1094 .await?;
1095 Ok(Operation::new(op))
1096 }
1097 };
1098
1099 let start = move || async {
1100 let op = self.send().await?;
1101 Ok(Operation::new(op))
1102 };
1103
1104 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1105 }
1106
1107 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1111 self.0.request.parent = v.into();
1112 self
1113 }
1114
1115 pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1119 self.0.request.bucket_id = v.into();
1120 self
1121 }
1122
1123 pub fn set_bucket<T>(mut self, v: T) -> Self
1127 where
1128 T: std::convert::Into<crate::model::LogBucket>,
1129 {
1130 self.0.request.bucket = std::option::Option::Some(v.into());
1131 self
1132 }
1133
1134 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
1138 where
1139 T: std::convert::Into<crate::model::LogBucket>,
1140 {
1141 self.0.request.bucket = v.map(|x| x.into());
1142 self
1143 }
1144 }
1145
1146 #[doc(hidden)]
1147 impl gax::options::internal::RequestBuilder for CreateBucketAsync {
1148 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1149 &mut self.0.options
1150 }
1151 }
1152
1153 #[derive(Clone, Debug)]
1171 pub struct UpdateBucketAsync(RequestBuilder<crate::model::UpdateBucketRequest>);
1172
1173 impl UpdateBucketAsync {
1174 pub(crate) fn new(
1175 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1176 ) -> Self {
1177 Self(RequestBuilder::new(stub))
1178 }
1179
1180 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
1182 self.0.request = v.into();
1183 self
1184 }
1185
1186 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1188 self.0.options = v.into();
1189 self
1190 }
1191
1192 pub async fn send(self) -> Result<longrunning::model::Operation> {
1199 (*self.0.stub)
1200 .update_bucket_async(self.0.request, self.0.options)
1201 .await
1202 .map(gax::response::Response::into_body)
1203 }
1204
1205 pub fn poller(
1207 self,
1208 ) -> impl lro::Poller<crate::model::LogBucket, crate::model::BucketMetadata> {
1209 type Operation =
1210 lro::internal::Operation<crate::model::LogBucket, crate::model::BucketMetadata>;
1211 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1212 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1213
1214 let stub = self.0.stub.clone();
1215 let mut options = self.0.options.clone();
1216 options.set_retry_policy(gax::retry_policy::NeverRetry);
1217 let query = move |name| {
1218 let stub = stub.clone();
1219 let options = options.clone();
1220 async {
1221 let op = GetOperation::new(stub)
1222 .set_name(name)
1223 .with_options(options)
1224 .send()
1225 .await?;
1226 Ok(Operation::new(op))
1227 }
1228 };
1229
1230 let start = move || async {
1231 let op = self.send().await?;
1232 Ok(Operation::new(op))
1233 };
1234
1235 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
1236 }
1237
1238 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1242 self.0.request.name = v.into();
1243 self
1244 }
1245
1246 pub fn set_bucket<T>(mut self, v: T) -> Self
1250 where
1251 T: std::convert::Into<crate::model::LogBucket>,
1252 {
1253 self.0.request.bucket = std::option::Option::Some(v.into());
1254 self
1255 }
1256
1257 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
1261 where
1262 T: std::convert::Into<crate::model::LogBucket>,
1263 {
1264 self.0.request.bucket = v.map(|x| x.into());
1265 self
1266 }
1267
1268 pub fn set_update_mask<T>(mut self, v: T) -> Self
1272 where
1273 T: std::convert::Into<wkt::FieldMask>,
1274 {
1275 self.0.request.update_mask = std::option::Option::Some(v.into());
1276 self
1277 }
1278
1279 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1283 where
1284 T: std::convert::Into<wkt::FieldMask>,
1285 {
1286 self.0.request.update_mask = v.map(|x| x.into());
1287 self
1288 }
1289 }
1290
1291 #[doc(hidden)]
1292 impl gax::options::internal::RequestBuilder for UpdateBucketAsync {
1293 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1294 &mut self.0.options
1295 }
1296 }
1297
1298 #[derive(Clone, Debug)]
1315 pub struct CreateBucket(RequestBuilder<crate::model::CreateBucketRequest>);
1316
1317 impl CreateBucket {
1318 pub(crate) fn new(
1319 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1320 ) -> Self {
1321 Self(RequestBuilder::new(stub))
1322 }
1323
1324 pub fn with_request<V: Into<crate::model::CreateBucketRequest>>(mut self, v: V) -> Self {
1326 self.0.request = v.into();
1327 self
1328 }
1329
1330 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1332 self.0.options = v.into();
1333 self
1334 }
1335
1336 pub async fn send(self) -> Result<crate::model::LogBucket> {
1338 (*self.0.stub)
1339 .create_bucket(self.0.request, self.0.options)
1340 .await
1341 .map(gax::response::Response::into_body)
1342 }
1343
1344 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1348 self.0.request.parent = v.into();
1349 self
1350 }
1351
1352 pub fn set_bucket_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1356 self.0.request.bucket_id = v.into();
1357 self
1358 }
1359
1360 pub fn set_bucket<T>(mut self, v: T) -> Self
1364 where
1365 T: std::convert::Into<crate::model::LogBucket>,
1366 {
1367 self.0.request.bucket = std::option::Option::Some(v.into());
1368 self
1369 }
1370
1371 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
1375 where
1376 T: std::convert::Into<crate::model::LogBucket>,
1377 {
1378 self.0.request.bucket = v.map(|x| x.into());
1379 self
1380 }
1381 }
1382
1383 #[doc(hidden)]
1384 impl gax::options::internal::RequestBuilder for CreateBucket {
1385 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1386 &mut self.0.options
1387 }
1388 }
1389
1390 #[derive(Clone, Debug)]
1407 pub struct UpdateBucket(RequestBuilder<crate::model::UpdateBucketRequest>);
1408
1409 impl UpdateBucket {
1410 pub(crate) fn new(
1411 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1412 ) -> Self {
1413 Self(RequestBuilder::new(stub))
1414 }
1415
1416 pub fn with_request<V: Into<crate::model::UpdateBucketRequest>>(mut self, v: V) -> Self {
1418 self.0.request = v.into();
1419 self
1420 }
1421
1422 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1424 self.0.options = v.into();
1425 self
1426 }
1427
1428 pub async fn send(self) -> Result<crate::model::LogBucket> {
1430 (*self.0.stub)
1431 .update_bucket(self.0.request, self.0.options)
1432 .await
1433 .map(gax::response::Response::into_body)
1434 }
1435
1436 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1440 self.0.request.name = v.into();
1441 self
1442 }
1443
1444 pub fn set_bucket<T>(mut self, v: T) -> Self
1448 where
1449 T: std::convert::Into<crate::model::LogBucket>,
1450 {
1451 self.0.request.bucket = std::option::Option::Some(v.into());
1452 self
1453 }
1454
1455 pub fn set_or_clear_bucket<T>(mut self, v: std::option::Option<T>) -> Self
1459 where
1460 T: std::convert::Into<crate::model::LogBucket>,
1461 {
1462 self.0.request.bucket = v.map(|x| x.into());
1463 self
1464 }
1465
1466 pub fn set_update_mask<T>(mut self, v: T) -> Self
1470 where
1471 T: std::convert::Into<wkt::FieldMask>,
1472 {
1473 self.0.request.update_mask = std::option::Option::Some(v.into());
1474 self
1475 }
1476
1477 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1481 where
1482 T: std::convert::Into<wkt::FieldMask>,
1483 {
1484 self.0.request.update_mask = v.map(|x| x.into());
1485 self
1486 }
1487 }
1488
1489 #[doc(hidden)]
1490 impl gax::options::internal::RequestBuilder for UpdateBucket {
1491 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1492 &mut self.0.options
1493 }
1494 }
1495
1496 #[derive(Clone, Debug)]
1513 pub struct DeleteBucket(RequestBuilder<crate::model::DeleteBucketRequest>);
1514
1515 impl DeleteBucket {
1516 pub(crate) fn new(
1517 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1518 ) -> Self {
1519 Self(RequestBuilder::new(stub))
1520 }
1521
1522 pub fn with_request<V: Into<crate::model::DeleteBucketRequest>>(mut self, v: V) -> Self {
1524 self.0.request = v.into();
1525 self
1526 }
1527
1528 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1530 self.0.options = v.into();
1531 self
1532 }
1533
1534 pub async fn send(self) -> Result<()> {
1536 (*self.0.stub)
1537 .delete_bucket(self.0.request, self.0.options)
1538 .await
1539 .map(gax::response::Response::into_body)
1540 }
1541
1542 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1546 self.0.request.name = v.into();
1547 self
1548 }
1549 }
1550
1551 #[doc(hidden)]
1552 impl gax::options::internal::RequestBuilder for DeleteBucket {
1553 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1554 &mut self.0.options
1555 }
1556 }
1557
1558 #[derive(Clone, Debug)]
1575 pub struct UndeleteBucket(RequestBuilder<crate::model::UndeleteBucketRequest>);
1576
1577 impl UndeleteBucket {
1578 pub(crate) fn new(
1579 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1580 ) -> Self {
1581 Self(RequestBuilder::new(stub))
1582 }
1583
1584 pub fn with_request<V: Into<crate::model::UndeleteBucketRequest>>(mut self, v: V) -> Self {
1586 self.0.request = v.into();
1587 self
1588 }
1589
1590 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1592 self.0.options = v.into();
1593 self
1594 }
1595
1596 pub async fn send(self) -> Result<()> {
1598 (*self.0.stub)
1599 .undelete_bucket(self.0.request, self.0.options)
1600 .await
1601 .map(gax::response::Response::into_body)
1602 }
1603
1604 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1608 self.0.request.name = v.into();
1609 self
1610 }
1611 }
1612
1613 #[doc(hidden)]
1614 impl gax::options::internal::RequestBuilder for UndeleteBucket {
1615 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1616 &mut self.0.options
1617 }
1618 }
1619
1620 #[derive(Clone, Debug)]
1641 pub struct ListViews(RequestBuilder<crate::model::ListViewsRequest>);
1642
1643 impl ListViews {
1644 pub(crate) fn new(
1645 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1646 ) -> Self {
1647 Self(RequestBuilder::new(stub))
1648 }
1649
1650 pub fn with_request<V: Into<crate::model::ListViewsRequest>>(mut self, v: V) -> Self {
1652 self.0.request = v.into();
1653 self
1654 }
1655
1656 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1658 self.0.options = v.into();
1659 self
1660 }
1661
1662 pub async fn send(self) -> Result<crate::model::ListViewsResponse> {
1664 (*self.0.stub)
1665 .list_views(self.0.request, self.0.options)
1666 .await
1667 .map(gax::response::Response::into_body)
1668 }
1669
1670 pub fn by_page(
1672 self,
1673 ) -> impl gax::paginator::Paginator<crate::model::ListViewsResponse, gax::error::Error>
1674 {
1675 use std::clone::Clone;
1676 let token = self.0.request.page_token.clone();
1677 let execute = move |token: String| {
1678 let mut builder = self.clone();
1679 builder.0.request = builder.0.request.set_page_token(token);
1680 builder.send()
1681 };
1682 gax::paginator::internal::new_paginator(token, execute)
1683 }
1684
1685 pub fn by_item(
1687 self,
1688 ) -> impl gax::paginator::ItemPaginator<crate::model::ListViewsResponse, gax::error::Error>
1689 {
1690 use gax::paginator::Paginator;
1691 self.by_page().items()
1692 }
1693
1694 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1698 self.0.request.parent = v.into();
1699 self
1700 }
1701
1702 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1704 self.0.request.page_token = v.into();
1705 self
1706 }
1707
1708 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1710 self.0.request.page_size = v.into();
1711 self
1712 }
1713 }
1714
1715 #[doc(hidden)]
1716 impl gax::options::internal::RequestBuilder for ListViews {
1717 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1718 &mut self.0.options
1719 }
1720 }
1721
1722 #[derive(Clone, Debug)]
1739 pub struct GetView(RequestBuilder<crate::model::GetViewRequest>);
1740
1741 impl GetView {
1742 pub(crate) fn new(
1743 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1744 ) -> Self {
1745 Self(RequestBuilder::new(stub))
1746 }
1747
1748 pub fn with_request<V: Into<crate::model::GetViewRequest>>(mut self, v: V) -> Self {
1750 self.0.request = v.into();
1751 self
1752 }
1753
1754 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1756 self.0.options = v.into();
1757 self
1758 }
1759
1760 pub async fn send(self) -> Result<crate::model::LogView> {
1762 (*self.0.stub)
1763 .get_view(self.0.request, self.0.options)
1764 .await
1765 .map(gax::response::Response::into_body)
1766 }
1767
1768 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1772 self.0.request.name = v.into();
1773 self
1774 }
1775 }
1776
1777 #[doc(hidden)]
1778 impl gax::options::internal::RequestBuilder for GetView {
1779 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1780 &mut self.0.options
1781 }
1782 }
1783
1784 #[derive(Clone, Debug)]
1801 pub struct CreateView(RequestBuilder<crate::model::CreateViewRequest>);
1802
1803 impl CreateView {
1804 pub(crate) fn new(
1805 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1806 ) -> Self {
1807 Self(RequestBuilder::new(stub))
1808 }
1809
1810 pub fn with_request<V: Into<crate::model::CreateViewRequest>>(mut self, v: V) -> Self {
1812 self.0.request = v.into();
1813 self
1814 }
1815
1816 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1818 self.0.options = v.into();
1819 self
1820 }
1821
1822 pub async fn send(self) -> Result<crate::model::LogView> {
1824 (*self.0.stub)
1825 .create_view(self.0.request, self.0.options)
1826 .await
1827 .map(gax::response::Response::into_body)
1828 }
1829
1830 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1834 self.0.request.parent = v.into();
1835 self
1836 }
1837
1838 pub fn set_view_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1842 self.0.request.view_id = v.into();
1843 self
1844 }
1845
1846 pub fn set_view<T>(mut self, v: T) -> Self
1850 where
1851 T: std::convert::Into<crate::model::LogView>,
1852 {
1853 self.0.request.view = std::option::Option::Some(v.into());
1854 self
1855 }
1856
1857 pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
1861 where
1862 T: std::convert::Into<crate::model::LogView>,
1863 {
1864 self.0.request.view = v.map(|x| x.into());
1865 self
1866 }
1867 }
1868
1869 #[doc(hidden)]
1870 impl gax::options::internal::RequestBuilder for CreateView {
1871 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1872 &mut self.0.options
1873 }
1874 }
1875
1876 #[derive(Clone, Debug)]
1893 pub struct UpdateView(RequestBuilder<crate::model::UpdateViewRequest>);
1894
1895 impl UpdateView {
1896 pub(crate) fn new(
1897 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
1898 ) -> Self {
1899 Self(RequestBuilder::new(stub))
1900 }
1901
1902 pub fn with_request<V: Into<crate::model::UpdateViewRequest>>(mut self, v: V) -> Self {
1904 self.0.request = v.into();
1905 self
1906 }
1907
1908 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1910 self.0.options = v.into();
1911 self
1912 }
1913
1914 pub async fn send(self) -> Result<crate::model::LogView> {
1916 (*self.0.stub)
1917 .update_view(self.0.request, self.0.options)
1918 .await
1919 .map(gax::response::Response::into_body)
1920 }
1921
1922 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1926 self.0.request.name = v.into();
1927 self
1928 }
1929
1930 pub fn set_view<T>(mut self, v: T) -> Self
1934 where
1935 T: std::convert::Into<crate::model::LogView>,
1936 {
1937 self.0.request.view = std::option::Option::Some(v.into());
1938 self
1939 }
1940
1941 pub fn set_or_clear_view<T>(mut self, v: std::option::Option<T>) -> Self
1945 where
1946 T: std::convert::Into<crate::model::LogView>,
1947 {
1948 self.0.request.view = v.map(|x| x.into());
1949 self
1950 }
1951
1952 pub fn set_update_mask<T>(mut self, v: T) -> Self
1954 where
1955 T: std::convert::Into<wkt::FieldMask>,
1956 {
1957 self.0.request.update_mask = std::option::Option::Some(v.into());
1958 self
1959 }
1960
1961 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1963 where
1964 T: std::convert::Into<wkt::FieldMask>,
1965 {
1966 self.0.request.update_mask = v.map(|x| x.into());
1967 self
1968 }
1969 }
1970
1971 #[doc(hidden)]
1972 impl gax::options::internal::RequestBuilder for UpdateView {
1973 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1974 &mut self.0.options
1975 }
1976 }
1977
1978 #[derive(Clone, Debug)]
1995 pub struct DeleteView(RequestBuilder<crate::model::DeleteViewRequest>);
1996
1997 impl DeleteView {
1998 pub(crate) fn new(
1999 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2000 ) -> Self {
2001 Self(RequestBuilder::new(stub))
2002 }
2003
2004 pub fn with_request<V: Into<crate::model::DeleteViewRequest>>(mut self, v: V) -> Self {
2006 self.0.request = v.into();
2007 self
2008 }
2009
2010 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2012 self.0.options = v.into();
2013 self
2014 }
2015
2016 pub async fn send(self) -> Result<()> {
2018 (*self.0.stub)
2019 .delete_view(self.0.request, self.0.options)
2020 .await
2021 .map(gax::response::Response::into_body)
2022 }
2023
2024 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2028 self.0.request.name = v.into();
2029 self
2030 }
2031 }
2032
2033 #[doc(hidden)]
2034 impl gax::options::internal::RequestBuilder for DeleteView {
2035 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2036 &mut self.0.options
2037 }
2038 }
2039
2040 #[derive(Clone, Debug)]
2061 pub struct ListSinks(RequestBuilder<crate::model::ListSinksRequest>);
2062
2063 impl ListSinks {
2064 pub(crate) fn new(
2065 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2066 ) -> Self {
2067 Self(RequestBuilder::new(stub))
2068 }
2069
2070 pub fn with_request<V: Into<crate::model::ListSinksRequest>>(mut self, v: V) -> Self {
2072 self.0.request = v.into();
2073 self
2074 }
2075
2076 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2078 self.0.options = v.into();
2079 self
2080 }
2081
2082 pub async fn send(self) -> Result<crate::model::ListSinksResponse> {
2084 (*self.0.stub)
2085 .list_sinks(self.0.request, self.0.options)
2086 .await
2087 .map(gax::response::Response::into_body)
2088 }
2089
2090 pub fn by_page(
2092 self,
2093 ) -> impl gax::paginator::Paginator<crate::model::ListSinksResponse, gax::error::Error>
2094 {
2095 use std::clone::Clone;
2096 let token = self.0.request.page_token.clone();
2097 let execute = move |token: String| {
2098 let mut builder = self.clone();
2099 builder.0.request = builder.0.request.set_page_token(token);
2100 builder.send()
2101 };
2102 gax::paginator::internal::new_paginator(token, execute)
2103 }
2104
2105 pub fn by_item(
2107 self,
2108 ) -> impl gax::paginator::ItemPaginator<crate::model::ListSinksResponse, gax::error::Error>
2109 {
2110 use gax::paginator::Paginator;
2111 self.by_page().items()
2112 }
2113
2114 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2118 self.0.request.parent = v.into();
2119 self
2120 }
2121
2122 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2124 self.0.request.page_token = v.into();
2125 self
2126 }
2127
2128 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2130 self.0.request.page_size = v.into();
2131 self
2132 }
2133 }
2134
2135 #[doc(hidden)]
2136 impl gax::options::internal::RequestBuilder for ListSinks {
2137 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2138 &mut self.0.options
2139 }
2140 }
2141
2142 #[derive(Clone, Debug)]
2159 pub struct GetSink(RequestBuilder<crate::model::GetSinkRequest>);
2160
2161 impl GetSink {
2162 pub(crate) fn new(
2163 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2164 ) -> Self {
2165 Self(RequestBuilder::new(stub))
2166 }
2167
2168 pub fn with_request<V: Into<crate::model::GetSinkRequest>>(mut self, v: V) -> Self {
2170 self.0.request = v.into();
2171 self
2172 }
2173
2174 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2176 self.0.options = v.into();
2177 self
2178 }
2179
2180 pub async fn send(self) -> Result<crate::model::LogSink> {
2182 (*self.0.stub)
2183 .get_sink(self.0.request, self.0.options)
2184 .await
2185 .map(gax::response::Response::into_body)
2186 }
2187
2188 pub fn set_sink_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2192 self.0.request.sink_name = v.into();
2193 self
2194 }
2195 }
2196
2197 #[doc(hidden)]
2198 impl gax::options::internal::RequestBuilder for GetSink {
2199 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2200 &mut self.0.options
2201 }
2202 }
2203
2204 #[derive(Clone, Debug)]
2221 pub struct CreateSink(RequestBuilder<crate::model::CreateSinkRequest>);
2222
2223 impl CreateSink {
2224 pub(crate) fn new(
2225 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2226 ) -> Self {
2227 Self(RequestBuilder::new(stub))
2228 }
2229
2230 pub fn with_request<V: Into<crate::model::CreateSinkRequest>>(mut self, v: V) -> Self {
2232 self.0.request = v.into();
2233 self
2234 }
2235
2236 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2238 self.0.options = v.into();
2239 self
2240 }
2241
2242 pub async fn send(self) -> Result<crate::model::LogSink> {
2244 (*self.0.stub)
2245 .create_sink(self.0.request, self.0.options)
2246 .await
2247 .map(gax::response::Response::into_body)
2248 }
2249
2250 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2254 self.0.request.parent = v.into();
2255 self
2256 }
2257
2258 pub fn set_sink<T>(mut self, v: T) -> Self
2262 where
2263 T: std::convert::Into<crate::model::LogSink>,
2264 {
2265 self.0.request.sink = std::option::Option::Some(v.into());
2266 self
2267 }
2268
2269 pub fn set_or_clear_sink<T>(mut self, v: std::option::Option<T>) -> Self
2273 where
2274 T: std::convert::Into<crate::model::LogSink>,
2275 {
2276 self.0.request.sink = v.map(|x| x.into());
2277 self
2278 }
2279
2280 pub fn set_unique_writer_identity<T: Into<bool>>(mut self, v: T) -> Self {
2282 self.0.request.unique_writer_identity = v.into();
2283 self
2284 }
2285 }
2286
2287 #[doc(hidden)]
2288 impl gax::options::internal::RequestBuilder for CreateSink {
2289 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2290 &mut self.0.options
2291 }
2292 }
2293
2294 #[derive(Clone, Debug)]
2311 pub struct UpdateSink(RequestBuilder<crate::model::UpdateSinkRequest>);
2312
2313 impl UpdateSink {
2314 pub(crate) fn new(
2315 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2316 ) -> Self {
2317 Self(RequestBuilder::new(stub))
2318 }
2319
2320 pub fn with_request<V: Into<crate::model::UpdateSinkRequest>>(mut self, v: V) -> Self {
2322 self.0.request = v.into();
2323 self
2324 }
2325
2326 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2328 self.0.options = v.into();
2329 self
2330 }
2331
2332 pub async fn send(self) -> Result<crate::model::LogSink> {
2334 (*self.0.stub)
2335 .update_sink(self.0.request, self.0.options)
2336 .await
2337 .map(gax::response::Response::into_body)
2338 }
2339
2340 pub fn set_sink_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2344 self.0.request.sink_name = v.into();
2345 self
2346 }
2347
2348 pub fn set_sink<T>(mut self, v: T) -> Self
2352 where
2353 T: std::convert::Into<crate::model::LogSink>,
2354 {
2355 self.0.request.sink = std::option::Option::Some(v.into());
2356 self
2357 }
2358
2359 pub fn set_or_clear_sink<T>(mut self, v: std::option::Option<T>) -> Self
2363 where
2364 T: std::convert::Into<crate::model::LogSink>,
2365 {
2366 self.0.request.sink = v.map(|x| x.into());
2367 self
2368 }
2369
2370 pub fn set_unique_writer_identity<T: Into<bool>>(mut self, v: T) -> Self {
2372 self.0.request.unique_writer_identity = v.into();
2373 self
2374 }
2375
2376 pub fn set_update_mask<T>(mut self, v: T) -> Self
2378 where
2379 T: std::convert::Into<wkt::FieldMask>,
2380 {
2381 self.0.request.update_mask = std::option::Option::Some(v.into());
2382 self
2383 }
2384
2385 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2387 where
2388 T: std::convert::Into<wkt::FieldMask>,
2389 {
2390 self.0.request.update_mask = v.map(|x| x.into());
2391 self
2392 }
2393 }
2394
2395 #[doc(hidden)]
2396 impl gax::options::internal::RequestBuilder for UpdateSink {
2397 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2398 &mut self.0.options
2399 }
2400 }
2401
2402 #[derive(Clone, Debug)]
2419 pub struct DeleteSink(RequestBuilder<crate::model::DeleteSinkRequest>);
2420
2421 impl DeleteSink {
2422 pub(crate) fn new(
2423 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2424 ) -> Self {
2425 Self(RequestBuilder::new(stub))
2426 }
2427
2428 pub fn with_request<V: Into<crate::model::DeleteSinkRequest>>(mut self, v: V) -> Self {
2430 self.0.request = v.into();
2431 self
2432 }
2433
2434 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2436 self.0.options = v.into();
2437 self
2438 }
2439
2440 pub async fn send(self) -> Result<()> {
2442 (*self.0.stub)
2443 .delete_sink(self.0.request, self.0.options)
2444 .await
2445 .map(gax::response::Response::into_body)
2446 }
2447
2448 pub fn set_sink_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2452 self.0.request.sink_name = v.into();
2453 self
2454 }
2455 }
2456
2457 #[doc(hidden)]
2458 impl gax::options::internal::RequestBuilder for DeleteSink {
2459 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2460 &mut self.0.options
2461 }
2462 }
2463
2464 #[derive(Clone, Debug)]
2482 pub struct CreateLink(RequestBuilder<crate::model::CreateLinkRequest>);
2483
2484 impl CreateLink {
2485 pub(crate) fn new(
2486 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2487 ) -> Self {
2488 Self(RequestBuilder::new(stub))
2489 }
2490
2491 pub fn with_request<V: Into<crate::model::CreateLinkRequest>>(mut self, v: V) -> Self {
2493 self.0.request = v.into();
2494 self
2495 }
2496
2497 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2499 self.0.options = v.into();
2500 self
2501 }
2502
2503 pub async fn send(self) -> Result<longrunning::model::Operation> {
2510 (*self.0.stub)
2511 .create_link(self.0.request, self.0.options)
2512 .await
2513 .map(gax::response::Response::into_body)
2514 }
2515
2516 pub fn poller(self) -> impl lro::Poller<crate::model::Link, crate::model::LinkMetadata> {
2518 type Operation =
2519 lro::internal::Operation<crate::model::Link, crate::model::LinkMetadata>;
2520 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2521 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2522
2523 let stub = self.0.stub.clone();
2524 let mut options = self.0.options.clone();
2525 options.set_retry_policy(gax::retry_policy::NeverRetry);
2526 let query = move |name| {
2527 let stub = stub.clone();
2528 let options = options.clone();
2529 async {
2530 let op = GetOperation::new(stub)
2531 .set_name(name)
2532 .with_options(options)
2533 .send()
2534 .await?;
2535 Ok(Operation::new(op))
2536 }
2537 };
2538
2539 let start = move || async {
2540 let op = self.send().await?;
2541 Ok(Operation::new(op))
2542 };
2543
2544 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
2545 }
2546
2547 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2551 self.0.request.parent = v.into();
2552 self
2553 }
2554
2555 pub fn set_link<T>(mut self, v: T) -> Self
2559 where
2560 T: std::convert::Into<crate::model::Link>,
2561 {
2562 self.0.request.link = std::option::Option::Some(v.into());
2563 self
2564 }
2565
2566 pub fn set_or_clear_link<T>(mut self, v: std::option::Option<T>) -> Self
2570 where
2571 T: std::convert::Into<crate::model::Link>,
2572 {
2573 self.0.request.link = v.map(|x| x.into());
2574 self
2575 }
2576
2577 pub fn set_link_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2581 self.0.request.link_id = v.into();
2582 self
2583 }
2584 }
2585
2586 #[doc(hidden)]
2587 impl gax::options::internal::RequestBuilder for CreateLink {
2588 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2589 &mut self.0.options
2590 }
2591 }
2592
2593 #[derive(Clone, Debug)]
2611 pub struct DeleteLink(RequestBuilder<crate::model::DeleteLinkRequest>);
2612
2613 impl DeleteLink {
2614 pub(crate) fn new(
2615 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2616 ) -> Self {
2617 Self(RequestBuilder::new(stub))
2618 }
2619
2620 pub fn with_request<V: Into<crate::model::DeleteLinkRequest>>(mut self, v: V) -> Self {
2622 self.0.request = v.into();
2623 self
2624 }
2625
2626 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2628 self.0.options = v.into();
2629 self
2630 }
2631
2632 pub async fn send(self) -> Result<longrunning::model::Operation> {
2639 (*self.0.stub)
2640 .delete_link(self.0.request, self.0.options)
2641 .await
2642 .map(gax::response::Response::into_body)
2643 }
2644
2645 pub fn poller(self) -> impl lro::Poller<(), crate::model::LinkMetadata> {
2647 type Operation = lro::internal::Operation<wkt::Empty, crate::model::LinkMetadata>;
2648 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2649 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2650
2651 let stub = self.0.stub.clone();
2652 let mut options = self.0.options.clone();
2653 options.set_retry_policy(gax::retry_policy::NeverRetry);
2654 let query = move |name| {
2655 let stub = stub.clone();
2656 let options = options.clone();
2657 async {
2658 let op = GetOperation::new(stub)
2659 .set_name(name)
2660 .with_options(options)
2661 .send()
2662 .await?;
2663 Ok(Operation::new(op))
2664 }
2665 };
2666
2667 let start = move || async {
2668 let op = self.send().await?;
2669 Ok(Operation::new(op))
2670 };
2671
2672 lro::internal::new_unit_response_poller(
2673 polling_error_policy,
2674 polling_backoff_policy,
2675 start,
2676 query,
2677 )
2678 }
2679
2680 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2684 self.0.request.name = v.into();
2685 self
2686 }
2687 }
2688
2689 #[doc(hidden)]
2690 impl gax::options::internal::RequestBuilder for DeleteLink {
2691 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2692 &mut self.0.options
2693 }
2694 }
2695
2696 #[derive(Clone, Debug)]
2717 pub struct ListLinks(RequestBuilder<crate::model::ListLinksRequest>);
2718
2719 impl ListLinks {
2720 pub(crate) fn new(
2721 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2722 ) -> Self {
2723 Self(RequestBuilder::new(stub))
2724 }
2725
2726 pub fn with_request<V: Into<crate::model::ListLinksRequest>>(mut self, v: V) -> Self {
2728 self.0.request = v.into();
2729 self
2730 }
2731
2732 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2734 self.0.options = v.into();
2735 self
2736 }
2737
2738 pub async fn send(self) -> Result<crate::model::ListLinksResponse> {
2740 (*self.0.stub)
2741 .list_links(self.0.request, self.0.options)
2742 .await
2743 .map(gax::response::Response::into_body)
2744 }
2745
2746 pub fn by_page(
2748 self,
2749 ) -> impl gax::paginator::Paginator<crate::model::ListLinksResponse, gax::error::Error>
2750 {
2751 use std::clone::Clone;
2752 let token = self.0.request.page_token.clone();
2753 let execute = move |token: String| {
2754 let mut builder = self.clone();
2755 builder.0.request = builder.0.request.set_page_token(token);
2756 builder.send()
2757 };
2758 gax::paginator::internal::new_paginator(token, execute)
2759 }
2760
2761 pub fn by_item(
2763 self,
2764 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLinksResponse, gax::error::Error>
2765 {
2766 use gax::paginator::Paginator;
2767 self.by_page().items()
2768 }
2769
2770 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2774 self.0.request.parent = v.into();
2775 self
2776 }
2777
2778 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2780 self.0.request.page_token = v.into();
2781 self
2782 }
2783
2784 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2786 self.0.request.page_size = v.into();
2787 self
2788 }
2789 }
2790
2791 #[doc(hidden)]
2792 impl gax::options::internal::RequestBuilder for ListLinks {
2793 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2794 &mut self.0.options
2795 }
2796 }
2797
2798 #[derive(Clone, Debug)]
2815 pub struct GetLink(RequestBuilder<crate::model::GetLinkRequest>);
2816
2817 impl GetLink {
2818 pub(crate) fn new(
2819 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2820 ) -> Self {
2821 Self(RequestBuilder::new(stub))
2822 }
2823
2824 pub fn with_request<V: Into<crate::model::GetLinkRequest>>(mut self, v: V) -> Self {
2826 self.0.request = v.into();
2827 self
2828 }
2829
2830 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2832 self.0.options = v.into();
2833 self
2834 }
2835
2836 pub async fn send(self) -> Result<crate::model::Link> {
2838 (*self.0.stub)
2839 .get_link(self.0.request, self.0.options)
2840 .await
2841 .map(gax::response::Response::into_body)
2842 }
2843
2844 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2848 self.0.request.name = v.into();
2849 self
2850 }
2851 }
2852
2853 #[doc(hidden)]
2854 impl gax::options::internal::RequestBuilder for GetLink {
2855 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2856 &mut self.0.options
2857 }
2858 }
2859
2860 #[derive(Clone, Debug)]
2881 pub struct ListExclusions(RequestBuilder<crate::model::ListExclusionsRequest>);
2882
2883 impl ListExclusions {
2884 pub(crate) fn new(
2885 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2886 ) -> Self {
2887 Self(RequestBuilder::new(stub))
2888 }
2889
2890 pub fn with_request<V: Into<crate::model::ListExclusionsRequest>>(mut self, v: V) -> Self {
2892 self.0.request = v.into();
2893 self
2894 }
2895
2896 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2898 self.0.options = v.into();
2899 self
2900 }
2901
2902 pub async fn send(self) -> Result<crate::model::ListExclusionsResponse> {
2904 (*self.0.stub)
2905 .list_exclusions(self.0.request, self.0.options)
2906 .await
2907 .map(gax::response::Response::into_body)
2908 }
2909
2910 pub fn by_page(
2912 self,
2913 ) -> impl gax::paginator::Paginator<crate::model::ListExclusionsResponse, gax::error::Error>
2914 {
2915 use std::clone::Clone;
2916 let token = self.0.request.page_token.clone();
2917 let execute = move |token: String| {
2918 let mut builder = self.clone();
2919 builder.0.request = builder.0.request.set_page_token(token);
2920 builder.send()
2921 };
2922 gax::paginator::internal::new_paginator(token, execute)
2923 }
2924
2925 pub fn by_item(
2927 self,
2928 ) -> impl gax::paginator::ItemPaginator<crate::model::ListExclusionsResponse, gax::error::Error>
2929 {
2930 use gax::paginator::Paginator;
2931 self.by_page().items()
2932 }
2933
2934 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2938 self.0.request.parent = v.into();
2939 self
2940 }
2941
2942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2944 self.0.request.page_token = v.into();
2945 self
2946 }
2947
2948 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2950 self.0.request.page_size = v.into();
2951 self
2952 }
2953 }
2954
2955 #[doc(hidden)]
2956 impl gax::options::internal::RequestBuilder for ListExclusions {
2957 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
2958 &mut self.0.options
2959 }
2960 }
2961
2962 #[derive(Clone, Debug)]
2979 pub struct GetExclusion(RequestBuilder<crate::model::GetExclusionRequest>);
2980
2981 impl GetExclusion {
2982 pub(crate) fn new(
2983 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
2984 ) -> Self {
2985 Self(RequestBuilder::new(stub))
2986 }
2987
2988 pub fn with_request<V: Into<crate::model::GetExclusionRequest>>(mut self, v: V) -> Self {
2990 self.0.request = v.into();
2991 self
2992 }
2993
2994 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
2996 self.0.options = v.into();
2997 self
2998 }
2999
3000 pub async fn send(self) -> Result<crate::model::LogExclusion> {
3002 (*self.0.stub)
3003 .get_exclusion(self.0.request, self.0.options)
3004 .await
3005 .map(gax::response::Response::into_body)
3006 }
3007
3008 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3012 self.0.request.name = v.into();
3013 self
3014 }
3015 }
3016
3017 #[doc(hidden)]
3018 impl gax::options::internal::RequestBuilder for GetExclusion {
3019 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3020 &mut self.0.options
3021 }
3022 }
3023
3024 #[derive(Clone, Debug)]
3041 pub struct CreateExclusion(RequestBuilder<crate::model::CreateExclusionRequest>);
3042
3043 impl CreateExclusion {
3044 pub(crate) fn new(
3045 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3046 ) -> Self {
3047 Self(RequestBuilder::new(stub))
3048 }
3049
3050 pub fn with_request<V: Into<crate::model::CreateExclusionRequest>>(mut self, v: V) -> Self {
3052 self.0.request = v.into();
3053 self
3054 }
3055
3056 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3058 self.0.options = v.into();
3059 self
3060 }
3061
3062 pub async fn send(self) -> Result<crate::model::LogExclusion> {
3064 (*self.0.stub)
3065 .create_exclusion(self.0.request, self.0.options)
3066 .await
3067 .map(gax::response::Response::into_body)
3068 }
3069
3070 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3074 self.0.request.parent = v.into();
3075 self
3076 }
3077
3078 pub fn set_exclusion<T>(mut self, v: T) -> Self
3082 where
3083 T: std::convert::Into<crate::model::LogExclusion>,
3084 {
3085 self.0.request.exclusion = std::option::Option::Some(v.into());
3086 self
3087 }
3088
3089 pub fn set_or_clear_exclusion<T>(mut self, v: std::option::Option<T>) -> Self
3093 where
3094 T: std::convert::Into<crate::model::LogExclusion>,
3095 {
3096 self.0.request.exclusion = v.map(|x| x.into());
3097 self
3098 }
3099 }
3100
3101 #[doc(hidden)]
3102 impl gax::options::internal::RequestBuilder for CreateExclusion {
3103 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3104 &mut self.0.options
3105 }
3106 }
3107
3108 #[derive(Clone, Debug)]
3125 pub struct UpdateExclusion(RequestBuilder<crate::model::UpdateExclusionRequest>);
3126
3127 impl UpdateExclusion {
3128 pub(crate) fn new(
3129 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3130 ) -> Self {
3131 Self(RequestBuilder::new(stub))
3132 }
3133
3134 pub fn with_request<V: Into<crate::model::UpdateExclusionRequest>>(mut self, v: V) -> Self {
3136 self.0.request = v.into();
3137 self
3138 }
3139
3140 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3142 self.0.options = v.into();
3143 self
3144 }
3145
3146 pub async fn send(self) -> Result<crate::model::LogExclusion> {
3148 (*self.0.stub)
3149 .update_exclusion(self.0.request, self.0.options)
3150 .await
3151 .map(gax::response::Response::into_body)
3152 }
3153
3154 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3158 self.0.request.name = v.into();
3159 self
3160 }
3161
3162 pub fn set_exclusion<T>(mut self, v: T) -> Self
3166 where
3167 T: std::convert::Into<crate::model::LogExclusion>,
3168 {
3169 self.0.request.exclusion = std::option::Option::Some(v.into());
3170 self
3171 }
3172
3173 pub fn set_or_clear_exclusion<T>(mut self, v: std::option::Option<T>) -> Self
3177 where
3178 T: std::convert::Into<crate::model::LogExclusion>,
3179 {
3180 self.0.request.exclusion = v.map(|x| x.into());
3181 self
3182 }
3183
3184 pub fn set_update_mask<T>(mut self, v: T) -> Self
3188 where
3189 T: std::convert::Into<wkt::FieldMask>,
3190 {
3191 self.0.request.update_mask = std::option::Option::Some(v.into());
3192 self
3193 }
3194
3195 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3199 where
3200 T: std::convert::Into<wkt::FieldMask>,
3201 {
3202 self.0.request.update_mask = v.map(|x| x.into());
3203 self
3204 }
3205 }
3206
3207 #[doc(hidden)]
3208 impl gax::options::internal::RequestBuilder for UpdateExclusion {
3209 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3210 &mut self.0.options
3211 }
3212 }
3213
3214 #[derive(Clone, Debug)]
3231 pub struct DeleteExclusion(RequestBuilder<crate::model::DeleteExclusionRequest>);
3232
3233 impl DeleteExclusion {
3234 pub(crate) fn new(
3235 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3236 ) -> Self {
3237 Self(RequestBuilder::new(stub))
3238 }
3239
3240 pub fn with_request<V: Into<crate::model::DeleteExclusionRequest>>(mut self, v: V) -> Self {
3242 self.0.request = v.into();
3243 self
3244 }
3245
3246 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3248 self.0.options = v.into();
3249 self
3250 }
3251
3252 pub async fn send(self) -> Result<()> {
3254 (*self.0.stub)
3255 .delete_exclusion(self.0.request, self.0.options)
3256 .await
3257 .map(gax::response::Response::into_body)
3258 }
3259
3260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3264 self.0.request.name = v.into();
3265 self
3266 }
3267 }
3268
3269 #[doc(hidden)]
3270 impl gax::options::internal::RequestBuilder for DeleteExclusion {
3271 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3272 &mut self.0.options
3273 }
3274 }
3275
3276 #[derive(Clone, Debug)]
3293 pub struct GetCmekSettings(RequestBuilder<crate::model::GetCmekSettingsRequest>);
3294
3295 impl GetCmekSettings {
3296 pub(crate) fn new(
3297 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3298 ) -> Self {
3299 Self(RequestBuilder::new(stub))
3300 }
3301
3302 pub fn with_request<V: Into<crate::model::GetCmekSettingsRequest>>(mut self, v: V) -> Self {
3304 self.0.request = v.into();
3305 self
3306 }
3307
3308 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3310 self.0.options = v.into();
3311 self
3312 }
3313
3314 pub async fn send(self) -> Result<crate::model::CmekSettings> {
3316 (*self.0.stub)
3317 .get_cmek_settings(self.0.request, self.0.options)
3318 .await
3319 .map(gax::response::Response::into_body)
3320 }
3321
3322 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3326 self.0.request.name = v.into();
3327 self
3328 }
3329 }
3330
3331 #[doc(hidden)]
3332 impl gax::options::internal::RequestBuilder for GetCmekSettings {
3333 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3334 &mut self.0.options
3335 }
3336 }
3337
3338 #[derive(Clone, Debug)]
3355 pub struct UpdateCmekSettings(RequestBuilder<crate::model::UpdateCmekSettingsRequest>);
3356
3357 impl UpdateCmekSettings {
3358 pub(crate) fn new(
3359 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3360 ) -> Self {
3361 Self(RequestBuilder::new(stub))
3362 }
3363
3364 pub fn with_request<V: Into<crate::model::UpdateCmekSettingsRequest>>(
3366 mut self,
3367 v: V,
3368 ) -> Self {
3369 self.0.request = v.into();
3370 self
3371 }
3372
3373 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3375 self.0.options = v.into();
3376 self
3377 }
3378
3379 pub async fn send(self) -> Result<crate::model::CmekSettings> {
3381 (*self.0.stub)
3382 .update_cmek_settings(self.0.request, self.0.options)
3383 .await
3384 .map(gax::response::Response::into_body)
3385 }
3386
3387 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3391 self.0.request.name = v.into();
3392 self
3393 }
3394
3395 pub fn set_cmek_settings<T>(mut self, v: T) -> Self
3399 where
3400 T: std::convert::Into<crate::model::CmekSettings>,
3401 {
3402 self.0.request.cmek_settings = std::option::Option::Some(v.into());
3403 self
3404 }
3405
3406 pub fn set_or_clear_cmek_settings<T>(mut self, v: std::option::Option<T>) -> Self
3410 where
3411 T: std::convert::Into<crate::model::CmekSettings>,
3412 {
3413 self.0.request.cmek_settings = v.map(|x| x.into());
3414 self
3415 }
3416
3417 pub fn set_update_mask<T>(mut self, v: T) -> Self
3419 where
3420 T: std::convert::Into<wkt::FieldMask>,
3421 {
3422 self.0.request.update_mask = std::option::Option::Some(v.into());
3423 self
3424 }
3425
3426 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3428 where
3429 T: std::convert::Into<wkt::FieldMask>,
3430 {
3431 self.0.request.update_mask = v.map(|x| x.into());
3432 self
3433 }
3434 }
3435
3436 #[doc(hidden)]
3437 impl gax::options::internal::RequestBuilder for UpdateCmekSettings {
3438 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3439 &mut self.0.options
3440 }
3441 }
3442
3443 #[derive(Clone, Debug)]
3460 pub struct GetSettings(RequestBuilder<crate::model::GetSettingsRequest>);
3461
3462 impl GetSettings {
3463 pub(crate) fn new(
3464 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3465 ) -> Self {
3466 Self(RequestBuilder::new(stub))
3467 }
3468
3469 pub fn with_request<V: Into<crate::model::GetSettingsRequest>>(mut self, v: V) -> Self {
3471 self.0.request = v.into();
3472 self
3473 }
3474
3475 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3477 self.0.options = v.into();
3478 self
3479 }
3480
3481 pub async fn send(self) -> Result<crate::model::Settings> {
3483 (*self.0.stub)
3484 .get_settings(self.0.request, self.0.options)
3485 .await
3486 .map(gax::response::Response::into_body)
3487 }
3488
3489 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3493 self.0.request.name = v.into();
3494 self
3495 }
3496 }
3497
3498 #[doc(hidden)]
3499 impl gax::options::internal::RequestBuilder for GetSettings {
3500 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3501 &mut self.0.options
3502 }
3503 }
3504
3505 #[derive(Clone, Debug)]
3522 pub struct UpdateSettings(RequestBuilder<crate::model::UpdateSettingsRequest>);
3523
3524 impl UpdateSettings {
3525 pub(crate) fn new(
3526 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3527 ) -> Self {
3528 Self(RequestBuilder::new(stub))
3529 }
3530
3531 pub fn with_request<V: Into<crate::model::UpdateSettingsRequest>>(mut self, v: V) -> Self {
3533 self.0.request = v.into();
3534 self
3535 }
3536
3537 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3539 self.0.options = v.into();
3540 self
3541 }
3542
3543 pub async fn send(self) -> Result<crate::model::Settings> {
3545 (*self.0.stub)
3546 .update_settings(self.0.request, self.0.options)
3547 .await
3548 .map(gax::response::Response::into_body)
3549 }
3550
3551 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3555 self.0.request.name = v.into();
3556 self
3557 }
3558
3559 pub fn set_settings<T>(mut self, v: T) -> Self
3563 where
3564 T: std::convert::Into<crate::model::Settings>,
3565 {
3566 self.0.request.settings = std::option::Option::Some(v.into());
3567 self
3568 }
3569
3570 pub fn set_or_clear_settings<T>(mut self, v: std::option::Option<T>) -> Self
3574 where
3575 T: std::convert::Into<crate::model::Settings>,
3576 {
3577 self.0.request.settings = v.map(|x| x.into());
3578 self
3579 }
3580
3581 pub fn set_update_mask<T>(mut self, v: T) -> Self
3583 where
3584 T: std::convert::Into<wkt::FieldMask>,
3585 {
3586 self.0.request.update_mask = std::option::Option::Some(v.into());
3587 self
3588 }
3589
3590 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3592 where
3593 T: std::convert::Into<wkt::FieldMask>,
3594 {
3595 self.0.request.update_mask = v.map(|x| x.into());
3596 self
3597 }
3598 }
3599
3600 #[doc(hidden)]
3601 impl gax::options::internal::RequestBuilder for UpdateSettings {
3602 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3603 &mut self.0.options
3604 }
3605 }
3606
3607 #[derive(Clone, Debug)]
3625 pub struct CopyLogEntries(RequestBuilder<crate::model::CopyLogEntriesRequest>);
3626
3627 impl CopyLogEntries {
3628 pub(crate) fn new(
3629 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3630 ) -> Self {
3631 Self(RequestBuilder::new(stub))
3632 }
3633
3634 pub fn with_request<V: Into<crate::model::CopyLogEntriesRequest>>(mut self, v: V) -> Self {
3636 self.0.request = v.into();
3637 self
3638 }
3639
3640 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3642 self.0.options = v.into();
3643 self
3644 }
3645
3646 pub async fn send(self) -> Result<longrunning::model::Operation> {
3653 (*self.0.stub)
3654 .copy_log_entries(self.0.request, self.0.options)
3655 .await
3656 .map(gax::response::Response::into_body)
3657 }
3658
3659 pub fn poller(
3661 self,
3662 ) -> impl lro::Poller<crate::model::CopyLogEntriesResponse, crate::model::CopyLogEntriesMetadata>
3663 {
3664 type Operation = lro::internal::Operation<
3665 crate::model::CopyLogEntriesResponse,
3666 crate::model::CopyLogEntriesMetadata,
3667 >;
3668 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3669 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3670
3671 let stub = self.0.stub.clone();
3672 let mut options = self.0.options.clone();
3673 options.set_retry_policy(gax::retry_policy::NeverRetry);
3674 let query = move |name| {
3675 let stub = stub.clone();
3676 let options = options.clone();
3677 async {
3678 let op = GetOperation::new(stub)
3679 .set_name(name)
3680 .with_options(options)
3681 .send()
3682 .await?;
3683 Ok(Operation::new(op))
3684 }
3685 };
3686
3687 let start = move || async {
3688 let op = self.send().await?;
3689 Ok(Operation::new(op))
3690 };
3691
3692 lro::internal::new_poller(polling_error_policy, polling_backoff_policy, start, query)
3693 }
3694
3695 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3699 self.0.request.name = v.into();
3700 self
3701 }
3702
3703 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3705 self.0.request.filter = v.into();
3706 self
3707 }
3708
3709 pub fn set_destination<T: Into<std::string::String>>(mut self, v: T) -> Self {
3713 self.0.request.destination = v.into();
3714 self
3715 }
3716 }
3717
3718 #[doc(hidden)]
3719 impl gax::options::internal::RequestBuilder for CopyLogEntries {
3720 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3721 &mut self.0.options
3722 }
3723 }
3724
3725 #[derive(Clone, Debug)]
3746 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
3747
3748 impl ListOperations {
3749 pub(crate) fn new(
3750 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3751 ) -> Self {
3752 Self(RequestBuilder::new(stub))
3753 }
3754
3755 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
3757 mut self,
3758 v: V,
3759 ) -> Self {
3760 self.0.request = v.into();
3761 self
3762 }
3763
3764 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3766 self.0.options = v.into();
3767 self
3768 }
3769
3770 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
3772 (*self.0.stub)
3773 .list_operations(self.0.request, self.0.options)
3774 .await
3775 .map(gax::response::Response::into_body)
3776 }
3777
3778 pub fn by_page(
3780 self,
3781 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
3782 {
3783 use std::clone::Clone;
3784 let token = self.0.request.page_token.clone();
3785 let execute = move |token: String| {
3786 let mut builder = self.clone();
3787 builder.0.request = builder.0.request.set_page_token(token);
3788 builder.send()
3789 };
3790 gax::paginator::internal::new_paginator(token, execute)
3791 }
3792
3793 pub fn by_item(
3795 self,
3796 ) -> impl gax::paginator::ItemPaginator<
3797 longrunning::model::ListOperationsResponse,
3798 gax::error::Error,
3799 > {
3800 use gax::paginator::Paginator;
3801 self.by_page().items()
3802 }
3803
3804 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3806 self.0.request.name = v.into();
3807 self
3808 }
3809
3810 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3812 self.0.request.filter = v.into();
3813 self
3814 }
3815
3816 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3818 self.0.request.page_size = v.into();
3819 self
3820 }
3821
3822 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3824 self.0.request.page_token = v.into();
3825 self
3826 }
3827
3828 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3830 self.0.request.return_partial_success = v.into();
3831 self
3832 }
3833 }
3834
3835 #[doc(hidden)]
3836 impl gax::options::internal::RequestBuilder for ListOperations {
3837 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3838 &mut self.0.options
3839 }
3840 }
3841
3842 #[derive(Clone, Debug)]
3859 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
3860
3861 impl GetOperation {
3862 pub(crate) fn new(
3863 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3864 ) -> Self {
3865 Self(RequestBuilder::new(stub))
3866 }
3867
3868 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
3870 mut self,
3871 v: V,
3872 ) -> Self {
3873 self.0.request = v.into();
3874 self
3875 }
3876
3877 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3879 self.0.options = v.into();
3880 self
3881 }
3882
3883 pub async fn send(self) -> Result<longrunning::model::Operation> {
3885 (*self.0.stub)
3886 .get_operation(self.0.request, self.0.options)
3887 .await
3888 .map(gax::response::Response::into_body)
3889 }
3890
3891 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3893 self.0.request.name = v.into();
3894 self
3895 }
3896 }
3897
3898 #[doc(hidden)]
3899 impl gax::options::internal::RequestBuilder for GetOperation {
3900 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3901 &mut self.0.options
3902 }
3903 }
3904
3905 #[derive(Clone, Debug)]
3922 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
3923
3924 impl CancelOperation {
3925 pub(crate) fn new(
3926 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConfigServiceV2>,
3927 ) -> Self {
3928 Self(RequestBuilder::new(stub))
3929 }
3930
3931 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
3933 mut self,
3934 v: V,
3935 ) -> Self {
3936 self.0.request = v.into();
3937 self
3938 }
3939
3940 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
3942 self.0.options = v.into();
3943 self
3944 }
3945
3946 pub async fn send(self) -> Result<()> {
3948 (*self.0.stub)
3949 .cancel_operation(self.0.request, self.0.options)
3950 .await
3951 .map(gax::response::Response::into_body)
3952 }
3953
3954 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3956 self.0.request.name = v.into();
3957 self
3958 }
3959 }
3960
3961 #[doc(hidden)]
3962 impl gax::options::internal::RequestBuilder for CancelOperation {
3963 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
3964 &mut self.0.options
3965 }
3966 }
3967}
3968
3969pub mod metrics_service_v_2 {
3970 use crate::Result;
3971
3972 pub type ClientBuilder =
3986 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3987
3988 pub(crate) mod client {
3989 use super::super::super::client::MetricsServiceV2;
3990 pub struct Factory;
3991 impl gax::client_builder::internal::ClientFactory for Factory {
3992 type Client = MetricsServiceV2;
3993 type Credentials = gaxi::options::Credentials;
3994 async fn build(
3995 self,
3996 config: gaxi::options::ClientConfig,
3997 ) -> gax::client_builder::Result<Self::Client> {
3998 Self::Client::new(config).await
3999 }
4000 }
4001 }
4002
4003 #[derive(Clone, Debug)]
4005 pub(crate) struct RequestBuilder<R: std::default::Default> {
4006 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4007 request: R,
4008 options: gax::options::RequestOptions,
4009 }
4010
4011 impl<R> RequestBuilder<R>
4012 where
4013 R: std::default::Default,
4014 {
4015 pub(crate) fn new(
4016 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4017 ) -> Self {
4018 Self {
4019 stub,
4020 request: R::default(),
4021 options: gax::options::RequestOptions::default(),
4022 }
4023 }
4024 }
4025
4026 #[derive(Clone, Debug)]
4047 pub struct ListLogMetrics(RequestBuilder<crate::model::ListLogMetricsRequest>);
4048
4049 impl ListLogMetrics {
4050 pub(crate) fn new(
4051 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4052 ) -> Self {
4053 Self(RequestBuilder::new(stub))
4054 }
4055
4056 pub fn with_request<V: Into<crate::model::ListLogMetricsRequest>>(mut self, v: V) -> Self {
4058 self.0.request = v.into();
4059 self
4060 }
4061
4062 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4064 self.0.options = v.into();
4065 self
4066 }
4067
4068 pub async fn send(self) -> Result<crate::model::ListLogMetricsResponse> {
4070 (*self.0.stub)
4071 .list_log_metrics(self.0.request, self.0.options)
4072 .await
4073 .map(gax::response::Response::into_body)
4074 }
4075
4076 pub fn by_page(
4078 self,
4079 ) -> impl gax::paginator::Paginator<crate::model::ListLogMetricsResponse, gax::error::Error>
4080 {
4081 use std::clone::Clone;
4082 let token = self.0.request.page_token.clone();
4083 let execute = move |token: String| {
4084 let mut builder = self.clone();
4085 builder.0.request = builder.0.request.set_page_token(token);
4086 builder.send()
4087 };
4088 gax::paginator::internal::new_paginator(token, execute)
4089 }
4090
4091 pub fn by_item(
4093 self,
4094 ) -> impl gax::paginator::ItemPaginator<crate::model::ListLogMetricsResponse, gax::error::Error>
4095 {
4096 use gax::paginator::Paginator;
4097 self.by_page().items()
4098 }
4099
4100 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4104 self.0.request.parent = v.into();
4105 self
4106 }
4107
4108 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4110 self.0.request.page_token = v.into();
4111 self
4112 }
4113
4114 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4116 self.0.request.page_size = v.into();
4117 self
4118 }
4119 }
4120
4121 #[doc(hidden)]
4122 impl gax::options::internal::RequestBuilder for ListLogMetrics {
4123 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4124 &mut self.0.options
4125 }
4126 }
4127
4128 #[derive(Clone, Debug)]
4145 pub struct GetLogMetric(RequestBuilder<crate::model::GetLogMetricRequest>);
4146
4147 impl GetLogMetric {
4148 pub(crate) fn new(
4149 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4150 ) -> Self {
4151 Self(RequestBuilder::new(stub))
4152 }
4153
4154 pub fn with_request<V: Into<crate::model::GetLogMetricRequest>>(mut self, v: V) -> Self {
4156 self.0.request = v.into();
4157 self
4158 }
4159
4160 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4162 self.0.options = v.into();
4163 self
4164 }
4165
4166 pub async fn send(self) -> Result<crate::model::LogMetric> {
4168 (*self.0.stub)
4169 .get_log_metric(self.0.request, self.0.options)
4170 .await
4171 .map(gax::response::Response::into_body)
4172 }
4173
4174 pub fn set_metric_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4178 self.0.request.metric_name = v.into();
4179 self
4180 }
4181 }
4182
4183 #[doc(hidden)]
4184 impl gax::options::internal::RequestBuilder for GetLogMetric {
4185 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4186 &mut self.0.options
4187 }
4188 }
4189
4190 #[derive(Clone, Debug)]
4207 pub struct CreateLogMetric(RequestBuilder<crate::model::CreateLogMetricRequest>);
4208
4209 impl CreateLogMetric {
4210 pub(crate) fn new(
4211 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4212 ) -> Self {
4213 Self(RequestBuilder::new(stub))
4214 }
4215
4216 pub fn with_request<V: Into<crate::model::CreateLogMetricRequest>>(mut self, v: V) -> Self {
4218 self.0.request = v.into();
4219 self
4220 }
4221
4222 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4224 self.0.options = v.into();
4225 self
4226 }
4227
4228 pub async fn send(self) -> Result<crate::model::LogMetric> {
4230 (*self.0.stub)
4231 .create_log_metric(self.0.request, self.0.options)
4232 .await
4233 .map(gax::response::Response::into_body)
4234 }
4235
4236 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4240 self.0.request.parent = v.into();
4241 self
4242 }
4243
4244 pub fn set_metric<T>(mut self, v: T) -> Self
4248 where
4249 T: std::convert::Into<crate::model::LogMetric>,
4250 {
4251 self.0.request.metric = std::option::Option::Some(v.into());
4252 self
4253 }
4254
4255 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
4259 where
4260 T: std::convert::Into<crate::model::LogMetric>,
4261 {
4262 self.0.request.metric = v.map(|x| x.into());
4263 self
4264 }
4265 }
4266
4267 #[doc(hidden)]
4268 impl gax::options::internal::RequestBuilder for CreateLogMetric {
4269 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4270 &mut self.0.options
4271 }
4272 }
4273
4274 #[derive(Clone, Debug)]
4291 pub struct UpdateLogMetric(RequestBuilder<crate::model::UpdateLogMetricRequest>);
4292
4293 impl UpdateLogMetric {
4294 pub(crate) fn new(
4295 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4296 ) -> Self {
4297 Self(RequestBuilder::new(stub))
4298 }
4299
4300 pub fn with_request<V: Into<crate::model::UpdateLogMetricRequest>>(mut self, v: V) -> Self {
4302 self.0.request = v.into();
4303 self
4304 }
4305
4306 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4308 self.0.options = v.into();
4309 self
4310 }
4311
4312 pub async fn send(self) -> Result<crate::model::LogMetric> {
4314 (*self.0.stub)
4315 .update_log_metric(self.0.request, self.0.options)
4316 .await
4317 .map(gax::response::Response::into_body)
4318 }
4319
4320 pub fn set_metric_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4324 self.0.request.metric_name = v.into();
4325 self
4326 }
4327
4328 pub fn set_metric<T>(mut self, v: T) -> Self
4332 where
4333 T: std::convert::Into<crate::model::LogMetric>,
4334 {
4335 self.0.request.metric = std::option::Option::Some(v.into());
4336 self
4337 }
4338
4339 pub fn set_or_clear_metric<T>(mut self, v: std::option::Option<T>) -> Self
4343 where
4344 T: std::convert::Into<crate::model::LogMetric>,
4345 {
4346 self.0.request.metric = v.map(|x| x.into());
4347 self
4348 }
4349 }
4350
4351 #[doc(hidden)]
4352 impl gax::options::internal::RequestBuilder for UpdateLogMetric {
4353 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4354 &mut self.0.options
4355 }
4356 }
4357
4358 #[derive(Clone, Debug)]
4375 pub struct DeleteLogMetric(RequestBuilder<crate::model::DeleteLogMetricRequest>);
4376
4377 impl DeleteLogMetric {
4378 pub(crate) fn new(
4379 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4380 ) -> Self {
4381 Self(RequestBuilder::new(stub))
4382 }
4383
4384 pub fn with_request<V: Into<crate::model::DeleteLogMetricRequest>>(mut self, v: V) -> Self {
4386 self.0.request = v.into();
4387 self
4388 }
4389
4390 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4392 self.0.options = v.into();
4393 self
4394 }
4395
4396 pub async fn send(self) -> Result<()> {
4398 (*self.0.stub)
4399 .delete_log_metric(self.0.request, self.0.options)
4400 .await
4401 .map(gax::response::Response::into_body)
4402 }
4403
4404 pub fn set_metric_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4408 self.0.request.metric_name = v.into();
4409 self
4410 }
4411 }
4412
4413 #[doc(hidden)]
4414 impl gax::options::internal::RequestBuilder for DeleteLogMetric {
4415 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4416 &mut self.0.options
4417 }
4418 }
4419
4420 #[derive(Clone, Debug)]
4441 pub struct ListOperations(RequestBuilder<longrunning::model::ListOperationsRequest>);
4442
4443 impl ListOperations {
4444 pub(crate) fn new(
4445 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4446 ) -> Self {
4447 Self(RequestBuilder::new(stub))
4448 }
4449
4450 pub fn with_request<V: Into<longrunning::model::ListOperationsRequest>>(
4452 mut self,
4453 v: V,
4454 ) -> Self {
4455 self.0.request = v.into();
4456 self
4457 }
4458
4459 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4461 self.0.options = v.into();
4462 self
4463 }
4464
4465 pub async fn send(self) -> Result<longrunning::model::ListOperationsResponse> {
4467 (*self.0.stub)
4468 .list_operations(self.0.request, self.0.options)
4469 .await
4470 .map(gax::response::Response::into_body)
4471 }
4472
4473 pub fn by_page(
4475 self,
4476 ) -> impl gax::paginator::Paginator<longrunning::model::ListOperationsResponse, gax::error::Error>
4477 {
4478 use std::clone::Clone;
4479 let token = self.0.request.page_token.clone();
4480 let execute = move |token: String| {
4481 let mut builder = self.clone();
4482 builder.0.request = builder.0.request.set_page_token(token);
4483 builder.send()
4484 };
4485 gax::paginator::internal::new_paginator(token, execute)
4486 }
4487
4488 pub fn by_item(
4490 self,
4491 ) -> impl gax::paginator::ItemPaginator<
4492 longrunning::model::ListOperationsResponse,
4493 gax::error::Error,
4494 > {
4495 use gax::paginator::Paginator;
4496 self.by_page().items()
4497 }
4498
4499 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4501 self.0.request.name = v.into();
4502 self
4503 }
4504
4505 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4507 self.0.request.filter = v.into();
4508 self
4509 }
4510
4511 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4513 self.0.request.page_size = v.into();
4514 self
4515 }
4516
4517 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4519 self.0.request.page_token = v.into();
4520 self
4521 }
4522
4523 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4525 self.0.request.return_partial_success = v.into();
4526 self
4527 }
4528 }
4529
4530 #[doc(hidden)]
4531 impl gax::options::internal::RequestBuilder for ListOperations {
4532 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4533 &mut self.0.options
4534 }
4535 }
4536
4537 #[derive(Clone, Debug)]
4554 pub struct GetOperation(RequestBuilder<longrunning::model::GetOperationRequest>);
4555
4556 impl GetOperation {
4557 pub(crate) fn new(
4558 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4559 ) -> Self {
4560 Self(RequestBuilder::new(stub))
4561 }
4562
4563 pub fn with_request<V: Into<longrunning::model::GetOperationRequest>>(
4565 mut self,
4566 v: V,
4567 ) -> Self {
4568 self.0.request = v.into();
4569 self
4570 }
4571
4572 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4574 self.0.options = v.into();
4575 self
4576 }
4577
4578 pub async fn send(self) -> Result<longrunning::model::Operation> {
4580 (*self.0.stub)
4581 .get_operation(self.0.request, self.0.options)
4582 .await
4583 .map(gax::response::Response::into_body)
4584 }
4585
4586 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4588 self.0.request.name = v.into();
4589 self
4590 }
4591 }
4592
4593 #[doc(hidden)]
4594 impl gax::options::internal::RequestBuilder for GetOperation {
4595 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4596 &mut self.0.options
4597 }
4598 }
4599
4600 #[derive(Clone, Debug)]
4617 pub struct CancelOperation(RequestBuilder<longrunning::model::CancelOperationRequest>);
4618
4619 impl CancelOperation {
4620 pub(crate) fn new(
4621 stub: std::sync::Arc<dyn super::super::stub::dynamic::MetricsServiceV2>,
4622 ) -> Self {
4623 Self(RequestBuilder::new(stub))
4624 }
4625
4626 pub fn with_request<V: Into<longrunning::model::CancelOperationRequest>>(
4628 mut self,
4629 v: V,
4630 ) -> Self {
4631 self.0.request = v.into();
4632 self
4633 }
4634
4635 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
4637 self.0.options = v.into();
4638 self
4639 }
4640
4641 pub async fn send(self) -> Result<()> {
4643 (*self.0.stub)
4644 .cancel_operation(self.0.request, self.0.options)
4645 .await
4646 .map(gax::response::Response::into_body)
4647 }
4648
4649 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4651 self.0.request.name = v.into();
4652 self
4653 }
4654 }
4655
4656 #[doc(hidden)]
4657 impl gax::options::internal::RequestBuilder for CancelOperation {
4658 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
4659 &mut self.0.options
4660 }
4661 }
4662}