1pub mod aml {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::Aml;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = Aml;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
64 Self {
65 stub,
66 request: R::default(),
67 options: crate::RequestOptions::default(),
68 }
69 }
70 }
71
72 #[derive(Clone, Debug)]
93 pub struct ListInstances(RequestBuilder<crate::model::ListInstancesRequest>);
94
95 impl ListInstances {
96 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
97 Self(RequestBuilder::new(stub))
98 }
99
100 pub fn with_request<V: Into<crate::model::ListInstancesRequest>>(mut self, v: V) -> Self {
102 self.0.request = v.into();
103 self
104 }
105
106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
108 self.0.options = v.into();
109 self
110 }
111
112 pub async fn send(self) -> Result<crate::model::ListInstancesResponse> {
114 (*self.0.stub)
115 .list_instances(self.0.request, self.0.options)
116 .await
117 .map(crate::Response::into_body)
118 }
119
120 pub fn by_page(
122 self,
123 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListInstancesResponse, crate::Error>
124 {
125 use std::clone::Clone;
126 let token = self.0.request.page_token.clone();
127 let execute = move |token: String| {
128 let mut builder = self.clone();
129 builder.0.request = builder.0.request.set_page_token(token);
130 builder.send()
131 };
132 google_cloud_gax::paginator::internal::new_paginator(token, execute)
133 }
134
135 pub fn by_item(
137 self,
138 ) -> impl google_cloud_gax::paginator::ItemPaginator<
139 crate::model::ListInstancesResponse,
140 crate::Error,
141 > {
142 use google_cloud_gax::paginator::Paginator;
143 self.by_page().items()
144 }
145
146 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
150 self.0.request.parent = v.into();
151 self
152 }
153
154 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
156 self.0.request.page_size = v.into();
157 self
158 }
159
160 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
162 self.0.request.page_token = v.into();
163 self
164 }
165
166 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
168 self.0.request.filter = v.into();
169 self
170 }
171
172 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
174 self.0.request.order_by = v.into();
175 self
176 }
177 }
178
179 #[doc(hidden)]
180 impl crate::RequestBuilder for ListInstances {
181 fn request_options(&mut self) -> &mut crate::RequestOptions {
182 &mut self.0.options
183 }
184 }
185
186 #[derive(Clone, Debug)]
203 pub struct GetInstance(RequestBuilder<crate::model::GetInstanceRequest>);
204
205 impl GetInstance {
206 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
207 Self(RequestBuilder::new(stub))
208 }
209
210 pub fn with_request<V: Into<crate::model::GetInstanceRequest>>(mut self, v: V) -> Self {
212 self.0.request = v.into();
213 self
214 }
215
216 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
218 self.0.options = v.into();
219 self
220 }
221
222 pub async fn send(self) -> Result<crate::model::Instance> {
224 (*self.0.stub)
225 .get_instance(self.0.request, self.0.options)
226 .await
227 .map(crate::Response::into_body)
228 }
229
230 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
234 self.0.request.name = v.into();
235 self
236 }
237 }
238
239 #[doc(hidden)]
240 impl crate::RequestBuilder for GetInstance {
241 fn request_options(&mut self) -> &mut crate::RequestOptions {
242 &mut self.0.options
243 }
244 }
245
246 #[derive(Clone, Debug)]
264 pub struct CreateInstance(RequestBuilder<crate::model::CreateInstanceRequest>);
265
266 impl CreateInstance {
267 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
268 Self(RequestBuilder::new(stub))
269 }
270
271 pub fn with_request<V: Into<crate::model::CreateInstanceRequest>>(mut self, v: V) -> Self {
273 self.0.request = v.into();
274 self
275 }
276
277 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
279 self.0.options = v.into();
280 self
281 }
282
283 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
290 (*self.0.stub)
291 .create_instance(self.0.request, self.0.options)
292 .await
293 .map(crate::Response::into_body)
294 }
295
296 pub fn poller(
298 self,
299 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
300 {
301 type Operation = google_cloud_lro::internal::Operation<
302 crate::model::Instance,
303 crate::model::OperationMetadata,
304 >;
305 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
306 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
307
308 let stub = self.0.stub.clone();
309 let mut options = self.0.options.clone();
310 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
311 let query = move |name| {
312 let stub = stub.clone();
313 let options = options.clone();
314 async {
315 let op = GetOperation::new(stub)
316 .set_name(name)
317 .with_options(options)
318 .send()
319 .await?;
320 Ok(Operation::new(op))
321 }
322 };
323
324 let start = move || async {
325 let op = self.send().await?;
326 Ok(Operation::new(op))
327 };
328
329 google_cloud_lro::internal::new_poller(
330 polling_error_policy,
331 polling_backoff_policy,
332 start,
333 query,
334 )
335 }
336
337 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
341 self.0.request.parent = v.into();
342 self
343 }
344
345 pub fn set_instance_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
349 self.0.request.instance_id = v.into();
350 self
351 }
352
353 pub fn set_instance<T>(mut self, v: T) -> Self
357 where
358 T: std::convert::Into<crate::model::Instance>,
359 {
360 self.0.request.instance = std::option::Option::Some(v.into());
361 self
362 }
363
364 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
368 where
369 T: std::convert::Into<crate::model::Instance>,
370 {
371 self.0.request.instance = v.map(|x| x.into());
372 self
373 }
374
375 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
377 self.0.request.request_id = v.into();
378 self
379 }
380 }
381
382 #[doc(hidden)]
383 impl crate::RequestBuilder for CreateInstance {
384 fn request_options(&mut self) -> &mut crate::RequestOptions {
385 &mut self.0.options
386 }
387 }
388
389 #[derive(Clone, Debug)]
407 pub struct UpdateInstance(RequestBuilder<crate::model::UpdateInstanceRequest>);
408
409 impl UpdateInstance {
410 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
411 Self(RequestBuilder::new(stub))
412 }
413
414 pub fn with_request<V: Into<crate::model::UpdateInstanceRequest>>(mut self, v: V) -> Self {
416 self.0.request = v.into();
417 self
418 }
419
420 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
422 self.0.options = v.into();
423 self
424 }
425
426 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
433 (*self.0.stub)
434 .update_instance(self.0.request, self.0.options)
435 .await
436 .map(crate::Response::into_body)
437 }
438
439 pub fn poller(
441 self,
442 ) -> impl google_cloud_lro::Poller<crate::model::Instance, crate::model::OperationMetadata>
443 {
444 type Operation = google_cloud_lro::internal::Operation<
445 crate::model::Instance,
446 crate::model::OperationMetadata,
447 >;
448 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
449 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
450
451 let stub = self.0.stub.clone();
452 let mut options = self.0.options.clone();
453 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
454 let query = move |name| {
455 let stub = stub.clone();
456 let options = options.clone();
457 async {
458 let op = GetOperation::new(stub)
459 .set_name(name)
460 .with_options(options)
461 .send()
462 .await?;
463 Ok(Operation::new(op))
464 }
465 };
466
467 let start = move || async {
468 let op = self.send().await?;
469 Ok(Operation::new(op))
470 };
471
472 google_cloud_lro::internal::new_poller(
473 polling_error_policy,
474 polling_backoff_policy,
475 start,
476 query,
477 )
478 }
479
480 pub fn set_update_mask<T>(mut self, v: T) -> Self
482 where
483 T: std::convert::Into<wkt::FieldMask>,
484 {
485 self.0.request.update_mask = std::option::Option::Some(v.into());
486 self
487 }
488
489 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
491 where
492 T: std::convert::Into<wkt::FieldMask>,
493 {
494 self.0.request.update_mask = v.map(|x| x.into());
495 self
496 }
497
498 pub fn set_instance<T>(mut self, v: T) -> Self
502 where
503 T: std::convert::Into<crate::model::Instance>,
504 {
505 self.0.request.instance = std::option::Option::Some(v.into());
506 self
507 }
508
509 pub fn set_or_clear_instance<T>(mut self, v: std::option::Option<T>) -> Self
513 where
514 T: std::convert::Into<crate::model::Instance>,
515 {
516 self.0.request.instance = v.map(|x| x.into());
517 self
518 }
519
520 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
522 self.0.request.request_id = v.into();
523 self
524 }
525 }
526
527 #[doc(hidden)]
528 impl crate::RequestBuilder for UpdateInstance {
529 fn request_options(&mut self) -> &mut crate::RequestOptions {
530 &mut self.0.options
531 }
532 }
533
534 #[derive(Clone, Debug)]
552 pub struct DeleteInstance(RequestBuilder<crate::model::DeleteInstanceRequest>);
553
554 impl DeleteInstance {
555 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
556 Self(RequestBuilder::new(stub))
557 }
558
559 pub fn with_request<V: Into<crate::model::DeleteInstanceRequest>>(mut self, v: V) -> Self {
561 self.0.request = v.into();
562 self
563 }
564
565 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
567 self.0.options = v.into();
568 self
569 }
570
571 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
578 (*self.0.stub)
579 .delete_instance(self.0.request, self.0.options)
580 .await
581 .map(crate::Response::into_body)
582 }
583
584 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
586 type Operation =
587 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
588 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
589 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
590
591 let stub = self.0.stub.clone();
592 let mut options = self.0.options.clone();
593 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
594 let query = move |name| {
595 let stub = stub.clone();
596 let options = options.clone();
597 async {
598 let op = GetOperation::new(stub)
599 .set_name(name)
600 .with_options(options)
601 .send()
602 .await?;
603 Ok(Operation::new(op))
604 }
605 };
606
607 let start = move || async {
608 let op = self.send().await?;
609 Ok(Operation::new(op))
610 };
611
612 google_cloud_lro::internal::new_unit_response_poller(
613 polling_error_policy,
614 polling_backoff_policy,
615 start,
616 query,
617 )
618 }
619
620 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
624 self.0.request.name = v.into();
625 self
626 }
627
628 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
630 self.0.request.request_id = v.into();
631 self
632 }
633 }
634
635 #[doc(hidden)]
636 impl crate::RequestBuilder for DeleteInstance {
637 fn request_options(&mut self) -> &mut crate::RequestOptions {
638 &mut self.0.options
639 }
640 }
641
642 #[derive(Clone, Debug)]
660 pub struct ImportRegisteredParties(
661 RequestBuilder<crate::model::ImportRegisteredPartiesRequest>,
662 );
663
664 impl ImportRegisteredParties {
665 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
666 Self(RequestBuilder::new(stub))
667 }
668
669 pub fn with_request<V: Into<crate::model::ImportRegisteredPartiesRequest>>(
671 mut self,
672 v: V,
673 ) -> Self {
674 self.0.request = v.into();
675 self
676 }
677
678 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
680 self.0.options = v.into();
681 self
682 }
683
684 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
691 (*self.0.stub)
692 .import_registered_parties(self.0.request, self.0.options)
693 .await
694 .map(crate::Response::into_body)
695 }
696
697 pub fn poller(
699 self,
700 ) -> impl google_cloud_lro::Poller<
701 crate::model::ImportRegisteredPartiesResponse,
702 crate::model::OperationMetadata,
703 > {
704 type Operation = google_cloud_lro::internal::Operation<
705 crate::model::ImportRegisteredPartiesResponse,
706 crate::model::OperationMetadata,
707 >;
708 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
709 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
710
711 let stub = self.0.stub.clone();
712 let mut options = self.0.options.clone();
713 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
714 let query = move |name| {
715 let stub = stub.clone();
716 let options = options.clone();
717 async {
718 let op = GetOperation::new(stub)
719 .set_name(name)
720 .with_options(options)
721 .send()
722 .await?;
723 Ok(Operation::new(op))
724 }
725 };
726
727 let start = move || async {
728 let op = self.send().await?;
729 Ok(Operation::new(op))
730 };
731
732 google_cloud_lro::internal::new_poller(
733 polling_error_policy,
734 polling_backoff_policy,
735 start,
736 query,
737 )
738 }
739
740 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
744 self.0.request.name = v.into();
745 self
746 }
747
748 pub fn set_party_tables<T, V>(mut self, v: T) -> Self
750 where
751 T: std::iter::IntoIterator<Item = V>,
752 V: std::convert::Into<std::string::String>,
753 {
754 use std::iter::Iterator;
755 self.0.request.party_tables = v.into_iter().map(|i| i.into()).collect();
756 self
757 }
758
759 pub fn set_mode<T: Into<crate::model::import_registered_parties_request::UpdateMode>>(
763 mut self,
764 v: T,
765 ) -> Self {
766 self.0.request.mode = v.into();
767 self
768 }
769
770 pub fn set_validate_only<T: Into<bool>>(mut self, v: T) -> Self {
772 self.0.request.validate_only = v.into();
773 self
774 }
775
776 pub fn set_line_of_business<T: Into<crate::model::LineOfBusiness>>(mut self, v: T) -> Self {
780 self.0.request.line_of_business = v.into();
781 self
782 }
783 }
784
785 #[doc(hidden)]
786 impl crate::RequestBuilder for ImportRegisteredParties {
787 fn request_options(&mut self) -> &mut crate::RequestOptions {
788 &mut self.0.options
789 }
790 }
791
792 #[derive(Clone, Debug)]
810 pub struct ExportRegisteredParties(
811 RequestBuilder<crate::model::ExportRegisteredPartiesRequest>,
812 );
813
814 impl ExportRegisteredParties {
815 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
816 Self(RequestBuilder::new(stub))
817 }
818
819 pub fn with_request<V: Into<crate::model::ExportRegisteredPartiesRequest>>(
821 mut self,
822 v: V,
823 ) -> Self {
824 self.0.request = v.into();
825 self
826 }
827
828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
830 self.0.options = v.into();
831 self
832 }
833
834 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
841 (*self.0.stub)
842 .export_registered_parties(self.0.request, self.0.options)
843 .await
844 .map(crate::Response::into_body)
845 }
846
847 pub fn poller(
849 self,
850 ) -> impl google_cloud_lro::Poller<
851 crate::model::ExportRegisteredPartiesResponse,
852 crate::model::OperationMetadata,
853 > {
854 type Operation = google_cloud_lro::internal::Operation<
855 crate::model::ExportRegisteredPartiesResponse,
856 crate::model::OperationMetadata,
857 >;
858 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
859 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
860
861 let stub = self.0.stub.clone();
862 let mut options = self.0.options.clone();
863 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
864 let query = move |name| {
865 let stub = stub.clone();
866 let options = options.clone();
867 async {
868 let op = GetOperation::new(stub)
869 .set_name(name)
870 .with_options(options)
871 .send()
872 .await?;
873 Ok(Operation::new(op))
874 }
875 };
876
877 let start = move || async {
878 let op = self.send().await?;
879 Ok(Operation::new(op))
880 };
881
882 google_cloud_lro::internal::new_poller(
883 polling_error_policy,
884 polling_backoff_policy,
885 start,
886 query,
887 )
888 }
889
890 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
894 self.0.request.name = v.into();
895 self
896 }
897
898 pub fn set_dataset<T>(mut self, v: T) -> Self
902 where
903 T: std::convert::Into<crate::model::BigQueryDestination>,
904 {
905 self.0.request.dataset = std::option::Option::Some(v.into());
906 self
907 }
908
909 pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
913 where
914 T: std::convert::Into<crate::model::BigQueryDestination>,
915 {
916 self.0.request.dataset = v.map(|x| x.into());
917 self
918 }
919
920 pub fn set_line_of_business<T: Into<crate::model::LineOfBusiness>>(mut self, v: T) -> Self {
924 self.0.request.line_of_business = v.into();
925 self
926 }
927 }
928
929 #[doc(hidden)]
930 impl crate::RequestBuilder for ExportRegisteredParties {
931 fn request_options(&mut self) -> &mut crate::RequestOptions {
932 &mut self.0.options
933 }
934 }
935
936 #[derive(Clone, Debug)]
957 pub struct ListDatasets(RequestBuilder<crate::model::ListDatasetsRequest>);
958
959 impl ListDatasets {
960 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
961 Self(RequestBuilder::new(stub))
962 }
963
964 pub fn with_request<V: Into<crate::model::ListDatasetsRequest>>(mut self, v: V) -> Self {
966 self.0.request = v.into();
967 self
968 }
969
970 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
972 self.0.options = v.into();
973 self
974 }
975
976 pub async fn send(self) -> Result<crate::model::ListDatasetsResponse> {
978 (*self.0.stub)
979 .list_datasets(self.0.request, self.0.options)
980 .await
981 .map(crate::Response::into_body)
982 }
983
984 pub fn by_page(
986 self,
987 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDatasetsResponse, crate::Error>
988 {
989 use std::clone::Clone;
990 let token = self.0.request.page_token.clone();
991 let execute = move |token: String| {
992 let mut builder = self.clone();
993 builder.0.request = builder.0.request.set_page_token(token);
994 builder.send()
995 };
996 google_cloud_gax::paginator::internal::new_paginator(token, execute)
997 }
998
999 pub fn by_item(
1001 self,
1002 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1003 crate::model::ListDatasetsResponse,
1004 crate::Error,
1005 > {
1006 use google_cloud_gax::paginator::Paginator;
1007 self.by_page().items()
1008 }
1009
1010 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1014 self.0.request.parent = v.into();
1015 self
1016 }
1017
1018 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1020 self.0.request.page_size = v.into();
1021 self
1022 }
1023
1024 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1026 self.0.request.page_token = v.into();
1027 self
1028 }
1029
1030 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032 self.0.request.filter = v.into();
1033 self
1034 }
1035
1036 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.0.request.order_by = v.into();
1039 self
1040 }
1041 }
1042
1043 #[doc(hidden)]
1044 impl crate::RequestBuilder for ListDatasets {
1045 fn request_options(&mut self) -> &mut crate::RequestOptions {
1046 &mut self.0.options
1047 }
1048 }
1049
1050 #[derive(Clone, Debug)]
1067 pub struct GetDataset(RequestBuilder<crate::model::GetDatasetRequest>);
1068
1069 impl GetDataset {
1070 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1071 Self(RequestBuilder::new(stub))
1072 }
1073
1074 pub fn with_request<V: Into<crate::model::GetDatasetRequest>>(mut self, v: V) -> Self {
1076 self.0.request = v.into();
1077 self
1078 }
1079
1080 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1082 self.0.options = v.into();
1083 self
1084 }
1085
1086 pub async fn send(self) -> Result<crate::model::Dataset> {
1088 (*self.0.stub)
1089 .get_dataset(self.0.request, self.0.options)
1090 .await
1091 .map(crate::Response::into_body)
1092 }
1093
1094 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1098 self.0.request.name = v.into();
1099 self
1100 }
1101 }
1102
1103 #[doc(hidden)]
1104 impl crate::RequestBuilder for GetDataset {
1105 fn request_options(&mut self) -> &mut crate::RequestOptions {
1106 &mut self.0.options
1107 }
1108 }
1109
1110 #[derive(Clone, Debug)]
1128 pub struct CreateDataset(RequestBuilder<crate::model::CreateDatasetRequest>);
1129
1130 impl CreateDataset {
1131 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1132 Self(RequestBuilder::new(stub))
1133 }
1134
1135 pub fn with_request<V: Into<crate::model::CreateDatasetRequest>>(mut self, v: V) -> Self {
1137 self.0.request = v.into();
1138 self
1139 }
1140
1141 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1143 self.0.options = v.into();
1144 self
1145 }
1146
1147 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1154 (*self.0.stub)
1155 .create_dataset(self.0.request, self.0.options)
1156 .await
1157 .map(crate::Response::into_body)
1158 }
1159
1160 pub fn poller(
1162 self,
1163 ) -> impl google_cloud_lro::Poller<crate::model::Dataset, crate::model::OperationMetadata>
1164 {
1165 type Operation = google_cloud_lro::internal::Operation<
1166 crate::model::Dataset,
1167 crate::model::OperationMetadata,
1168 >;
1169 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1170 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1171
1172 let stub = self.0.stub.clone();
1173 let mut options = self.0.options.clone();
1174 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1175 let query = move |name| {
1176 let stub = stub.clone();
1177 let options = options.clone();
1178 async {
1179 let op = GetOperation::new(stub)
1180 .set_name(name)
1181 .with_options(options)
1182 .send()
1183 .await?;
1184 Ok(Operation::new(op))
1185 }
1186 };
1187
1188 let start = move || async {
1189 let op = self.send().await?;
1190 Ok(Operation::new(op))
1191 };
1192
1193 google_cloud_lro::internal::new_poller(
1194 polling_error_policy,
1195 polling_backoff_policy,
1196 start,
1197 query,
1198 )
1199 }
1200
1201 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1205 self.0.request.parent = v.into();
1206 self
1207 }
1208
1209 pub fn set_dataset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1213 self.0.request.dataset_id = v.into();
1214 self
1215 }
1216
1217 pub fn set_dataset<T>(mut self, v: T) -> Self
1221 where
1222 T: std::convert::Into<crate::model::Dataset>,
1223 {
1224 self.0.request.dataset = std::option::Option::Some(v.into());
1225 self
1226 }
1227
1228 pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
1232 where
1233 T: std::convert::Into<crate::model::Dataset>,
1234 {
1235 self.0.request.dataset = v.map(|x| x.into());
1236 self
1237 }
1238
1239 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1241 self.0.request.request_id = v.into();
1242 self
1243 }
1244 }
1245
1246 #[doc(hidden)]
1247 impl crate::RequestBuilder for CreateDataset {
1248 fn request_options(&mut self) -> &mut crate::RequestOptions {
1249 &mut self.0.options
1250 }
1251 }
1252
1253 #[derive(Clone, Debug)]
1271 pub struct UpdateDataset(RequestBuilder<crate::model::UpdateDatasetRequest>);
1272
1273 impl UpdateDataset {
1274 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1275 Self(RequestBuilder::new(stub))
1276 }
1277
1278 pub fn with_request<V: Into<crate::model::UpdateDatasetRequest>>(mut self, v: V) -> Self {
1280 self.0.request = v.into();
1281 self
1282 }
1283
1284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1286 self.0.options = v.into();
1287 self
1288 }
1289
1290 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1297 (*self.0.stub)
1298 .update_dataset(self.0.request, self.0.options)
1299 .await
1300 .map(crate::Response::into_body)
1301 }
1302
1303 pub fn poller(
1305 self,
1306 ) -> impl google_cloud_lro::Poller<crate::model::Dataset, crate::model::OperationMetadata>
1307 {
1308 type Operation = google_cloud_lro::internal::Operation<
1309 crate::model::Dataset,
1310 crate::model::OperationMetadata,
1311 >;
1312 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1313 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1314
1315 let stub = self.0.stub.clone();
1316 let mut options = self.0.options.clone();
1317 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1318 let query = move |name| {
1319 let stub = stub.clone();
1320 let options = options.clone();
1321 async {
1322 let op = GetOperation::new(stub)
1323 .set_name(name)
1324 .with_options(options)
1325 .send()
1326 .await?;
1327 Ok(Operation::new(op))
1328 }
1329 };
1330
1331 let start = move || async {
1332 let op = self.send().await?;
1333 Ok(Operation::new(op))
1334 };
1335
1336 google_cloud_lro::internal::new_poller(
1337 polling_error_policy,
1338 polling_backoff_policy,
1339 start,
1340 query,
1341 )
1342 }
1343
1344 pub fn set_update_mask<T>(mut self, v: T) -> Self
1346 where
1347 T: std::convert::Into<wkt::FieldMask>,
1348 {
1349 self.0.request.update_mask = std::option::Option::Some(v.into());
1350 self
1351 }
1352
1353 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1355 where
1356 T: std::convert::Into<wkt::FieldMask>,
1357 {
1358 self.0.request.update_mask = v.map(|x| x.into());
1359 self
1360 }
1361
1362 pub fn set_dataset<T>(mut self, v: T) -> Self
1366 where
1367 T: std::convert::Into<crate::model::Dataset>,
1368 {
1369 self.0.request.dataset = std::option::Option::Some(v.into());
1370 self
1371 }
1372
1373 pub fn set_or_clear_dataset<T>(mut self, v: std::option::Option<T>) -> Self
1377 where
1378 T: std::convert::Into<crate::model::Dataset>,
1379 {
1380 self.0.request.dataset = v.map(|x| x.into());
1381 self
1382 }
1383
1384 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1386 self.0.request.request_id = v.into();
1387 self
1388 }
1389 }
1390
1391 #[doc(hidden)]
1392 impl crate::RequestBuilder for UpdateDataset {
1393 fn request_options(&mut self) -> &mut crate::RequestOptions {
1394 &mut self.0.options
1395 }
1396 }
1397
1398 #[derive(Clone, Debug)]
1416 pub struct DeleteDataset(RequestBuilder<crate::model::DeleteDatasetRequest>);
1417
1418 impl DeleteDataset {
1419 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1420 Self(RequestBuilder::new(stub))
1421 }
1422
1423 pub fn with_request<V: Into<crate::model::DeleteDatasetRequest>>(mut self, v: V) -> Self {
1425 self.0.request = v.into();
1426 self
1427 }
1428
1429 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1431 self.0.options = v.into();
1432 self
1433 }
1434
1435 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1442 (*self.0.stub)
1443 .delete_dataset(self.0.request, self.0.options)
1444 .await
1445 .map(crate::Response::into_body)
1446 }
1447
1448 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
1450 type Operation =
1451 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
1452 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1453 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1454
1455 let stub = self.0.stub.clone();
1456 let mut options = self.0.options.clone();
1457 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1458 let query = move |name| {
1459 let stub = stub.clone();
1460 let options = options.clone();
1461 async {
1462 let op = GetOperation::new(stub)
1463 .set_name(name)
1464 .with_options(options)
1465 .send()
1466 .await?;
1467 Ok(Operation::new(op))
1468 }
1469 };
1470
1471 let start = move || async {
1472 let op = self.send().await?;
1473 Ok(Operation::new(op))
1474 };
1475
1476 google_cloud_lro::internal::new_unit_response_poller(
1477 polling_error_policy,
1478 polling_backoff_policy,
1479 start,
1480 query,
1481 )
1482 }
1483
1484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1488 self.0.request.name = v.into();
1489 self
1490 }
1491
1492 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1494 self.0.request.request_id = v.into();
1495 self
1496 }
1497 }
1498
1499 #[doc(hidden)]
1500 impl crate::RequestBuilder for DeleteDataset {
1501 fn request_options(&mut self) -> &mut crate::RequestOptions {
1502 &mut self.0.options
1503 }
1504 }
1505
1506 #[derive(Clone, Debug)]
1527 pub struct ListModels(RequestBuilder<crate::model::ListModelsRequest>);
1528
1529 impl ListModels {
1530 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1531 Self(RequestBuilder::new(stub))
1532 }
1533
1534 pub fn with_request<V: Into<crate::model::ListModelsRequest>>(mut self, v: V) -> Self {
1536 self.0.request = v.into();
1537 self
1538 }
1539
1540 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1542 self.0.options = v.into();
1543 self
1544 }
1545
1546 pub async fn send(self) -> Result<crate::model::ListModelsResponse> {
1548 (*self.0.stub)
1549 .list_models(self.0.request, self.0.options)
1550 .await
1551 .map(crate::Response::into_body)
1552 }
1553
1554 pub fn by_page(
1556 self,
1557 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListModelsResponse, crate::Error>
1558 {
1559 use std::clone::Clone;
1560 let token = self.0.request.page_token.clone();
1561 let execute = move |token: String| {
1562 let mut builder = self.clone();
1563 builder.0.request = builder.0.request.set_page_token(token);
1564 builder.send()
1565 };
1566 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1567 }
1568
1569 pub fn by_item(
1571 self,
1572 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1573 crate::model::ListModelsResponse,
1574 crate::Error,
1575 > {
1576 use google_cloud_gax::paginator::Paginator;
1577 self.by_page().items()
1578 }
1579
1580 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1584 self.0.request.parent = v.into();
1585 self
1586 }
1587
1588 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1590 self.0.request.page_size = v.into();
1591 self
1592 }
1593
1594 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1596 self.0.request.page_token = v.into();
1597 self
1598 }
1599
1600 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1602 self.0.request.filter = v.into();
1603 self
1604 }
1605
1606 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1608 self.0.request.order_by = v.into();
1609 self
1610 }
1611 }
1612
1613 #[doc(hidden)]
1614 impl crate::RequestBuilder for ListModels {
1615 fn request_options(&mut self) -> &mut crate::RequestOptions {
1616 &mut self.0.options
1617 }
1618 }
1619
1620 #[derive(Clone, Debug)]
1637 pub struct GetModel(RequestBuilder<crate::model::GetModelRequest>);
1638
1639 impl GetModel {
1640 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1641 Self(RequestBuilder::new(stub))
1642 }
1643
1644 pub fn with_request<V: Into<crate::model::GetModelRequest>>(mut self, v: V) -> Self {
1646 self.0.request = v.into();
1647 self
1648 }
1649
1650 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1652 self.0.options = v.into();
1653 self
1654 }
1655
1656 pub async fn send(self) -> Result<crate::model::Model> {
1658 (*self.0.stub)
1659 .get_model(self.0.request, self.0.options)
1660 .await
1661 .map(crate::Response::into_body)
1662 }
1663
1664 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1668 self.0.request.name = v.into();
1669 self
1670 }
1671 }
1672
1673 #[doc(hidden)]
1674 impl crate::RequestBuilder for GetModel {
1675 fn request_options(&mut self) -> &mut crate::RequestOptions {
1676 &mut self.0.options
1677 }
1678 }
1679
1680 #[derive(Clone, Debug)]
1698 pub struct CreateModel(RequestBuilder<crate::model::CreateModelRequest>);
1699
1700 impl CreateModel {
1701 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1702 Self(RequestBuilder::new(stub))
1703 }
1704
1705 pub fn with_request<V: Into<crate::model::CreateModelRequest>>(mut self, v: V) -> Self {
1707 self.0.request = v.into();
1708 self
1709 }
1710
1711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1713 self.0.options = v.into();
1714 self
1715 }
1716
1717 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1724 (*self.0.stub)
1725 .create_model(self.0.request, self.0.options)
1726 .await
1727 .map(crate::Response::into_body)
1728 }
1729
1730 pub fn poller(
1732 self,
1733 ) -> impl google_cloud_lro::Poller<crate::model::Model, crate::model::OperationMetadata>
1734 {
1735 type Operation = google_cloud_lro::internal::Operation<
1736 crate::model::Model,
1737 crate::model::OperationMetadata,
1738 >;
1739 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1740 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1741
1742 let stub = self.0.stub.clone();
1743 let mut options = self.0.options.clone();
1744 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1745 let query = move |name| {
1746 let stub = stub.clone();
1747 let options = options.clone();
1748 async {
1749 let op = GetOperation::new(stub)
1750 .set_name(name)
1751 .with_options(options)
1752 .send()
1753 .await?;
1754 Ok(Operation::new(op))
1755 }
1756 };
1757
1758 let start = move || async {
1759 let op = self.send().await?;
1760 Ok(Operation::new(op))
1761 };
1762
1763 google_cloud_lro::internal::new_poller(
1764 polling_error_policy,
1765 polling_backoff_policy,
1766 start,
1767 query,
1768 )
1769 }
1770
1771 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1775 self.0.request.parent = v.into();
1776 self
1777 }
1778
1779 pub fn set_model_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1783 self.0.request.model_id = v.into();
1784 self
1785 }
1786
1787 pub fn set_model<T>(mut self, v: T) -> Self
1791 where
1792 T: std::convert::Into<crate::model::Model>,
1793 {
1794 self.0.request.model = std::option::Option::Some(v.into());
1795 self
1796 }
1797
1798 pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
1802 where
1803 T: std::convert::Into<crate::model::Model>,
1804 {
1805 self.0.request.model = v.map(|x| x.into());
1806 self
1807 }
1808
1809 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1811 self.0.request.request_id = v.into();
1812 self
1813 }
1814 }
1815
1816 #[doc(hidden)]
1817 impl crate::RequestBuilder for CreateModel {
1818 fn request_options(&mut self) -> &mut crate::RequestOptions {
1819 &mut self.0.options
1820 }
1821 }
1822
1823 #[derive(Clone, Debug)]
1841 pub struct UpdateModel(RequestBuilder<crate::model::UpdateModelRequest>);
1842
1843 impl UpdateModel {
1844 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1845 Self(RequestBuilder::new(stub))
1846 }
1847
1848 pub fn with_request<V: Into<crate::model::UpdateModelRequest>>(mut self, v: V) -> Self {
1850 self.0.request = v.into();
1851 self
1852 }
1853
1854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1856 self.0.options = v.into();
1857 self
1858 }
1859
1860 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1867 (*self.0.stub)
1868 .update_model(self.0.request, self.0.options)
1869 .await
1870 .map(crate::Response::into_body)
1871 }
1872
1873 pub fn poller(
1875 self,
1876 ) -> impl google_cloud_lro::Poller<crate::model::Model, crate::model::OperationMetadata>
1877 {
1878 type Operation = google_cloud_lro::internal::Operation<
1879 crate::model::Model,
1880 crate::model::OperationMetadata,
1881 >;
1882 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
1883 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
1884
1885 let stub = self.0.stub.clone();
1886 let mut options = self.0.options.clone();
1887 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
1888 let query = move |name| {
1889 let stub = stub.clone();
1890 let options = options.clone();
1891 async {
1892 let op = GetOperation::new(stub)
1893 .set_name(name)
1894 .with_options(options)
1895 .send()
1896 .await?;
1897 Ok(Operation::new(op))
1898 }
1899 };
1900
1901 let start = move || async {
1902 let op = self.send().await?;
1903 Ok(Operation::new(op))
1904 };
1905
1906 google_cloud_lro::internal::new_poller(
1907 polling_error_policy,
1908 polling_backoff_policy,
1909 start,
1910 query,
1911 )
1912 }
1913
1914 pub fn set_update_mask<T>(mut self, v: T) -> Self
1916 where
1917 T: std::convert::Into<wkt::FieldMask>,
1918 {
1919 self.0.request.update_mask = std::option::Option::Some(v.into());
1920 self
1921 }
1922
1923 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1925 where
1926 T: std::convert::Into<wkt::FieldMask>,
1927 {
1928 self.0.request.update_mask = v.map(|x| x.into());
1929 self
1930 }
1931
1932 pub fn set_model<T>(mut self, v: T) -> Self
1936 where
1937 T: std::convert::Into<crate::model::Model>,
1938 {
1939 self.0.request.model = std::option::Option::Some(v.into());
1940 self
1941 }
1942
1943 pub fn set_or_clear_model<T>(mut self, v: std::option::Option<T>) -> Self
1947 where
1948 T: std::convert::Into<crate::model::Model>,
1949 {
1950 self.0.request.model = v.map(|x| x.into());
1951 self
1952 }
1953
1954 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1956 self.0.request.request_id = v.into();
1957 self
1958 }
1959 }
1960
1961 #[doc(hidden)]
1962 impl crate::RequestBuilder for UpdateModel {
1963 fn request_options(&mut self) -> &mut crate::RequestOptions {
1964 &mut self.0.options
1965 }
1966 }
1967
1968 #[derive(Clone, Debug)]
1986 pub struct ExportModelMetadata(RequestBuilder<crate::model::ExportModelMetadataRequest>);
1987
1988 impl ExportModelMetadata {
1989 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
1990 Self(RequestBuilder::new(stub))
1991 }
1992
1993 pub fn with_request<V: Into<crate::model::ExportModelMetadataRequest>>(
1995 mut self,
1996 v: V,
1997 ) -> Self {
1998 self.0.request = v.into();
1999 self
2000 }
2001
2002 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2004 self.0.options = v.into();
2005 self
2006 }
2007
2008 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2015 (*self.0.stub)
2016 .export_model_metadata(self.0.request, self.0.options)
2017 .await
2018 .map(crate::Response::into_body)
2019 }
2020
2021 pub fn poller(
2023 self,
2024 ) -> impl google_cloud_lro::Poller<
2025 crate::model::ExportModelMetadataResponse,
2026 crate::model::OperationMetadata,
2027 > {
2028 type Operation = google_cloud_lro::internal::Operation<
2029 crate::model::ExportModelMetadataResponse,
2030 crate::model::OperationMetadata,
2031 >;
2032 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2033 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2034
2035 let stub = self.0.stub.clone();
2036 let mut options = self.0.options.clone();
2037 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2038 let query = move |name| {
2039 let stub = stub.clone();
2040 let options = options.clone();
2041 async {
2042 let op = GetOperation::new(stub)
2043 .set_name(name)
2044 .with_options(options)
2045 .send()
2046 .await?;
2047 Ok(Operation::new(op))
2048 }
2049 };
2050
2051 let start = move || async {
2052 let op = self.send().await?;
2053 Ok(Operation::new(op))
2054 };
2055
2056 google_cloud_lro::internal::new_poller(
2057 polling_error_policy,
2058 polling_backoff_policy,
2059 start,
2060 query,
2061 )
2062 }
2063
2064 pub fn set_model<T: Into<std::string::String>>(mut self, v: T) -> Self {
2068 self.0.request.model = v.into();
2069 self
2070 }
2071
2072 pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
2076 where
2077 T: std::convert::Into<crate::model::BigQueryDestination>,
2078 {
2079 self.0.request.structured_metadata_destination = std::option::Option::Some(v.into());
2080 self
2081 }
2082
2083 pub fn set_or_clear_structured_metadata_destination<T>(
2087 mut self,
2088 v: std::option::Option<T>,
2089 ) -> Self
2090 where
2091 T: std::convert::Into<crate::model::BigQueryDestination>,
2092 {
2093 self.0.request.structured_metadata_destination = v.map(|x| x.into());
2094 self
2095 }
2096 }
2097
2098 #[doc(hidden)]
2099 impl crate::RequestBuilder for ExportModelMetadata {
2100 fn request_options(&mut self) -> &mut crate::RequestOptions {
2101 &mut self.0.options
2102 }
2103 }
2104
2105 #[derive(Clone, Debug)]
2123 pub struct DeleteModel(RequestBuilder<crate::model::DeleteModelRequest>);
2124
2125 impl DeleteModel {
2126 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2127 Self(RequestBuilder::new(stub))
2128 }
2129
2130 pub fn with_request<V: Into<crate::model::DeleteModelRequest>>(mut self, v: V) -> Self {
2132 self.0.request = v.into();
2133 self
2134 }
2135
2136 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2138 self.0.options = v.into();
2139 self
2140 }
2141
2142 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2149 (*self.0.stub)
2150 .delete_model(self.0.request, self.0.options)
2151 .await
2152 .map(crate::Response::into_body)
2153 }
2154
2155 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2157 type Operation =
2158 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2159 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2160 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2161
2162 let stub = self.0.stub.clone();
2163 let mut options = self.0.options.clone();
2164 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2165 let query = move |name| {
2166 let stub = stub.clone();
2167 let options = options.clone();
2168 async {
2169 let op = GetOperation::new(stub)
2170 .set_name(name)
2171 .with_options(options)
2172 .send()
2173 .await?;
2174 Ok(Operation::new(op))
2175 }
2176 };
2177
2178 let start = move || async {
2179 let op = self.send().await?;
2180 Ok(Operation::new(op))
2181 };
2182
2183 google_cloud_lro::internal::new_unit_response_poller(
2184 polling_error_policy,
2185 polling_backoff_policy,
2186 start,
2187 query,
2188 )
2189 }
2190
2191 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2195 self.0.request.name = v.into();
2196 self
2197 }
2198
2199 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2201 self.0.request.request_id = v.into();
2202 self
2203 }
2204 }
2205
2206 #[doc(hidden)]
2207 impl crate::RequestBuilder for DeleteModel {
2208 fn request_options(&mut self) -> &mut crate::RequestOptions {
2209 &mut self.0.options
2210 }
2211 }
2212
2213 #[derive(Clone, Debug)]
2234 pub struct ListEngineConfigs(RequestBuilder<crate::model::ListEngineConfigsRequest>);
2235
2236 impl ListEngineConfigs {
2237 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2238 Self(RequestBuilder::new(stub))
2239 }
2240
2241 pub fn with_request<V: Into<crate::model::ListEngineConfigsRequest>>(
2243 mut self,
2244 v: V,
2245 ) -> Self {
2246 self.0.request = v.into();
2247 self
2248 }
2249
2250 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2252 self.0.options = v.into();
2253 self
2254 }
2255
2256 pub async fn send(self) -> Result<crate::model::ListEngineConfigsResponse> {
2258 (*self.0.stub)
2259 .list_engine_configs(self.0.request, self.0.options)
2260 .await
2261 .map(crate::Response::into_body)
2262 }
2263
2264 pub fn by_page(
2266 self,
2267 ) -> impl google_cloud_gax::paginator::Paginator<
2268 crate::model::ListEngineConfigsResponse,
2269 crate::Error,
2270 > {
2271 use std::clone::Clone;
2272 let token = self.0.request.page_token.clone();
2273 let execute = move |token: String| {
2274 let mut builder = self.clone();
2275 builder.0.request = builder.0.request.set_page_token(token);
2276 builder.send()
2277 };
2278 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2279 }
2280
2281 pub fn by_item(
2283 self,
2284 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2285 crate::model::ListEngineConfigsResponse,
2286 crate::Error,
2287 > {
2288 use google_cloud_gax::paginator::Paginator;
2289 self.by_page().items()
2290 }
2291
2292 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2296 self.0.request.parent = v.into();
2297 self
2298 }
2299
2300 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2302 self.0.request.page_size = v.into();
2303 self
2304 }
2305
2306 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2308 self.0.request.page_token = v.into();
2309 self
2310 }
2311
2312 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2314 self.0.request.filter = v.into();
2315 self
2316 }
2317
2318 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2320 self.0.request.order_by = v.into();
2321 self
2322 }
2323 }
2324
2325 #[doc(hidden)]
2326 impl crate::RequestBuilder for ListEngineConfigs {
2327 fn request_options(&mut self) -> &mut crate::RequestOptions {
2328 &mut self.0.options
2329 }
2330 }
2331
2332 #[derive(Clone, Debug)]
2349 pub struct GetEngineConfig(RequestBuilder<crate::model::GetEngineConfigRequest>);
2350
2351 impl GetEngineConfig {
2352 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2353 Self(RequestBuilder::new(stub))
2354 }
2355
2356 pub fn with_request<V: Into<crate::model::GetEngineConfigRequest>>(mut self, v: V) -> Self {
2358 self.0.request = v.into();
2359 self
2360 }
2361
2362 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2364 self.0.options = v.into();
2365 self
2366 }
2367
2368 pub async fn send(self) -> Result<crate::model::EngineConfig> {
2370 (*self.0.stub)
2371 .get_engine_config(self.0.request, self.0.options)
2372 .await
2373 .map(crate::Response::into_body)
2374 }
2375
2376 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2380 self.0.request.name = v.into();
2381 self
2382 }
2383 }
2384
2385 #[doc(hidden)]
2386 impl crate::RequestBuilder for GetEngineConfig {
2387 fn request_options(&mut self) -> &mut crate::RequestOptions {
2388 &mut self.0.options
2389 }
2390 }
2391
2392 #[derive(Clone, Debug)]
2410 pub struct CreateEngineConfig(RequestBuilder<crate::model::CreateEngineConfigRequest>);
2411
2412 impl CreateEngineConfig {
2413 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2414 Self(RequestBuilder::new(stub))
2415 }
2416
2417 pub fn with_request<V: Into<crate::model::CreateEngineConfigRequest>>(
2419 mut self,
2420 v: V,
2421 ) -> Self {
2422 self.0.request = v.into();
2423 self
2424 }
2425
2426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2428 self.0.options = v.into();
2429 self
2430 }
2431
2432 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2439 (*self.0.stub)
2440 .create_engine_config(self.0.request, self.0.options)
2441 .await
2442 .map(crate::Response::into_body)
2443 }
2444
2445 pub fn poller(
2447 self,
2448 ) -> impl google_cloud_lro::Poller<crate::model::EngineConfig, crate::model::OperationMetadata>
2449 {
2450 type Operation = google_cloud_lro::internal::Operation<
2451 crate::model::EngineConfig,
2452 crate::model::OperationMetadata,
2453 >;
2454 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2455 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2456
2457 let stub = self.0.stub.clone();
2458 let mut options = self.0.options.clone();
2459 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2460 let query = move |name| {
2461 let stub = stub.clone();
2462 let options = options.clone();
2463 async {
2464 let op = GetOperation::new(stub)
2465 .set_name(name)
2466 .with_options(options)
2467 .send()
2468 .await?;
2469 Ok(Operation::new(op))
2470 }
2471 };
2472
2473 let start = move || async {
2474 let op = self.send().await?;
2475 Ok(Operation::new(op))
2476 };
2477
2478 google_cloud_lro::internal::new_poller(
2479 polling_error_policy,
2480 polling_backoff_policy,
2481 start,
2482 query,
2483 )
2484 }
2485
2486 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2490 self.0.request.parent = v.into();
2491 self
2492 }
2493
2494 pub fn set_engine_config_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2498 self.0.request.engine_config_id = v.into();
2499 self
2500 }
2501
2502 pub fn set_engine_config<T>(mut self, v: T) -> Self
2506 where
2507 T: std::convert::Into<crate::model::EngineConfig>,
2508 {
2509 self.0.request.engine_config = std::option::Option::Some(v.into());
2510 self
2511 }
2512
2513 pub fn set_or_clear_engine_config<T>(mut self, v: std::option::Option<T>) -> Self
2517 where
2518 T: std::convert::Into<crate::model::EngineConfig>,
2519 {
2520 self.0.request.engine_config = v.map(|x| x.into());
2521 self
2522 }
2523
2524 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2526 self.0.request.request_id = v.into();
2527 self
2528 }
2529 }
2530
2531 #[doc(hidden)]
2532 impl crate::RequestBuilder for CreateEngineConfig {
2533 fn request_options(&mut self) -> &mut crate::RequestOptions {
2534 &mut self.0.options
2535 }
2536 }
2537
2538 #[derive(Clone, Debug)]
2556 pub struct UpdateEngineConfig(RequestBuilder<crate::model::UpdateEngineConfigRequest>);
2557
2558 impl UpdateEngineConfig {
2559 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2560 Self(RequestBuilder::new(stub))
2561 }
2562
2563 pub fn with_request<V: Into<crate::model::UpdateEngineConfigRequest>>(
2565 mut self,
2566 v: V,
2567 ) -> Self {
2568 self.0.request = v.into();
2569 self
2570 }
2571
2572 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2574 self.0.options = v.into();
2575 self
2576 }
2577
2578 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2585 (*self.0.stub)
2586 .update_engine_config(self.0.request, self.0.options)
2587 .await
2588 .map(crate::Response::into_body)
2589 }
2590
2591 pub fn poller(
2593 self,
2594 ) -> impl google_cloud_lro::Poller<crate::model::EngineConfig, crate::model::OperationMetadata>
2595 {
2596 type Operation = google_cloud_lro::internal::Operation<
2597 crate::model::EngineConfig,
2598 crate::model::OperationMetadata,
2599 >;
2600 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2601 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2602
2603 let stub = self.0.stub.clone();
2604 let mut options = self.0.options.clone();
2605 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2606 let query = move |name| {
2607 let stub = stub.clone();
2608 let options = options.clone();
2609 async {
2610 let op = GetOperation::new(stub)
2611 .set_name(name)
2612 .with_options(options)
2613 .send()
2614 .await?;
2615 Ok(Operation::new(op))
2616 }
2617 };
2618
2619 let start = move || async {
2620 let op = self.send().await?;
2621 Ok(Operation::new(op))
2622 };
2623
2624 google_cloud_lro::internal::new_poller(
2625 polling_error_policy,
2626 polling_backoff_policy,
2627 start,
2628 query,
2629 )
2630 }
2631
2632 pub fn set_update_mask<T>(mut self, v: T) -> Self
2634 where
2635 T: std::convert::Into<wkt::FieldMask>,
2636 {
2637 self.0.request.update_mask = std::option::Option::Some(v.into());
2638 self
2639 }
2640
2641 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2643 where
2644 T: std::convert::Into<wkt::FieldMask>,
2645 {
2646 self.0.request.update_mask = v.map(|x| x.into());
2647 self
2648 }
2649
2650 pub fn set_engine_config<T>(mut self, v: T) -> Self
2654 where
2655 T: std::convert::Into<crate::model::EngineConfig>,
2656 {
2657 self.0.request.engine_config = std::option::Option::Some(v.into());
2658 self
2659 }
2660
2661 pub fn set_or_clear_engine_config<T>(mut self, v: std::option::Option<T>) -> Self
2665 where
2666 T: std::convert::Into<crate::model::EngineConfig>,
2667 {
2668 self.0.request.engine_config = v.map(|x| x.into());
2669 self
2670 }
2671
2672 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2674 self.0.request.request_id = v.into();
2675 self
2676 }
2677 }
2678
2679 #[doc(hidden)]
2680 impl crate::RequestBuilder for UpdateEngineConfig {
2681 fn request_options(&mut self) -> &mut crate::RequestOptions {
2682 &mut self.0.options
2683 }
2684 }
2685
2686 #[derive(Clone, Debug)]
2704 pub struct ExportEngineConfigMetadata(
2705 RequestBuilder<crate::model::ExportEngineConfigMetadataRequest>,
2706 );
2707
2708 impl ExportEngineConfigMetadata {
2709 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2710 Self(RequestBuilder::new(stub))
2711 }
2712
2713 pub fn with_request<V: Into<crate::model::ExportEngineConfigMetadataRequest>>(
2715 mut self,
2716 v: V,
2717 ) -> Self {
2718 self.0.request = v.into();
2719 self
2720 }
2721
2722 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2724 self.0.options = v.into();
2725 self
2726 }
2727
2728 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2735 (*self.0.stub)
2736 .export_engine_config_metadata(self.0.request, self.0.options)
2737 .await
2738 .map(crate::Response::into_body)
2739 }
2740
2741 pub fn poller(
2743 self,
2744 ) -> impl google_cloud_lro::Poller<
2745 crate::model::ExportEngineConfigMetadataResponse,
2746 crate::model::OperationMetadata,
2747 > {
2748 type Operation = google_cloud_lro::internal::Operation<
2749 crate::model::ExportEngineConfigMetadataResponse,
2750 crate::model::OperationMetadata,
2751 >;
2752 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2753 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2754
2755 let stub = self.0.stub.clone();
2756 let mut options = self.0.options.clone();
2757 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2758 let query = move |name| {
2759 let stub = stub.clone();
2760 let options = options.clone();
2761 async {
2762 let op = GetOperation::new(stub)
2763 .set_name(name)
2764 .with_options(options)
2765 .send()
2766 .await?;
2767 Ok(Operation::new(op))
2768 }
2769 };
2770
2771 let start = move || async {
2772 let op = self.send().await?;
2773 Ok(Operation::new(op))
2774 };
2775
2776 google_cloud_lro::internal::new_poller(
2777 polling_error_policy,
2778 polling_backoff_policy,
2779 start,
2780 query,
2781 )
2782 }
2783
2784 pub fn set_engine_config<T: Into<std::string::String>>(mut self, v: T) -> Self {
2788 self.0.request.engine_config = v.into();
2789 self
2790 }
2791
2792 pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
2796 where
2797 T: std::convert::Into<crate::model::BigQueryDestination>,
2798 {
2799 self.0.request.structured_metadata_destination = std::option::Option::Some(v.into());
2800 self
2801 }
2802
2803 pub fn set_or_clear_structured_metadata_destination<T>(
2807 mut self,
2808 v: std::option::Option<T>,
2809 ) -> Self
2810 where
2811 T: std::convert::Into<crate::model::BigQueryDestination>,
2812 {
2813 self.0.request.structured_metadata_destination = v.map(|x| x.into());
2814 self
2815 }
2816 }
2817
2818 #[doc(hidden)]
2819 impl crate::RequestBuilder for ExportEngineConfigMetadata {
2820 fn request_options(&mut self) -> &mut crate::RequestOptions {
2821 &mut self.0.options
2822 }
2823 }
2824
2825 #[derive(Clone, Debug)]
2843 pub struct DeleteEngineConfig(RequestBuilder<crate::model::DeleteEngineConfigRequest>);
2844
2845 impl DeleteEngineConfig {
2846 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2847 Self(RequestBuilder::new(stub))
2848 }
2849
2850 pub fn with_request<V: Into<crate::model::DeleteEngineConfigRequest>>(
2852 mut self,
2853 v: V,
2854 ) -> Self {
2855 self.0.request = v.into();
2856 self
2857 }
2858
2859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2861 self.0.options = v.into();
2862 self
2863 }
2864
2865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2872 (*self.0.stub)
2873 .delete_engine_config(self.0.request, self.0.options)
2874 .await
2875 .map(crate::Response::into_body)
2876 }
2877
2878 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
2880 type Operation =
2881 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
2882 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2883 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2884
2885 let stub = self.0.stub.clone();
2886 let mut options = self.0.options.clone();
2887 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2888 let query = move |name| {
2889 let stub = stub.clone();
2890 let options = options.clone();
2891 async {
2892 let op = GetOperation::new(stub)
2893 .set_name(name)
2894 .with_options(options)
2895 .send()
2896 .await?;
2897 Ok(Operation::new(op))
2898 }
2899 };
2900
2901 let start = move || async {
2902 let op = self.send().await?;
2903 Ok(Operation::new(op))
2904 };
2905
2906 google_cloud_lro::internal::new_unit_response_poller(
2907 polling_error_policy,
2908 polling_backoff_policy,
2909 start,
2910 query,
2911 )
2912 }
2913
2914 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2918 self.0.request.name = v.into();
2919 self
2920 }
2921
2922 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2924 self.0.request.request_id = v.into();
2925 self
2926 }
2927 }
2928
2929 #[doc(hidden)]
2930 impl crate::RequestBuilder for DeleteEngineConfig {
2931 fn request_options(&mut self) -> &mut crate::RequestOptions {
2932 &mut self.0.options
2933 }
2934 }
2935
2936 #[derive(Clone, Debug)]
2953 pub struct GetEngineVersion(RequestBuilder<crate::model::GetEngineVersionRequest>);
2954
2955 impl GetEngineVersion {
2956 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
2957 Self(RequestBuilder::new(stub))
2958 }
2959
2960 pub fn with_request<V: Into<crate::model::GetEngineVersionRequest>>(
2962 mut self,
2963 v: V,
2964 ) -> Self {
2965 self.0.request = v.into();
2966 self
2967 }
2968
2969 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2971 self.0.options = v.into();
2972 self
2973 }
2974
2975 pub async fn send(self) -> Result<crate::model::EngineVersion> {
2977 (*self.0.stub)
2978 .get_engine_version(self.0.request, self.0.options)
2979 .await
2980 .map(crate::Response::into_body)
2981 }
2982
2983 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2987 self.0.request.name = v.into();
2988 self
2989 }
2990 }
2991
2992 #[doc(hidden)]
2993 impl crate::RequestBuilder for GetEngineVersion {
2994 fn request_options(&mut self) -> &mut crate::RequestOptions {
2995 &mut self.0.options
2996 }
2997 }
2998
2999 #[derive(Clone, Debug)]
3020 pub struct ListEngineVersions(RequestBuilder<crate::model::ListEngineVersionsRequest>);
3021
3022 impl ListEngineVersions {
3023 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3024 Self(RequestBuilder::new(stub))
3025 }
3026
3027 pub fn with_request<V: Into<crate::model::ListEngineVersionsRequest>>(
3029 mut self,
3030 v: V,
3031 ) -> Self {
3032 self.0.request = v.into();
3033 self
3034 }
3035
3036 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3038 self.0.options = v.into();
3039 self
3040 }
3041
3042 pub async fn send(self) -> Result<crate::model::ListEngineVersionsResponse> {
3044 (*self.0.stub)
3045 .list_engine_versions(self.0.request, self.0.options)
3046 .await
3047 .map(crate::Response::into_body)
3048 }
3049
3050 pub fn by_page(
3052 self,
3053 ) -> impl google_cloud_gax::paginator::Paginator<
3054 crate::model::ListEngineVersionsResponse,
3055 crate::Error,
3056 > {
3057 use std::clone::Clone;
3058 let token = self.0.request.page_token.clone();
3059 let execute = move |token: String| {
3060 let mut builder = self.clone();
3061 builder.0.request = builder.0.request.set_page_token(token);
3062 builder.send()
3063 };
3064 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3065 }
3066
3067 pub fn by_item(
3069 self,
3070 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3071 crate::model::ListEngineVersionsResponse,
3072 crate::Error,
3073 > {
3074 use google_cloud_gax::paginator::Paginator;
3075 self.by_page().items()
3076 }
3077
3078 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3082 self.0.request.parent = v.into();
3083 self
3084 }
3085
3086 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3088 self.0.request.page_size = v.into();
3089 self
3090 }
3091
3092 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3094 self.0.request.page_token = v.into();
3095 self
3096 }
3097
3098 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3100 self.0.request.filter = v.into();
3101 self
3102 }
3103
3104 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3106 self.0.request.order_by = v.into();
3107 self
3108 }
3109 }
3110
3111 #[doc(hidden)]
3112 impl crate::RequestBuilder for ListEngineVersions {
3113 fn request_options(&mut self) -> &mut crate::RequestOptions {
3114 &mut self.0.options
3115 }
3116 }
3117
3118 #[derive(Clone, Debug)]
3139 pub struct ListPredictionResults(RequestBuilder<crate::model::ListPredictionResultsRequest>);
3140
3141 impl ListPredictionResults {
3142 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3143 Self(RequestBuilder::new(stub))
3144 }
3145
3146 pub fn with_request<V: Into<crate::model::ListPredictionResultsRequest>>(
3148 mut self,
3149 v: V,
3150 ) -> Self {
3151 self.0.request = v.into();
3152 self
3153 }
3154
3155 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3157 self.0.options = v.into();
3158 self
3159 }
3160
3161 pub async fn send(self) -> Result<crate::model::ListPredictionResultsResponse> {
3163 (*self.0.stub)
3164 .list_prediction_results(self.0.request, self.0.options)
3165 .await
3166 .map(crate::Response::into_body)
3167 }
3168
3169 pub fn by_page(
3171 self,
3172 ) -> impl google_cloud_gax::paginator::Paginator<
3173 crate::model::ListPredictionResultsResponse,
3174 crate::Error,
3175 > {
3176 use std::clone::Clone;
3177 let token = self.0.request.page_token.clone();
3178 let execute = move |token: String| {
3179 let mut builder = self.clone();
3180 builder.0.request = builder.0.request.set_page_token(token);
3181 builder.send()
3182 };
3183 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3184 }
3185
3186 pub fn by_item(
3188 self,
3189 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3190 crate::model::ListPredictionResultsResponse,
3191 crate::Error,
3192 > {
3193 use google_cloud_gax::paginator::Paginator;
3194 self.by_page().items()
3195 }
3196
3197 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3201 self.0.request.parent = v.into();
3202 self
3203 }
3204
3205 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3207 self.0.request.page_size = v.into();
3208 self
3209 }
3210
3211 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3213 self.0.request.page_token = v.into();
3214 self
3215 }
3216
3217 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3219 self.0.request.filter = v.into();
3220 self
3221 }
3222
3223 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3225 self.0.request.order_by = v.into();
3226 self
3227 }
3228 }
3229
3230 #[doc(hidden)]
3231 impl crate::RequestBuilder for ListPredictionResults {
3232 fn request_options(&mut self) -> &mut crate::RequestOptions {
3233 &mut self.0.options
3234 }
3235 }
3236
3237 #[derive(Clone, Debug)]
3254 pub struct GetPredictionResult(RequestBuilder<crate::model::GetPredictionResultRequest>);
3255
3256 impl GetPredictionResult {
3257 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3258 Self(RequestBuilder::new(stub))
3259 }
3260
3261 pub fn with_request<V: Into<crate::model::GetPredictionResultRequest>>(
3263 mut self,
3264 v: V,
3265 ) -> Self {
3266 self.0.request = v.into();
3267 self
3268 }
3269
3270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3272 self.0.options = v.into();
3273 self
3274 }
3275
3276 pub async fn send(self) -> Result<crate::model::PredictionResult> {
3278 (*self.0.stub)
3279 .get_prediction_result(self.0.request, self.0.options)
3280 .await
3281 .map(crate::Response::into_body)
3282 }
3283
3284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3288 self.0.request.name = v.into();
3289 self
3290 }
3291 }
3292
3293 #[doc(hidden)]
3294 impl crate::RequestBuilder for GetPredictionResult {
3295 fn request_options(&mut self) -> &mut crate::RequestOptions {
3296 &mut self.0.options
3297 }
3298 }
3299
3300 #[derive(Clone, Debug)]
3318 pub struct CreatePredictionResult(RequestBuilder<crate::model::CreatePredictionResultRequest>);
3319
3320 impl CreatePredictionResult {
3321 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3322 Self(RequestBuilder::new(stub))
3323 }
3324
3325 pub fn with_request<V: Into<crate::model::CreatePredictionResultRequest>>(
3327 mut self,
3328 v: V,
3329 ) -> Self {
3330 self.0.request = v.into();
3331 self
3332 }
3333
3334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3336 self.0.options = v.into();
3337 self
3338 }
3339
3340 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3347 (*self.0.stub)
3348 .create_prediction_result(self.0.request, self.0.options)
3349 .await
3350 .map(crate::Response::into_body)
3351 }
3352
3353 pub fn poller(
3355 self,
3356 ) -> impl google_cloud_lro::Poller<crate::model::PredictionResult, crate::model::OperationMetadata>
3357 {
3358 type Operation = google_cloud_lro::internal::Operation<
3359 crate::model::PredictionResult,
3360 crate::model::OperationMetadata,
3361 >;
3362 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3363 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3364
3365 let stub = self.0.stub.clone();
3366 let mut options = self.0.options.clone();
3367 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3368 let query = move |name| {
3369 let stub = stub.clone();
3370 let options = options.clone();
3371 async {
3372 let op = GetOperation::new(stub)
3373 .set_name(name)
3374 .with_options(options)
3375 .send()
3376 .await?;
3377 Ok(Operation::new(op))
3378 }
3379 };
3380
3381 let start = move || async {
3382 let op = self.send().await?;
3383 Ok(Operation::new(op))
3384 };
3385
3386 google_cloud_lro::internal::new_poller(
3387 polling_error_policy,
3388 polling_backoff_policy,
3389 start,
3390 query,
3391 )
3392 }
3393
3394 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3398 self.0.request.parent = v.into();
3399 self
3400 }
3401
3402 pub fn set_prediction_result_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3406 self.0.request.prediction_result_id = v.into();
3407 self
3408 }
3409
3410 pub fn set_prediction_result<T>(mut self, v: T) -> Self
3414 where
3415 T: std::convert::Into<crate::model::PredictionResult>,
3416 {
3417 self.0.request.prediction_result = std::option::Option::Some(v.into());
3418 self
3419 }
3420
3421 pub fn set_or_clear_prediction_result<T>(mut self, v: std::option::Option<T>) -> Self
3425 where
3426 T: std::convert::Into<crate::model::PredictionResult>,
3427 {
3428 self.0.request.prediction_result = v.map(|x| x.into());
3429 self
3430 }
3431
3432 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3434 self.0.request.request_id = v.into();
3435 self
3436 }
3437 }
3438
3439 #[doc(hidden)]
3440 impl crate::RequestBuilder for CreatePredictionResult {
3441 fn request_options(&mut self) -> &mut crate::RequestOptions {
3442 &mut self.0.options
3443 }
3444 }
3445
3446 #[derive(Clone, Debug)]
3464 pub struct UpdatePredictionResult(RequestBuilder<crate::model::UpdatePredictionResultRequest>);
3465
3466 impl UpdatePredictionResult {
3467 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3468 Self(RequestBuilder::new(stub))
3469 }
3470
3471 pub fn with_request<V: Into<crate::model::UpdatePredictionResultRequest>>(
3473 mut self,
3474 v: V,
3475 ) -> Self {
3476 self.0.request = v.into();
3477 self
3478 }
3479
3480 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3482 self.0.options = v.into();
3483 self
3484 }
3485
3486 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3493 (*self.0.stub)
3494 .update_prediction_result(self.0.request, self.0.options)
3495 .await
3496 .map(crate::Response::into_body)
3497 }
3498
3499 pub fn poller(
3501 self,
3502 ) -> impl google_cloud_lro::Poller<crate::model::PredictionResult, crate::model::OperationMetadata>
3503 {
3504 type Operation = google_cloud_lro::internal::Operation<
3505 crate::model::PredictionResult,
3506 crate::model::OperationMetadata,
3507 >;
3508 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3509 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3510
3511 let stub = self.0.stub.clone();
3512 let mut options = self.0.options.clone();
3513 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3514 let query = move |name| {
3515 let stub = stub.clone();
3516 let options = options.clone();
3517 async {
3518 let op = GetOperation::new(stub)
3519 .set_name(name)
3520 .with_options(options)
3521 .send()
3522 .await?;
3523 Ok(Operation::new(op))
3524 }
3525 };
3526
3527 let start = move || async {
3528 let op = self.send().await?;
3529 Ok(Operation::new(op))
3530 };
3531
3532 google_cloud_lro::internal::new_poller(
3533 polling_error_policy,
3534 polling_backoff_policy,
3535 start,
3536 query,
3537 )
3538 }
3539
3540 pub fn set_update_mask<T>(mut self, v: T) -> Self
3542 where
3543 T: std::convert::Into<wkt::FieldMask>,
3544 {
3545 self.0.request.update_mask = std::option::Option::Some(v.into());
3546 self
3547 }
3548
3549 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3551 where
3552 T: std::convert::Into<wkt::FieldMask>,
3553 {
3554 self.0.request.update_mask = v.map(|x| x.into());
3555 self
3556 }
3557
3558 pub fn set_prediction_result<T>(mut self, v: T) -> Self
3562 where
3563 T: std::convert::Into<crate::model::PredictionResult>,
3564 {
3565 self.0.request.prediction_result = std::option::Option::Some(v.into());
3566 self
3567 }
3568
3569 pub fn set_or_clear_prediction_result<T>(mut self, v: std::option::Option<T>) -> Self
3573 where
3574 T: std::convert::Into<crate::model::PredictionResult>,
3575 {
3576 self.0.request.prediction_result = v.map(|x| x.into());
3577 self
3578 }
3579
3580 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3582 self.0.request.request_id = v.into();
3583 self
3584 }
3585 }
3586
3587 #[doc(hidden)]
3588 impl crate::RequestBuilder for UpdatePredictionResult {
3589 fn request_options(&mut self) -> &mut crate::RequestOptions {
3590 &mut self.0.options
3591 }
3592 }
3593
3594 #[derive(Clone, Debug)]
3612 pub struct ExportPredictionResultMetadata(
3613 RequestBuilder<crate::model::ExportPredictionResultMetadataRequest>,
3614 );
3615
3616 impl ExportPredictionResultMetadata {
3617 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3618 Self(RequestBuilder::new(stub))
3619 }
3620
3621 pub fn with_request<V: Into<crate::model::ExportPredictionResultMetadataRequest>>(
3623 mut self,
3624 v: V,
3625 ) -> Self {
3626 self.0.request = v.into();
3627 self
3628 }
3629
3630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3632 self.0.options = v.into();
3633 self
3634 }
3635
3636 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3643 (*self.0.stub)
3644 .export_prediction_result_metadata(self.0.request, self.0.options)
3645 .await
3646 .map(crate::Response::into_body)
3647 }
3648
3649 pub fn poller(
3651 self,
3652 ) -> impl google_cloud_lro::Poller<
3653 crate::model::ExportPredictionResultMetadataResponse,
3654 crate::model::OperationMetadata,
3655 > {
3656 type Operation = google_cloud_lro::internal::Operation<
3657 crate::model::ExportPredictionResultMetadataResponse,
3658 crate::model::OperationMetadata,
3659 >;
3660 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3661 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3662
3663 let stub = self.0.stub.clone();
3664 let mut options = self.0.options.clone();
3665 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3666 let query = move |name| {
3667 let stub = stub.clone();
3668 let options = options.clone();
3669 async {
3670 let op = GetOperation::new(stub)
3671 .set_name(name)
3672 .with_options(options)
3673 .send()
3674 .await?;
3675 Ok(Operation::new(op))
3676 }
3677 };
3678
3679 let start = move || async {
3680 let op = self.send().await?;
3681 Ok(Operation::new(op))
3682 };
3683
3684 google_cloud_lro::internal::new_poller(
3685 polling_error_policy,
3686 polling_backoff_policy,
3687 start,
3688 query,
3689 )
3690 }
3691
3692 pub fn set_prediction_result<T: Into<std::string::String>>(mut self, v: T) -> Self {
3696 self.0.request.prediction_result = v.into();
3697 self
3698 }
3699
3700 pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
3704 where
3705 T: std::convert::Into<crate::model::BigQueryDestination>,
3706 {
3707 self.0.request.structured_metadata_destination = std::option::Option::Some(v.into());
3708 self
3709 }
3710
3711 pub fn set_or_clear_structured_metadata_destination<T>(
3715 mut self,
3716 v: std::option::Option<T>,
3717 ) -> Self
3718 where
3719 T: std::convert::Into<crate::model::BigQueryDestination>,
3720 {
3721 self.0.request.structured_metadata_destination = v.map(|x| x.into());
3722 self
3723 }
3724 }
3725
3726 #[doc(hidden)]
3727 impl crate::RequestBuilder for ExportPredictionResultMetadata {
3728 fn request_options(&mut self) -> &mut crate::RequestOptions {
3729 &mut self.0.options
3730 }
3731 }
3732
3733 #[derive(Clone, Debug)]
3751 pub struct DeletePredictionResult(RequestBuilder<crate::model::DeletePredictionResultRequest>);
3752
3753 impl DeletePredictionResult {
3754 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3755 Self(RequestBuilder::new(stub))
3756 }
3757
3758 pub fn with_request<V: Into<crate::model::DeletePredictionResultRequest>>(
3760 mut self,
3761 v: V,
3762 ) -> Self {
3763 self.0.request = v.into();
3764 self
3765 }
3766
3767 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3769 self.0.options = v.into();
3770 self
3771 }
3772
3773 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3780 (*self.0.stub)
3781 .delete_prediction_result(self.0.request, self.0.options)
3782 .await
3783 .map(crate::Response::into_body)
3784 }
3785
3786 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
3788 type Operation =
3789 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
3790 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3791 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3792
3793 let stub = self.0.stub.clone();
3794 let mut options = self.0.options.clone();
3795 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3796 let query = move |name| {
3797 let stub = stub.clone();
3798 let options = options.clone();
3799 async {
3800 let op = GetOperation::new(stub)
3801 .set_name(name)
3802 .with_options(options)
3803 .send()
3804 .await?;
3805 Ok(Operation::new(op))
3806 }
3807 };
3808
3809 let start = move || async {
3810 let op = self.send().await?;
3811 Ok(Operation::new(op))
3812 };
3813
3814 google_cloud_lro::internal::new_unit_response_poller(
3815 polling_error_policy,
3816 polling_backoff_policy,
3817 start,
3818 query,
3819 )
3820 }
3821
3822 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3826 self.0.request.name = v.into();
3827 self
3828 }
3829
3830 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3832 self.0.request.request_id = v.into();
3833 self
3834 }
3835 }
3836
3837 #[doc(hidden)]
3838 impl crate::RequestBuilder for DeletePredictionResult {
3839 fn request_options(&mut self) -> &mut crate::RequestOptions {
3840 &mut self.0.options
3841 }
3842 }
3843
3844 #[derive(Clone, Debug)]
3865 pub struct ListBacktestResults(RequestBuilder<crate::model::ListBacktestResultsRequest>);
3866
3867 impl ListBacktestResults {
3868 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3869 Self(RequestBuilder::new(stub))
3870 }
3871
3872 pub fn with_request<V: Into<crate::model::ListBacktestResultsRequest>>(
3874 mut self,
3875 v: V,
3876 ) -> Self {
3877 self.0.request = v.into();
3878 self
3879 }
3880
3881 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3883 self.0.options = v.into();
3884 self
3885 }
3886
3887 pub async fn send(self) -> Result<crate::model::ListBacktestResultsResponse> {
3889 (*self.0.stub)
3890 .list_backtest_results(self.0.request, self.0.options)
3891 .await
3892 .map(crate::Response::into_body)
3893 }
3894
3895 pub fn by_page(
3897 self,
3898 ) -> impl google_cloud_gax::paginator::Paginator<
3899 crate::model::ListBacktestResultsResponse,
3900 crate::Error,
3901 > {
3902 use std::clone::Clone;
3903 let token = self.0.request.page_token.clone();
3904 let execute = move |token: String| {
3905 let mut builder = self.clone();
3906 builder.0.request = builder.0.request.set_page_token(token);
3907 builder.send()
3908 };
3909 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3910 }
3911
3912 pub fn by_item(
3914 self,
3915 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3916 crate::model::ListBacktestResultsResponse,
3917 crate::Error,
3918 > {
3919 use google_cloud_gax::paginator::Paginator;
3920 self.by_page().items()
3921 }
3922
3923 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3927 self.0.request.parent = v.into();
3928 self
3929 }
3930
3931 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3933 self.0.request.page_size = v.into();
3934 self
3935 }
3936
3937 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3939 self.0.request.page_token = v.into();
3940 self
3941 }
3942
3943 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3945 self.0.request.filter = v.into();
3946 self
3947 }
3948
3949 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3951 self.0.request.order_by = v.into();
3952 self
3953 }
3954 }
3955
3956 #[doc(hidden)]
3957 impl crate::RequestBuilder for ListBacktestResults {
3958 fn request_options(&mut self) -> &mut crate::RequestOptions {
3959 &mut self.0.options
3960 }
3961 }
3962
3963 #[derive(Clone, Debug)]
3980 pub struct GetBacktestResult(RequestBuilder<crate::model::GetBacktestResultRequest>);
3981
3982 impl GetBacktestResult {
3983 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
3984 Self(RequestBuilder::new(stub))
3985 }
3986
3987 pub fn with_request<V: Into<crate::model::GetBacktestResultRequest>>(
3989 mut self,
3990 v: V,
3991 ) -> Self {
3992 self.0.request = v.into();
3993 self
3994 }
3995
3996 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3998 self.0.options = v.into();
3999 self
4000 }
4001
4002 pub async fn send(self) -> Result<crate::model::BacktestResult> {
4004 (*self.0.stub)
4005 .get_backtest_result(self.0.request, self.0.options)
4006 .await
4007 .map(crate::Response::into_body)
4008 }
4009
4010 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4014 self.0.request.name = v.into();
4015 self
4016 }
4017 }
4018
4019 #[doc(hidden)]
4020 impl crate::RequestBuilder for GetBacktestResult {
4021 fn request_options(&mut self) -> &mut crate::RequestOptions {
4022 &mut self.0.options
4023 }
4024 }
4025
4026 #[derive(Clone, Debug)]
4044 pub struct CreateBacktestResult(RequestBuilder<crate::model::CreateBacktestResultRequest>);
4045
4046 impl CreateBacktestResult {
4047 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4048 Self(RequestBuilder::new(stub))
4049 }
4050
4051 pub fn with_request<V: Into<crate::model::CreateBacktestResultRequest>>(
4053 mut self,
4054 v: V,
4055 ) -> Self {
4056 self.0.request = v.into();
4057 self
4058 }
4059
4060 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4062 self.0.options = v.into();
4063 self
4064 }
4065
4066 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4073 (*self.0.stub)
4074 .create_backtest_result(self.0.request, self.0.options)
4075 .await
4076 .map(crate::Response::into_body)
4077 }
4078
4079 pub fn poller(
4081 self,
4082 ) -> impl google_cloud_lro::Poller<crate::model::BacktestResult, crate::model::OperationMetadata>
4083 {
4084 type Operation = google_cloud_lro::internal::Operation<
4085 crate::model::BacktestResult,
4086 crate::model::OperationMetadata,
4087 >;
4088 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4089 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4090
4091 let stub = self.0.stub.clone();
4092 let mut options = self.0.options.clone();
4093 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4094 let query = move |name| {
4095 let stub = stub.clone();
4096 let options = options.clone();
4097 async {
4098 let op = GetOperation::new(stub)
4099 .set_name(name)
4100 .with_options(options)
4101 .send()
4102 .await?;
4103 Ok(Operation::new(op))
4104 }
4105 };
4106
4107 let start = move || async {
4108 let op = self.send().await?;
4109 Ok(Operation::new(op))
4110 };
4111
4112 google_cloud_lro::internal::new_poller(
4113 polling_error_policy,
4114 polling_backoff_policy,
4115 start,
4116 query,
4117 )
4118 }
4119
4120 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4124 self.0.request.parent = v.into();
4125 self
4126 }
4127
4128 pub fn set_backtest_result_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4132 self.0.request.backtest_result_id = v.into();
4133 self
4134 }
4135
4136 pub fn set_backtest_result<T>(mut self, v: T) -> Self
4140 where
4141 T: std::convert::Into<crate::model::BacktestResult>,
4142 {
4143 self.0.request.backtest_result = std::option::Option::Some(v.into());
4144 self
4145 }
4146
4147 pub fn set_or_clear_backtest_result<T>(mut self, v: std::option::Option<T>) -> Self
4151 where
4152 T: std::convert::Into<crate::model::BacktestResult>,
4153 {
4154 self.0.request.backtest_result = v.map(|x| x.into());
4155 self
4156 }
4157
4158 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4160 self.0.request.request_id = v.into();
4161 self
4162 }
4163 }
4164
4165 #[doc(hidden)]
4166 impl crate::RequestBuilder for CreateBacktestResult {
4167 fn request_options(&mut self) -> &mut crate::RequestOptions {
4168 &mut self.0.options
4169 }
4170 }
4171
4172 #[derive(Clone, Debug)]
4190 pub struct UpdateBacktestResult(RequestBuilder<crate::model::UpdateBacktestResultRequest>);
4191
4192 impl UpdateBacktestResult {
4193 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4194 Self(RequestBuilder::new(stub))
4195 }
4196
4197 pub fn with_request<V: Into<crate::model::UpdateBacktestResultRequest>>(
4199 mut self,
4200 v: V,
4201 ) -> Self {
4202 self.0.request = v.into();
4203 self
4204 }
4205
4206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4208 self.0.options = v.into();
4209 self
4210 }
4211
4212 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4219 (*self.0.stub)
4220 .update_backtest_result(self.0.request, self.0.options)
4221 .await
4222 .map(crate::Response::into_body)
4223 }
4224
4225 pub fn poller(
4227 self,
4228 ) -> impl google_cloud_lro::Poller<crate::model::BacktestResult, crate::model::OperationMetadata>
4229 {
4230 type Operation = google_cloud_lro::internal::Operation<
4231 crate::model::BacktestResult,
4232 crate::model::OperationMetadata,
4233 >;
4234 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4235 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4236
4237 let stub = self.0.stub.clone();
4238 let mut options = self.0.options.clone();
4239 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4240 let query = move |name| {
4241 let stub = stub.clone();
4242 let options = options.clone();
4243 async {
4244 let op = GetOperation::new(stub)
4245 .set_name(name)
4246 .with_options(options)
4247 .send()
4248 .await?;
4249 Ok(Operation::new(op))
4250 }
4251 };
4252
4253 let start = move || async {
4254 let op = self.send().await?;
4255 Ok(Operation::new(op))
4256 };
4257
4258 google_cloud_lro::internal::new_poller(
4259 polling_error_policy,
4260 polling_backoff_policy,
4261 start,
4262 query,
4263 )
4264 }
4265
4266 pub fn set_update_mask<T>(mut self, v: T) -> Self
4268 where
4269 T: std::convert::Into<wkt::FieldMask>,
4270 {
4271 self.0.request.update_mask = std::option::Option::Some(v.into());
4272 self
4273 }
4274
4275 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4277 where
4278 T: std::convert::Into<wkt::FieldMask>,
4279 {
4280 self.0.request.update_mask = v.map(|x| x.into());
4281 self
4282 }
4283
4284 pub fn set_backtest_result<T>(mut self, v: T) -> Self
4288 where
4289 T: std::convert::Into<crate::model::BacktestResult>,
4290 {
4291 self.0.request.backtest_result = std::option::Option::Some(v.into());
4292 self
4293 }
4294
4295 pub fn set_or_clear_backtest_result<T>(mut self, v: std::option::Option<T>) -> Self
4299 where
4300 T: std::convert::Into<crate::model::BacktestResult>,
4301 {
4302 self.0.request.backtest_result = v.map(|x| x.into());
4303 self
4304 }
4305
4306 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4308 self.0.request.request_id = v.into();
4309 self
4310 }
4311 }
4312
4313 #[doc(hidden)]
4314 impl crate::RequestBuilder for UpdateBacktestResult {
4315 fn request_options(&mut self) -> &mut crate::RequestOptions {
4316 &mut self.0.options
4317 }
4318 }
4319
4320 #[derive(Clone, Debug)]
4338 pub struct ExportBacktestResultMetadata(
4339 RequestBuilder<crate::model::ExportBacktestResultMetadataRequest>,
4340 );
4341
4342 impl ExportBacktestResultMetadata {
4343 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4344 Self(RequestBuilder::new(stub))
4345 }
4346
4347 pub fn with_request<V: Into<crate::model::ExportBacktestResultMetadataRequest>>(
4349 mut self,
4350 v: V,
4351 ) -> Self {
4352 self.0.request = v.into();
4353 self
4354 }
4355
4356 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4358 self.0.options = v.into();
4359 self
4360 }
4361
4362 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4369 (*self.0.stub)
4370 .export_backtest_result_metadata(self.0.request, self.0.options)
4371 .await
4372 .map(crate::Response::into_body)
4373 }
4374
4375 pub fn poller(
4377 self,
4378 ) -> impl google_cloud_lro::Poller<
4379 crate::model::ExportBacktestResultMetadataResponse,
4380 crate::model::OperationMetadata,
4381 > {
4382 type Operation = google_cloud_lro::internal::Operation<
4383 crate::model::ExportBacktestResultMetadataResponse,
4384 crate::model::OperationMetadata,
4385 >;
4386 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4387 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4388
4389 let stub = self.0.stub.clone();
4390 let mut options = self.0.options.clone();
4391 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4392 let query = move |name| {
4393 let stub = stub.clone();
4394 let options = options.clone();
4395 async {
4396 let op = GetOperation::new(stub)
4397 .set_name(name)
4398 .with_options(options)
4399 .send()
4400 .await?;
4401 Ok(Operation::new(op))
4402 }
4403 };
4404
4405 let start = move || async {
4406 let op = self.send().await?;
4407 Ok(Operation::new(op))
4408 };
4409
4410 google_cloud_lro::internal::new_poller(
4411 polling_error_policy,
4412 polling_backoff_policy,
4413 start,
4414 query,
4415 )
4416 }
4417
4418 pub fn set_backtest_result<T: Into<std::string::String>>(mut self, v: T) -> Self {
4422 self.0.request.backtest_result = v.into();
4423 self
4424 }
4425
4426 pub fn set_structured_metadata_destination<T>(mut self, v: T) -> Self
4430 where
4431 T: std::convert::Into<crate::model::BigQueryDestination>,
4432 {
4433 self.0.request.structured_metadata_destination = std::option::Option::Some(v.into());
4434 self
4435 }
4436
4437 pub fn set_or_clear_structured_metadata_destination<T>(
4441 mut self,
4442 v: std::option::Option<T>,
4443 ) -> Self
4444 where
4445 T: std::convert::Into<crate::model::BigQueryDestination>,
4446 {
4447 self.0.request.structured_metadata_destination = v.map(|x| x.into());
4448 self
4449 }
4450 }
4451
4452 #[doc(hidden)]
4453 impl crate::RequestBuilder for ExportBacktestResultMetadata {
4454 fn request_options(&mut self) -> &mut crate::RequestOptions {
4455 &mut self.0.options
4456 }
4457 }
4458
4459 #[derive(Clone, Debug)]
4477 pub struct DeleteBacktestResult(RequestBuilder<crate::model::DeleteBacktestResultRequest>);
4478
4479 impl DeleteBacktestResult {
4480 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4481 Self(RequestBuilder::new(stub))
4482 }
4483
4484 pub fn with_request<V: Into<crate::model::DeleteBacktestResultRequest>>(
4486 mut self,
4487 v: V,
4488 ) -> Self {
4489 self.0.request = v.into();
4490 self
4491 }
4492
4493 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4495 self.0.options = v.into();
4496 self
4497 }
4498
4499 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4506 (*self.0.stub)
4507 .delete_backtest_result(self.0.request, self.0.options)
4508 .await
4509 .map(crate::Response::into_body)
4510 }
4511
4512 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
4514 type Operation =
4515 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
4516 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4517 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4518
4519 let stub = self.0.stub.clone();
4520 let mut options = self.0.options.clone();
4521 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4522 let query = move |name| {
4523 let stub = stub.clone();
4524 let options = options.clone();
4525 async {
4526 let op = GetOperation::new(stub)
4527 .set_name(name)
4528 .with_options(options)
4529 .send()
4530 .await?;
4531 Ok(Operation::new(op))
4532 }
4533 };
4534
4535 let start = move || async {
4536 let op = self.send().await?;
4537 Ok(Operation::new(op))
4538 };
4539
4540 google_cloud_lro::internal::new_unit_response_poller(
4541 polling_error_policy,
4542 polling_backoff_policy,
4543 start,
4544 query,
4545 )
4546 }
4547
4548 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4552 self.0.request.name = v.into();
4553 self
4554 }
4555
4556 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4558 self.0.request.request_id = v.into();
4559 self
4560 }
4561 }
4562
4563 #[doc(hidden)]
4564 impl crate::RequestBuilder for DeleteBacktestResult {
4565 fn request_options(&mut self) -> &mut crate::RequestOptions {
4566 &mut self.0.options
4567 }
4568 }
4569
4570 #[derive(Clone, Debug)]
4591 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4592
4593 impl ListLocations {
4594 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4595 Self(RequestBuilder::new(stub))
4596 }
4597
4598 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4600 mut self,
4601 v: V,
4602 ) -> Self {
4603 self.0.request = v.into();
4604 self
4605 }
4606
4607 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4609 self.0.options = v.into();
4610 self
4611 }
4612
4613 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4615 (*self.0.stub)
4616 .list_locations(self.0.request, self.0.options)
4617 .await
4618 .map(crate::Response::into_body)
4619 }
4620
4621 pub fn by_page(
4623 self,
4624 ) -> impl google_cloud_gax::paginator::Paginator<
4625 google_cloud_location::model::ListLocationsResponse,
4626 crate::Error,
4627 > {
4628 use std::clone::Clone;
4629 let token = self.0.request.page_token.clone();
4630 let execute = move |token: String| {
4631 let mut builder = self.clone();
4632 builder.0.request = builder.0.request.set_page_token(token);
4633 builder.send()
4634 };
4635 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4636 }
4637
4638 pub fn by_item(
4640 self,
4641 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4642 google_cloud_location::model::ListLocationsResponse,
4643 crate::Error,
4644 > {
4645 use google_cloud_gax::paginator::Paginator;
4646 self.by_page().items()
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 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4657 self.0.request.filter = v.into();
4658 self
4659 }
4660
4661 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4663 self.0.request.page_size = v.into();
4664 self
4665 }
4666
4667 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4669 self.0.request.page_token = v.into();
4670 self
4671 }
4672 }
4673
4674 #[doc(hidden)]
4675 impl crate::RequestBuilder for ListLocations {
4676 fn request_options(&mut self) -> &mut crate::RequestOptions {
4677 &mut self.0.options
4678 }
4679 }
4680
4681 #[derive(Clone, Debug)]
4698 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4699
4700 impl GetLocation {
4701 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4702 Self(RequestBuilder::new(stub))
4703 }
4704
4705 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4707 mut self,
4708 v: V,
4709 ) -> Self {
4710 self.0.request = v.into();
4711 self
4712 }
4713
4714 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4716 self.0.options = v.into();
4717 self
4718 }
4719
4720 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4722 (*self.0.stub)
4723 .get_location(self.0.request, self.0.options)
4724 .await
4725 .map(crate::Response::into_body)
4726 }
4727
4728 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4730 self.0.request.name = v.into();
4731 self
4732 }
4733 }
4734
4735 #[doc(hidden)]
4736 impl crate::RequestBuilder for GetLocation {
4737 fn request_options(&mut self) -> &mut crate::RequestOptions {
4738 &mut self.0.options
4739 }
4740 }
4741
4742 #[derive(Clone, Debug)]
4763 pub struct ListOperations(
4764 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4765 );
4766
4767 impl ListOperations {
4768 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4769 Self(RequestBuilder::new(stub))
4770 }
4771
4772 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4774 mut self,
4775 v: V,
4776 ) -> Self {
4777 self.0.request = v.into();
4778 self
4779 }
4780
4781 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4783 self.0.options = v.into();
4784 self
4785 }
4786
4787 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4789 (*self.0.stub)
4790 .list_operations(self.0.request, self.0.options)
4791 .await
4792 .map(crate::Response::into_body)
4793 }
4794
4795 pub fn by_page(
4797 self,
4798 ) -> impl google_cloud_gax::paginator::Paginator<
4799 google_cloud_longrunning::model::ListOperationsResponse,
4800 crate::Error,
4801 > {
4802 use std::clone::Clone;
4803 let token = self.0.request.page_token.clone();
4804 let execute = move |token: String| {
4805 let mut builder = self.clone();
4806 builder.0.request = builder.0.request.set_page_token(token);
4807 builder.send()
4808 };
4809 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4810 }
4811
4812 pub fn by_item(
4814 self,
4815 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4816 google_cloud_longrunning::model::ListOperationsResponse,
4817 crate::Error,
4818 > {
4819 use google_cloud_gax::paginator::Paginator;
4820 self.by_page().items()
4821 }
4822
4823 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4825 self.0.request.name = v.into();
4826 self
4827 }
4828
4829 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4831 self.0.request.filter = v.into();
4832 self
4833 }
4834
4835 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4837 self.0.request.page_size = v.into();
4838 self
4839 }
4840
4841 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4843 self.0.request.page_token = v.into();
4844 self
4845 }
4846
4847 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4849 self.0.request.return_partial_success = v.into();
4850 self
4851 }
4852 }
4853
4854 #[doc(hidden)]
4855 impl crate::RequestBuilder for ListOperations {
4856 fn request_options(&mut self) -> &mut crate::RequestOptions {
4857 &mut self.0.options
4858 }
4859 }
4860
4861 #[derive(Clone, Debug)]
4878 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4879
4880 impl GetOperation {
4881 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4882 Self(RequestBuilder::new(stub))
4883 }
4884
4885 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4887 mut self,
4888 v: V,
4889 ) -> Self {
4890 self.0.request = v.into();
4891 self
4892 }
4893
4894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4896 self.0.options = v.into();
4897 self
4898 }
4899
4900 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4902 (*self.0.stub)
4903 .get_operation(self.0.request, self.0.options)
4904 .await
4905 .map(crate::Response::into_body)
4906 }
4907
4908 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4910 self.0.request.name = v.into();
4911 self
4912 }
4913 }
4914
4915 #[doc(hidden)]
4916 impl crate::RequestBuilder for GetOperation {
4917 fn request_options(&mut self) -> &mut crate::RequestOptions {
4918 &mut self.0.options
4919 }
4920 }
4921
4922 #[derive(Clone, Debug)]
4939 pub struct DeleteOperation(
4940 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4941 );
4942
4943 impl DeleteOperation {
4944 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
4945 Self(RequestBuilder::new(stub))
4946 }
4947
4948 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4950 mut self,
4951 v: V,
4952 ) -> Self {
4953 self.0.request = v.into();
4954 self
4955 }
4956
4957 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4959 self.0.options = v.into();
4960 self
4961 }
4962
4963 pub async fn send(self) -> Result<()> {
4965 (*self.0.stub)
4966 .delete_operation(self.0.request, self.0.options)
4967 .await
4968 .map(crate::Response::into_body)
4969 }
4970
4971 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4973 self.0.request.name = v.into();
4974 self
4975 }
4976 }
4977
4978 #[doc(hidden)]
4979 impl crate::RequestBuilder for DeleteOperation {
4980 fn request_options(&mut self) -> &mut crate::RequestOptions {
4981 &mut self.0.options
4982 }
4983 }
4984
4985 #[derive(Clone, Debug)]
5002 pub struct CancelOperation(
5003 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5004 );
5005
5006 impl CancelOperation {
5007 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Aml>) -> Self {
5008 Self(RequestBuilder::new(stub))
5009 }
5010
5011 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5013 mut self,
5014 v: V,
5015 ) -> Self {
5016 self.0.request = v.into();
5017 self
5018 }
5019
5020 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5022 self.0.options = v.into();
5023 self
5024 }
5025
5026 pub async fn send(self) -> Result<()> {
5028 (*self.0.stub)
5029 .cancel_operation(self.0.request, self.0.options)
5030 .await
5031 .map(crate::Response::into_body)
5032 }
5033
5034 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5036 self.0.request.name = v.into();
5037 self
5038 }
5039 }
5040
5041 #[doc(hidden)]
5042 impl crate::RequestBuilder for CancelOperation {
5043 fn request_options(&mut self) -> &mut crate::RequestOptions {
5044 &mut self.0.options
5045 }
5046 }
5047}