1#[cfg(feature = "agents")]
19#[cfg_attr(docsrs, doc(cfg(feature = "agents")))]
20pub mod agents {
21 use crate::Result;
22
23 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38 pub(crate) mod client {
39 use super::super::super::client::Agents;
40 pub struct Factory;
41 impl crate::ClientFactory for Factory {
42 type Client = Agents;
43 type Credentials = gaxi::options::Credentials;
44 async fn build(
45 self,
46 config: gaxi::options::ClientConfig,
47 ) -> crate::ClientBuilderResult<Self::Client> {
48 Self::Client::new(config).await
49 }
50 }
51 }
52
53 #[derive(Clone, Debug)]
55 pub(crate) struct RequestBuilder<R: std::default::Default> {
56 stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>,
57 request: R,
58 options: crate::RequestOptions,
59 }
60
61 impl<R> RequestBuilder<R>
62 where
63 R: std::default::Default,
64 {
65 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
95 pub struct ListAgents(RequestBuilder<crate::model::ListAgentsRequest>);
96
97 impl ListAgents {
98 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
99 Self(RequestBuilder::new(stub))
100 }
101
102 pub fn with_request<V: Into<crate::model::ListAgentsRequest>>(mut self, v: V) -> Self {
104 self.0.request = v.into();
105 self
106 }
107
108 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
110 self.0.options = v.into();
111 self
112 }
113
114 pub async fn send(self) -> Result<crate::model::ListAgentsResponse> {
116 (*self.0.stub)
117 .list_agents(self.0.request, self.0.options)
118 .await
119 .map(crate::Response::into_body)
120 }
121
122 pub fn by_page(
124 self,
125 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAgentsResponse, crate::Error>
126 {
127 use std::clone::Clone;
128 let token = self.0.request.page_token.clone();
129 let execute = move |token: String| {
130 let mut builder = self.clone();
131 builder.0.request = builder.0.request.set_page_token(token);
132 builder.send()
133 };
134 google_cloud_gax::paginator::internal::new_paginator(token, execute)
135 }
136
137 pub fn by_item(
139 self,
140 ) -> impl google_cloud_gax::paginator::ItemPaginator<
141 crate::model::ListAgentsResponse,
142 crate::Error,
143 > {
144 use google_cloud_gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167 }
168
169 #[doc(hidden)]
170 impl crate::RequestBuilder for ListAgents {
171 fn request_options(&mut self) -> &mut crate::RequestOptions {
172 &mut self.0.options
173 }
174 }
175
176 #[derive(Clone, Debug)]
193 pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
194
195 impl GetAgent {
196 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
197 Self(RequestBuilder::new(stub))
198 }
199
200 pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
202 self.0.request = v.into();
203 self
204 }
205
206 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
208 self.0.options = v.into();
209 self
210 }
211
212 pub async fn send(self) -> Result<crate::model::Agent> {
214 (*self.0.stub)
215 .get_agent(self.0.request, self.0.options)
216 .await
217 .map(crate::Response::into_body)
218 }
219
220 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
224 self.0.request.name = v.into();
225 self
226 }
227 }
228
229 #[doc(hidden)]
230 impl crate::RequestBuilder for GetAgent {
231 fn request_options(&mut self) -> &mut crate::RequestOptions {
232 &mut self.0.options
233 }
234 }
235
236 #[derive(Clone, Debug)]
253 pub struct CreateAgent(RequestBuilder<crate::model::CreateAgentRequest>);
254
255 impl CreateAgent {
256 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
257 Self(RequestBuilder::new(stub))
258 }
259
260 pub fn with_request<V: Into<crate::model::CreateAgentRequest>>(mut self, v: V) -> Self {
262 self.0.request = v.into();
263 self
264 }
265
266 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
268 self.0.options = v.into();
269 self
270 }
271
272 pub async fn send(self) -> Result<crate::model::Agent> {
274 (*self.0.stub)
275 .create_agent(self.0.request, self.0.options)
276 .await
277 .map(crate::Response::into_body)
278 }
279
280 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
284 self.0.request.parent = v.into();
285 self
286 }
287
288 pub fn set_agent<T>(mut self, v: T) -> Self
292 where
293 T: std::convert::Into<crate::model::Agent>,
294 {
295 self.0.request.agent = std::option::Option::Some(v.into());
296 self
297 }
298
299 pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
303 where
304 T: std::convert::Into<crate::model::Agent>,
305 {
306 self.0.request.agent = v.map(|x| x.into());
307 self
308 }
309 }
310
311 #[doc(hidden)]
312 impl crate::RequestBuilder for CreateAgent {
313 fn request_options(&mut self) -> &mut crate::RequestOptions {
314 &mut self.0.options
315 }
316 }
317
318 #[derive(Clone, Debug)]
335 pub struct UpdateAgent(RequestBuilder<crate::model::UpdateAgentRequest>);
336
337 impl UpdateAgent {
338 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
339 Self(RequestBuilder::new(stub))
340 }
341
342 pub fn with_request<V: Into<crate::model::UpdateAgentRequest>>(mut self, v: V) -> Self {
344 self.0.request = v.into();
345 self
346 }
347
348 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
350 self.0.options = v.into();
351 self
352 }
353
354 pub async fn send(self) -> Result<crate::model::Agent> {
356 (*self.0.stub)
357 .update_agent(self.0.request, self.0.options)
358 .await
359 .map(crate::Response::into_body)
360 }
361
362 pub fn set_agent<T>(mut self, v: T) -> Self
366 where
367 T: std::convert::Into<crate::model::Agent>,
368 {
369 self.0.request.agent = std::option::Option::Some(v.into());
370 self
371 }
372
373 pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
377 where
378 T: std::convert::Into<crate::model::Agent>,
379 {
380 self.0.request.agent = v.map(|x| x.into());
381 self
382 }
383
384 pub fn set_update_mask<T>(mut self, v: T) -> Self
386 where
387 T: std::convert::Into<wkt::FieldMask>,
388 {
389 self.0.request.update_mask = std::option::Option::Some(v.into());
390 self
391 }
392
393 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
395 where
396 T: std::convert::Into<wkt::FieldMask>,
397 {
398 self.0.request.update_mask = v.map(|x| x.into());
399 self
400 }
401 }
402
403 #[doc(hidden)]
404 impl crate::RequestBuilder for UpdateAgent {
405 fn request_options(&mut self) -> &mut crate::RequestOptions {
406 &mut self.0.options
407 }
408 }
409
410 #[derive(Clone, Debug)]
427 pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
428
429 impl DeleteAgent {
430 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
431 Self(RequestBuilder::new(stub))
432 }
433
434 pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
436 self.0.request = v.into();
437 self
438 }
439
440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
442 self.0.options = v.into();
443 self
444 }
445
446 pub async fn send(self) -> Result<()> {
448 (*self.0.stub)
449 .delete_agent(self.0.request, self.0.options)
450 .await
451 .map(crate::Response::into_body)
452 }
453
454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
458 self.0.request.name = v.into();
459 self
460 }
461 }
462
463 #[doc(hidden)]
464 impl crate::RequestBuilder for DeleteAgent {
465 fn request_options(&mut self) -> &mut crate::RequestOptions {
466 &mut self.0.options
467 }
468 }
469
470 #[derive(Clone, Debug)]
488 pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
489
490 impl ExportAgent {
491 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
492 Self(RequestBuilder::new(stub))
493 }
494
495 pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
497 self.0.request = v.into();
498 self
499 }
500
501 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
503 self.0.options = v.into();
504 self
505 }
506
507 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
514 (*self.0.stub)
515 .export_agent(self.0.request, self.0.options)
516 .await
517 .map(crate::Response::into_body)
518 }
519
520 pub fn poller(
522 self,
523 ) -> impl google_cloud_lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
524 type Operation = google_cloud_lro::internal::Operation<
525 crate::model::ExportAgentResponse,
526 wkt::Struct,
527 >;
528 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
529 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
530
531 let stub = self.0.stub.clone();
532 let mut options = self.0.options.clone();
533 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
534 let query = move |name| {
535 let stub = stub.clone();
536 let options = options.clone();
537 async {
538 let op = GetOperation::new(stub)
539 .set_name(name)
540 .with_options(options)
541 .send()
542 .await?;
543 Ok(Operation::new(op))
544 }
545 };
546
547 let start = move || async {
548 let op = self.send().await?;
549 Ok(Operation::new(op))
550 };
551
552 google_cloud_lro::internal::new_poller(
553 polling_error_policy,
554 polling_backoff_policy,
555 start,
556 query,
557 )
558 }
559
560 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
564 self.0.request.name = v.into();
565 self
566 }
567
568 pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
570 self.0.request.agent_uri = v.into();
571 self
572 }
573
574 pub fn set_data_format<T: Into<crate::model::export_agent_request::DataFormat>>(
576 mut self,
577 v: T,
578 ) -> Self {
579 self.0.request.data_format = v.into();
580 self
581 }
582
583 pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
585 self.0.request.environment = v.into();
586 self
587 }
588
589 pub fn set_git_destination<T>(mut self, v: T) -> Self
591 where
592 T: std::convert::Into<crate::model::export_agent_request::GitDestination>,
593 {
594 self.0.request.git_destination = std::option::Option::Some(v.into());
595 self
596 }
597
598 pub fn set_or_clear_git_destination<T>(mut self, v: std::option::Option<T>) -> Self
600 where
601 T: std::convert::Into<crate::model::export_agent_request::GitDestination>,
602 {
603 self.0.request.git_destination = v.map(|x| x.into());
604 self
605 }
606
607 pub fn set_include_bigquery_export_settings<T: Into<bool>>(mut self, v: T) -> Self {
609 self.0.request.include_bigquery_export_settings = v.into();
610 self
611 }
612 }
613
614 #[doc(hidden)]
615 impl crate::RequestBuilder for ExportAgent {
616 fn request_options(&mut self) -> &mut crate::RequestOptions {
617 &mut self.0.options
618 }
619 }
620
621 #[derive(Clone, Debug)]
639 pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
640
641 impl RestoreAgent {
642 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
643 Self(RequestBuilder::new(stub))
644 }
645
646 pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
648 self.0.request = v.into();
649 self
650 }
651
652 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
654 self.0.options = v.into();
655 self
656 }
657
658 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
665 (*self.0.stub)
666 .restore_agent(self.0.request, self.0.options)
667 .await
668 .map(crate::Response::into_body)
669 }
670
671 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
673 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
674 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
675 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
676
677 let stub = self.0.stub.clone();
678 let mut options = self.0.options.clone();
679 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
680 let query = move |name| {
681 let stub = stub.clone();
682 let options = options.clone();
683 async {
684 let op = GetOperation::new(stub)
685 .set_name(name)
686 .with_options(options)
687 .send()
688 .await?;
689 Ok(Operation::new(op))
690 }
691 };
692
693 let start = move || async {
694 let op = self.send().await?;
695 Ok(Operation::new(op))
696 };
697
698 google_cloud_lro::internal::new_unit_response_poller(
699 polling_error_policy,
700 polling_backoff_policy,
701 start,
702 query,
703 )
704 }
705
706 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
710 self.0.request.name = v.into();
711 self
712 }
713
714 pub fn set_restore_option<T: Into<crate::model::restore_agent_request::RestoreOption>>(
716 mut self,
717 v: T,
718 ) -> Self {
719 self.0.request.restore_option = v.into();
720 self
721 }
722
723 pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
728 mut self,
729 v: T,
730 ) -> Self {
731 self.0.request.agent = v.into();
732 self
733 }
734
735 pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741 self.0.request = self.0.request.set_agent_uri(v);
742 self
743 }
744
745 pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
751 self.0.request = self.0.request.set_agent_content(v);
752 self
753 }
754
755 pub fn set_git_source<
761 T: std::convert::Into<std::boxed::Box<crate::model::restore_agent_request::GitSource>>,
762 >(
763 mut self,
764 v: T,
765 ) -> Self {
766 self.0.request = self.0.request.set_git_source(v);
767 self
768 }
769 }
770
771 #[doc(hidden)]
772 impl crate::RequestBuilder for RestoreAgent {
773 fn request_options(&mut self) -> &mut crate::RequestOptions {
774 &mut self.0.options
775 }
776 }
777
778 #[derive(Clone, Debug)]
795 pub struct ValidateAgent(RequestBuilder<crate::model::ValidateAgentRequest>);
796
797 impl ValidateAgent {
798 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
799 Self(RequestBuilder::new(stub))
800 }
801
802 pub fn with_request<V: Into<crate::model::ValidateAgentRequest>>(mut self, v: V) -> Self {
804 self.0.request = v.into();
805 self
806 }
807
808 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
810 self.0.options = v.into();
811 self
812 }
813
814 pub async fn send(self) -> Result<crate::model::AgentValidationResult> {
816 (*self.0.stub)
817 .validate_agent(self.0.request, self.0.options)
818 .await
819 .map(crate::Response::into_body)
820 }
821
822 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
826 self.0.request.name = v.into();
827 self
828 }
829
830 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
832 self.0.request.language_code = v.into();
833 self
834 }
835 }
836
837 #[doc(hidden)]
838 impl crate::RequestBuilder for ValidateAgent {
839 fn request_options(&mut self) -> &mut crate::RequestOptions {
840 &mut self.0.options
841 }
842 }
843
844 #[derive(Clone, Debug)]
861 pub struct GetAgentValidationResult(
862 RequestBuilder<crate::model::GetAgentValidationResultRequest>,
863 );
864
865 impl GetAgentValidationResult {
866 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
867 Self(RequestBuilder::new(stub))
868 }
869
870 pub fn with_request<V: Into<crate::model::GetAgentValidationResultRequest>>(
872 mut self,
873 v: V,
874 ) -> Self {
875 self.0.request = v.into();
876 self
877 }
878
879 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
881 self.0.options = v.into();
882 self
883 }
884
885 pub async fn send(self) -> Result<crate::model::AgentValidationResult> {
887 (*self.0.stub)
888 .get_agent_validation_result(self.0.request, self.0.options)
889 .await
890 .map(crate::Response::into_body)
891 }
892
893 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
897 self.0.request.name = v.into();
898 self
899 }
900
901 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
903 self.0.request.language_code = v.into();
904 self
905 }
906 }
907
908 #[doc(hidden)]
909 impl crate::RequestBuilder for GetAgentValidationResult {
910 fn request_options(&mut self) -> &mut crate::RequestOptions {
911 &mut self.0.options
912 }
913 }
914
915 #[derive(Clone, Debug)]
932 pub struct GetGenerativeSettings(RequestBuilder<crate::model::GetGenerativeSettingsRequest>);
933
934 impl GetGenerativeSettings {
935 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
936 Self(RequestBuilder::new(stub))
937 }
938
939 pub fn with_request<V: Into<crate::model::GetGenerativeSettingsRequest>>(
941 mut self,
942 v: V,
943 ) -> Self {
944 self.0.request = v.into();
945 self
946 }
947
948 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
950 self.0.options = v.into();
951 self
952 }
953
954 pub async fn send(self) -> Result<crate::model::GenerativeSettings> {
956 (*self.0.stub)
957 .get_generative_settings(self.0.request, self.0.options)
958 .await
959 .map(crate::Response::into_body)
960 }
961
962 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
966 self.0.request.name = v.into();
967 self
968 }
969
970 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
974 self.0.request.language_code = v.into();
975 self
976 }
977 }
978
979 #[doc(hidden)]
980 impl crate::RequestBuilder for GetGenerativeSettings {
981 fn request_options(&mut self) -> &mut crate::RequestOptions {
982 &mut self.0.options
983 }
984 }
985
986 #[derive(Clone, Debug)]
1003 pub struct UpdateGenerativeSettings(
1004 RequestBuilder<crate::model::UpdateGenerativeSettingsRequest>,
1005 );
1006
1007 impl UpdateGenerativeSettings {
1008 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1009 Self(RequestBuilder::new(stub))
1010 }
1011
1012 pub fn with_request<V: Into<crate::model::UpdateGenerativeSettingsRequest>>(
1014 mut self,
1015 v: V,
1016 ) -> Self {
1017 self.0.request = v.into();
1018 self
1019 }
1020
1021 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1023 self.0.options = v.into();
1024 self
1025 }
1026
1027 pub async fn send(self) -> Result<crate::model::GenerativeSettings> {
1029 (*self.0.stub)
1030 .update_generative_settings(self.0.request, self.0.options)
1031 .await
1032 .map(crate::Response::into_body)
1033 }
1034
1035 pub fn set_generative_settings<T>(mut self, v: T) -> Self
1039 where
1040 T: std::convert::Into<crate::model::GenerativeSettings>,
1041 {
1042 self.0.request.generative_settings = std::option::Option::Some(v.into());
1043 self
1044 }
1045
1046 pub fn set_or_clear_generative_settings<T>(mut self, v: std::option::Option<T>) -> Self
1050 where
1051 T: std::convert::Into<crate::model::GenerativeSettings>,
1052 {
1053 self.0.request.generative_settings = v.map(|x| x.into());
1054 self
1055 }
1056
1057 pub fn set_update_mask<T>(mut self, v: T) -> Self
1059 where
1060 T: std::convert::Into<wkt::FieldMask>,
1061 {
1062 self.0.request.update_mask = std::option::Option::Some(v.into());
1063 self
1064 }
1065
1066 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1068 where
1069 T: std::convert::Into<wkt::FieldMask>,
1070 {
1071 self.0.request.update_mask = v.map(|x| x.into());
1072 self
1073 }
1074 }
1075
1076 #[doc(hidden)]
1077 impl crate::RequestBuilder for UpdateGenerativeSettings {
1078 fn request_options(&mut self) -> &mut crate::RequestOptions {
1079 &mut self.0.options
1080 }
1081 }
1082
1083 #[derive(Clone, Debug)]
1104 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1105
1106 impl ListLocations {
1107 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1108 Self(RequestBuilder::new(stub))
1109 }
1110
1111 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1113 mut self,
1114 v: V,
1115 ) -> Self {
1116 self.0.request = v.into();
1117 self
1118 }
1119
1120 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1122 self.0.options = v.into();
1123 self
1124 }
1125
1126 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1128 (*self.0.stub)
1129 .list_locations(self.0.request, self.0.options)
1130 .await
1131 .map(crate::Response::into_body)
1132 }
1133
1134 pub fn by_page(
1136 self,
1137 ) -> impl google_cloud_gax::paginator::Paginator<
1138 google_cloud_location::model::ListLocationsResponse,
1139 crate::Error,
1140 > {
1141 use std::clone::Clone;
1142 let token = self.0.request.page_token.clone();
1143 let execute = move |token: String| {
1144 let mut builder = self.clone();
1145 builder.0.request = builder.0.request.set_page_token(token);
1146 builder.send()
1147 };
1148 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1149 }
1150
1151 pub fn by_item(
1153 self,
1154 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1155 google_cloud_location::model::ListLocationsResponse,
1156 crate::Error,
1157 > {
1158 use google_cloud_gax::paginator::Paginator;
1159 self.by_page().items()
1160 }
1161
1162 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1164 self.0.request.name = v.into();
1165 self
1166 }
1167
1168 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1170 self.0.request.filter = v.into();
1171 self
1172 }
1173
1174 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1176 self.0.request.page_size = v.into();
1177 self
1178 }
1179
1180 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1182 self.0.request.page_token = v.into();
1183 self
1184 }
1185 }
1186
1187 #[doc(hidden)]
1188 impl crate::RequestBuilder for ListLocations {
1189 fn request_options(&mut self) -> &mut crate::RequestOptions {
1190 &mut self.0.options
1191 }
1192 }
1193
1194 #[derive(Clone, Debug)]
1211 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1212
1213 impl GetLocation {
1214 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1215 Self(RequestBuilder::new(stub))
1216 }
1217
1218 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1220 mut self,
1221 v: V,
1222 ) -> Self {
1223 self.0.request = v.into();
1224 self
1225 }
1226
1227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1229 self.0.options = v.into();
1230 self
1231 }
1232
1233 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1235 (*self.0.stub)
1236 .get_location(self.0.request, self.0.options)
1237 .await
1238 .map(crate::Response::into_body)
1239 }
1240
1241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1243 self.0.request.name = v.into();
1244 self
1245 }
1246 }
1247
1248 #[doc(hidden)]
1249 impl crate::RequestBuilder for GetLocation {
1250 fn request_options(&mut self) -> &mut crate::RequestOptions {
1251 &mut self.0.options
1252 }
1253 }
1254
1255 #[derive(Clone, Debug)]
1276 pub struct ListOperations(
1277 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1278 );
1279
1280 impl ListOperations {
1281 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1282 Self(RequestBuilder::new(stub))
1283 }
1284
1285 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1287 mut self,
1288 v: V,
1289 ) -> Self {
1290 self.0.request = v.into();
1291 self
1292 }
1293
1294 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1296 self.0.options = v.into();
1297 self
1298 }
1299
1300 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1302 (*self.0.stub)
1303 .list_operations(self.0.request, self.0.options)
1304 .await
1305 .map(crate::Response::into_body)
1306 }
1307
1308 pub fn by_page(
1310 self,
1311 ) -> impl google_cloud_gax::paginator::Paginator<
1312 google_cloud_longrunning::model::ListOperationsResponse,
1313 crate::Error,
1314 > {
1315 use std::clone::Clone;
1316 let token = self.0.request.page_token.clone();
1317 let execute = move |token: String| {
1318 let mut builder = self.clone();
1319 builder.0.request = builder.0.request.set_page_token(token);
1320 builder.send()
1321 };
1322 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1323 }
1324
1325 pub fn by_item(
1327 self,
1328 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1329 google_cloud_longrunning::model::ListOperationsResponse,
1330 crate::Error,
1331 > {
1332 use google_cloud_gax::paginator::Paginator;
1333 self.by_page().items()
1334 }
1335
1336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1338 self.0.request.name = v.into();
1339 self
1340 }
1341
1342 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1344 self.0.request.filter = v.into();
1345 self
1346 }
1347
1348 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1350 self.0.request.page_size = v.into();
1351 self
1352 }
1353
1354 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1356 self.0.request.page_token = v.into();
1357 self
1358 }
1359
1360 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1362 self.0.request.return_partial_success = v.into();
1363 self
1364 }
1365 }
1366
1367 #[doc(hidden)]
1368 impl crate::RequestBuilder for ListOperations {
1369 fn request_options(&mut self) -> &mut crate::RequestOptions {
1370 &mut self.0.options
1371 }
1372 }
1373
1374 #[derive(Clone, Debug)]
1391 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1392
1393 impl GetOperation {
1394 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1395 Self(RequestBuilder::new(stub))
1396 }
1397
1398 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1400 mut self,
1401 v: V,
1402 ) -> Self {
1403 self.0.request = v.into();
1404 self
1405 }
1406
1407 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1409 self.0.options = v.into();
1410 self
1411 }
1412
1413 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1415 (*self.0.stub)
1416 .get_operation(self.0.request, self.0.options)
1417 .await
1418 .map(crate::Response::into_body)
1419 }
1420
1421 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1423 self.0.request.name = v.into();
1424 self
1425 }
1426 }
1427
1428 #[doc(hidden)]
1429 impl crate::RequestBuilder for GetOperation {
1430 fn request_options(&mut self) -> &mut crate::RequestOptions {
1431 &mut self.0.options
1432 }
1433 }
1434
1435 #[derive(Clone, Debug)]
1452 pub struct CancelOperation(
1453 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1454 );
1455
1456 impl CancelOperation {
1457 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1458 Self(RequestBuilder::new(stub))
1459 }
1460
1461 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1463 mut self,
1464 v: V,
1465 ) -> Self {
1466 self.0.request = v.into();
1467 self
1468 }
1469
1470 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1472 self.0.options = v.into();
1473 self
1474 }
1475
1476 pub async fn send(self) -> Result<()> {
1478 (*self.0.stub)
1479 .cancel_operation(self.0.request, self.0.options)
1480 .await
1481 .map(crate::Response::into_body)
1482 }
1483
1484 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1486 self.0.request.name = v.into();
1487 self
1488 }
1489 }
1490
1491 #[doc(hidden)]
1492 impl crate::RequestBuilder for CancelOperation {
1493 fn request_options(&mut self) -> &mut crate::RequestOptions {
1494 &mut self.0.options
1495 }
1496 }
1497}
1498
1499#[cfg(feature = "changelogs")]
1501#[cfg_attr(docsrs, doc(cfg(feature = "changelogs")))]
1502pub mod changelogs {
1503 use crate::Result;
1504
1505 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1519
1520 pub(crate) mod client {
1521 use super::super::super::client::Changelogs;
1522 pub struct Factory;
1523 impl crate::ClientFactory for Factory {
1524 type Client = Changelogs;
1525 type Credentials = gaxi::options::Credentials;
1526 async fn build(
1527 self,
1528 config: gaxi::options::ClientConfig,
1529 ) -> crate::ClientBuilderResult<Self::Client> {
1530 Self::Client::new(config).await
1531 }
1532 }
1533 }
1534
1535 #[derive(Clone, Debug)]
1537 pub(crate) struct RequestBuilder<R: std::default::Default> {
1538 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1539 request: R,
1540 options: crate::RequestOptions,
1541 }
1542
1543 impl<R> RequestBuilder<R>
1544 where
1545 R: std::default::Default,
1546 {
1547 pub(crate) fn new(
1548 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1549 ) -> Self {
1550 Self {
1551 stub,
1552 request: R::default(),
1553 options: crate::RequestOptions::default(),
1554 }
1555 }
1556 }
1557
1558 #[derive(Clone, Debug)]
1579 pub struct ListChangelogs(RequestBuilder<crate::model::ListChangelogsRequest>);
1580
1581 impl ListChangelogs {
1582 pub(crate) fn new(
1583 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1584 ) -> Self {
1585 Self(RequestBuilder::new(stub))
1586 }
1587
1588 pub fn with_request<V: Into<crate::model::ListChangelogsRequest>>(mut self, v: V) -> Self {
1590 self.0.request = v.into();
1591 self
1592 }
1593
1594 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1596 self.0.options = v.into();
1597 self
1598 }
1599
1600 pub async fn send(self) -> Result<crate::model::ListChangelogsResponse> {
1602 (*self.0.stub)
1603 .list_changelogs(self.0.request, self.0.options)
1604 .await
1605 .map(crate::Response::into_body)
1606 }
1607
1608 pub fn by_page(
1610 self,
1611 ) -> impl google_cloud_gax::paginator::Paginator<
1612 crate::model::ListChangelogsResponse,
1613 crate::Error,
1614 > {
1615 use std::clone::Clone;
1616 let token = self.0.request.page_token.clone();
1617 let execute = move |token: String| {
1618 let mut builder = self.clone();
1619 builder.0.request = builder.0.request.set_page_token(token);
1620 builder.send()
1621 };
1622 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1623 }
1624
1625 pub fn by_item(
1627 self,
1628 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1629 crate::model::ListChangelogsResponse,
1630 crate::Error,
1631 > {
1632 use google_cloud_gax::paginator::Paginator;
1633 self.by_page().items()
1634 }
1635
1636 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1640 self.0.request.parent = v.into();
1641 self
1642 }
1643
1644 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1646 self.0.request.filter = v.into();
1647 self
1648 }
1649
1650 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1652 self.0.request.page_size = v.into();
1653 self
1654 }
1655
1656 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1658 self.0.request.page_token = v.into();
1659 self
1660 }
1661 }
1662
1663 #[doc(hidden)]
1664 impl crate::RequestBuilder for ListChangelogs {
1665 fn request_options(&mut self) -> &mut crate::RequestOptions {
1666 &mut self.0.options
1667 }
1668 }
1669
1670 #[derive(Clone, Debug)]
1687 pub struct GetChangelog(RequestBuilder<crate::model::GetChangelogRequest>);
1688
1689 impl GetChangelog {
1690 pub(crate) fn new(
1691 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1692 ) -> Self {
1693 Self(RequestBuilder::new(stub))
1694 }
1695
1696 pub fn with_request<V: Into<crate::model::GetChangelogRequest>>(mut self, v: V) -> Self {
1698 self.0.request = v.into();
1699 self
1700 }
1701
1702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1704 self.0.options = v.into();
1705 self
1706 }
1707
1708 pub async fn send(self) -> Result<crate::model::Changelog> {
1710 (*self.0.stub)
1711 .get_changelog(self.0.request, self.0.options)
1712 .await
1713 .map(crate::Response::into_body)
1714 }
1715
1716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1720 self.0.request.name = v.into();
1721 self
1722 }
1723 }
1724
1725 #[doc(hidden)]
1726 impl crate::RequestBuilder for GetChangelog {
1727 fn request_options(&mut self) -> &mut crate::RequestOptions {
1728 &mut self.0.options
1729 }
1730 }
1731
1732 #[derive(Clone, Debug)]
1753 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1754
1755 impl ListLocations {
1756 pub(crate) fn new(
1757 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1758 ) -> Self {
1759 Self(RequestBuilder::new(stub))
1760 }
1761
1762 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1764 mut self,
1765 v: V,
1766 ) -> Self {
1767 self.0.request = v.into();
1768 self
1769 }
1770
1771 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1773 self.0.options = v.into();
1774 self
1775 }
1776
1777 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1779 (*self.0.stub)
1780 .list_locations(self.0.request, self.0.options)
1781 .await
1782 .map(crate::Response::into_body)
1783 }
1784
1785 pub fn by_page(
1787 self,
1788 ) -> impl google_cloud_gax::paginator::Paginator<
1789 google_cloud_location::model::ListLocationsResponse,
1790 crate::Error,
1791 > {
1792 use std::clone::Clone;
1793 let token = self.0.request.page_token.clone();
1794 let execute = move |token: String| {
1795 let mut builder = self.clone();
1796 builder.0.request = builder.0.request.set_page_token(token);
1797 builder.send()
1798 };
1799 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1800 }
1801
1802 pub fn by_item(
1804 self,
1805 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1806 google_cloud_location::model::ListLocationsResponse,
1807 crate::Error,
1808 > {
1809 use google_cloud_gax::paginator::Paginator;
1810 self.by_page().items()
1811 }
1812
1813 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1815 self.0.request.name = v.into();
1816 self
1817 }
1818
1819 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1821 self.0.request.filter = v.into();
1822 self
1823 }
1824
1825 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1827 self.0.request.page_size = v.into();
1828 self
1829 }
1830
1831 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1833 self.0.request.page_token = v.into();
1834 self
1835 }
1836 }
1837
1838 #[doc(hidden)]
1839 impl crate::RequestBuilder for ListLocations {
1840 fn request_options(&mut self) -> &mut crate::RequestOptions {
1841 &mut self.0.options
1842 }
1843 }
1844
1845 #[derive(Clone, Debug)]
1862 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1863
1864 impl GetLocation {
1865 pub(crate) fn new(
1866 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1867 ) -> Self {
1868 Self(RequestBuilder::new(stub))
1869 }
1870
1871 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1873 mut self,
1874 v: V,
1875 ) -> Self {
1876 self.0.request = v.into();
1877 self
1878 }
1879
1880 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1882 self.0.options = v.into();
1883 self
1884 }
1885
1886 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1888 (*self.0.stub)
1889 .get_location(self.0.request, self.0.options)
1890 .await
1891 .map(crate::Response::into_body)
1892 }
1893
1894 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1896 self.0.request.name = v.into();
1897 self
1898 }
1899 }
1900
1901 #[doc(hidden)]
1902 impl crate::RequestBuilder for GetLocation {
1903 fn request_options(&mut self) -> &mut crate::RequestOptions {
1904 &mut self.0.options
1905 }
1906 }
1907
1908 #[derive(Clone, Debug)]
1929 pub struct ListOperations(
1930 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1931 );
1932
1933 impl ListOperations {
1934 pub(crate) fn new(
1935 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
1936 ) -> Self {
1937 Self(RequestBuilder::new(stub))
1938 }
1939
1940 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1942 mut self,
1943 v: V,
1944 ) -> Self {
1945 self.0.request = v.into();
1946 self
1947 }
1948
1949 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1951 self.0.options = v.into();
1952 self
1953 }
1954
1955 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1957 (*self.0.stub)
1958 .list_operations(self.0.request, self.0.options)
1959 .await
1960 .map(crate::Response::into_body)
1961 }
1962
1963 pub fn by_page(
1965 self,
1966 ) -> impl google_cloud_gax::paginator::Paginator<
1967 google_cloud_longrunning::model::ListOperationsResponse,
1968 crate::Error,
1969 > {
1970 use std::clone::Clone;
1971 let token = self.0.request.page_token.clone();
1972 let execute = move |token: String| {
1973 let mut builder = self.clone();
1974 builder.0.request = builder.0.request.set_page_token(token);
1975 builder.send()
1976 };
1977 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1978 }
1979
1980 pub fn by_item(
1982 self,
1983 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1984 google_cloud_longrunning::model::ListOperationsResponse,
1985 crate::Error,
1986 > {
1987 use google_cloud_gax::paginator::Paginator;
1988 self.by_page().items()
1989 }
1990
1991 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1993 self.0.request.name = v.into();
1994 self
1995 }
1996
1997 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1999 self.0.request.filter = v.into();
2000 self
2001 }
2002
2003 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2005 self.0.request.page_size = v.into();
2006 self
2007 }
2008
2009 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2011 self.0.request.page_token = v.into();
2012 self
2013 }
2014
2015 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2017 self.0.request.return_partial_success = v.into();
2018 self
2019 }
2020 }
2021
2022 #[doc(hidden)]
2023 impl crate::RequestBuilder for ListOperations {
2024 fn request_options(&mut self) -> &mut crate::RequestOptions {
2025 &mut self.0.options
2026 }
2027 }
2028
2029 #[derive(Clone, Debug)]
2046 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2047
2048 impl GetOperation {
2049 pub(crate) fn new(
2050 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
2051 ) -> Self {
2052 Self(RequestBuilder::new(stub))
2053 }
2054
2055 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2057 mut self,
2058 v: V,
2059 ) -> Self {
2060 self.0.request = v.into();
2061 self
2062 }
2063
2064 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2066 self.0.options = v.into();
2067 self
2068 }
2069
2070 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2072 (*self.0.stub)
2073 .get_operation(self.0.request, self.0.options)
2074 .await
2075 .map(crate::Response::into_body)
2076 }
2077
2078 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2080 self.0.request.name = v.into();
2081 self
2082 }
2083 }
2084
2085 #[doc(hidden)]
2086 impl crate::RequestBuilder for GetOperation {
2087 fn request_options(&mut self) -> &mut crate::RequestOptions {
2088 &mut self.0.options
2089 }
2090 }
2091
2092 #[derive(Clone, Debug)]
2109 pub struct CancelOperation(
2110 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2111 );
2112
2113 impl CancelOperation {
2114 pub(crate) fn new(
2115 stub: std::sync::Arc<dyn super::super::stub::dynamic::Changelogs>,
2116 ) -> Self {
2117 Self(RequestBuilder::new(stub))
2118 }
2119
2120 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2122 mut self,
2123 v: V,
2124 ) -> Self {
2125 self.0.request = v.into();
2126 self
2127 }
2128
2129 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2131 self.0.options = v.into();
2132 self
2133 }
2134
2135 pub async fn send(self) -> Result<()> {
2137 (*self.0.stub)
2138 .cancel_operation(self.0.request, self.0.options)
2139 .await
2140 .map(crate::Response::into_body)
2141 }
2142
2143 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2145 self.0.request.name = v.into();
2146 self
2147 }
2148 }
2149
2150 #[doc(hidden)]
2151 impl crate::RequestBuilder for CancelOperation {
2152 fn request_options(&mut self) -> &mut crate::RequestOptions {
2153 &mut self.0.options
2154 }
2155 }
2156}
2157
2158#[cfg(feature = "deployments")]
2160#[cfg_attr(docsrs, doc(cfg(feature = "deployments")))]
2161pub mod deployments {
2162 use crate::Result;
2163
2164 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2178
2179 pub(crate) mod client {
2180 use super::super::super::client::Deployments;
2181 pub struct Factory;
2182 impl crate::ClientFactory for Factory {
2183 type Client = Deployments;
2184 type Credentials = gaxi::options::Credentials;
2185 async fn build(
2186 self,
2187 config: gaxi::options::ClientConfig,
2188 ) -> crate::ClientBuilderResult<Self::Client> {
2189 Self::Client::new(config).await
2190 }
2191 }
2192 }
2193
2194 #[derive(Clone, Debug)]
2196 pub(crate) struct RequestBuilder<R: std::default::Default> {
2197 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2198 request: R,
2199 options: crate::RequestOptions,
2200 }
2201
2202 impl<R> RequestBuilder<R>
2203 where
2204 R: std::default::Default,
2205 {
2206 pub(crate) fn new(
2207 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2208 ) -> Self {
2209 Self {
2210 stub,
2211 request: R::default(),
2212 options: crate::RequestOptions::default(),
2213 }
2214 }
2215 }
2216
2217 #[derive(Clone, Debug)]
2238 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
2239
2240 impl ListDeployments {
2241 pub(crate) fn new(
2242 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2243 ) -> Self {
2244 Self(RequestBuilder::new(stub))
2245 }
2246
2247 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
2249 self.0.request = v.into();
2250 self
2251 }
2252
2253 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2255 self.0.options = v.into();
2256 self
2257 }
2258
2259 pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
2261 (*self.0.stub)
2262 .list_deployments(self.0.request, self.0.options)
2263 .await
2264 .map(crate::Response::into_body)
2265 }
2266
2267 pub fn by_page(
2269 self,
2270 ) -> impl google_cloud_gax::paginator::Paginator<
2271 crate::model::ListDeploymentsResponse,
2272 crate::Error,
2273 > {
2274 use std::clone::Clone;
2275 let token = self.0.request.page_token.clone();
2276 let execute = move |token: String| {
2277 let mut builder = self.clone();
2278 builder.0.request = builder.0.request.set_page_token(token);
2279 builder.send()
2280 };
2281 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2282 }
2283
2284 pub fn by_item(
2286 self,
2287 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2288 crate::model::ListDeploymentsResponse,
2289 crate::Error,
2290 > {
2291 use google_cloud_gax::paginator::Paginator;
2292 self.by_page().items()
2293 }
2294
2295 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2299 self.0.request.parent = v.into();
2300 self
2301 }
2302
2303 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2305 self.0.request.page_size = v.into();
2306 self
2307 }
2308
2309 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2311 self.0.request.page_token = v.into();
2312 self
2313 }
2314 }
2315
2316 #[doc(hidden)]
2317 impl crate::RequestBuilder for ListDeployments {
2318 fn request_options(&mut self) -> &mut crate::RequestOptions {
2319 &mut self.0.options
2320 }
2321 }
2322
2323 #[derive(Clone, Debug)]
2340 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
2341
2342 impl GetDeployment {
2343 pub(crate) fn new(
2344 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2345 ) -> Self {
2346 Self(RequestBuilder::new(stub))
2347 }
2348
2349 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
2351 self.0.request = v.into();
2352 self
2353 }
2354
2355 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2357 self.0.options = v.into();
2358 self
2359 }
2360
2361 pub async fn send(self) -> Result<crate::model::Deployment> {
2363 (*self.0.stub)
2364 .get_deployment(self.0.request, self.0.options)
2365 .await
2366 .map(crate::Response::into_body)
2367 }
2368
2369 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2373 self.0.request.name = v.into();
2374 self
2375 }
2376 }
2377
2378 #[doc(hidden)]
2379 impl crate::RequestBuilder for GetDeployment {
2380 fn request_options(&mut self) -> &mut crate::RequestOptions {
2381 &mut self.0.options
2382 }
2383 }
2384
2385 #[derive(Clone, Debug)]
2406 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2407
2408 impl ListLocations {
2409 pub(crate) fn new(
2410 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2411 ) -> Self {
2412 Self(RequestBuilder::new(stub))
2413 }
2414
2415 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2417 mut self,
2418 v: V,
2419 ) -> Self {
2420 self.0.request = v.into();
2421 self
2422 }
2423
2424 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2426 self.0.options = v.into();
2427 self
2428 }
2429
2430 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2432 (*self.0.stub)
2433 .list_locations(self.0.request, self.0.options)
2434 .await
2435 .map(crate::Response::into_body)
2436 }
2437
2438 pub fn by_page(
2440 self,
2441 ) -> impl google_cloud_gax::paginator::Paginator<
2442 google_cloud_location::model::ListLocationsResponse,
2443 crate::Error,
2444 > {
2445 use std::clone::Clone;
2446 let token = self.0.request.page_token.clone();
2447 let execute = move |token: String| {
2448 let mut builder = self.clone();
2449 builder.0.request = builder.0.request.set_page_token(token);
2450 builder.send()
2451 };
2452 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2453 }
2454
2455 pub fn by_item(
2457 self,
2458 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2459 google_cloud_location::model::ListLocationsResponse,
2460 crate::Error,
2461 > {
2462 use google_cloud_gax::paginator::Paginator;
2463 self.by_page().items()
2464 }
2465
2466 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2468 self.0.request.name = v.into();
2469 self
2470 }
2471
2472 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2474 self.0.request.filter = v.into();
2475 self
2476 }
2477
2478 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2480 self.0.request.page_size = v.into();
2481 self
2482 }
2483
2484 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2486 self.0.request.page_token = v.into();
2487 self
2488 }
2489 }
2490
2491 #[doc(hidden)]
2492 impl crate::RequestBuilder for ListLocations {
2493 fn request_options(&mut self) -> &mut crate::RequestOptions {
2494 &mut self.0.options
2495 }
2496 }
2497
2498 #[derive(Clone, Debug)]
2515 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2516
2517 impl GetLocation {
2518 pub(crate) fn new(
2519 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2520 ) -> Self {
2521 Self(RequestBuilder::new(stub))
2522 }
2523
2524 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2526 mut self,
2527 v: V,
2528 ) -> Self {
2529 self.0.request = v.into();
2530 self
2531 }
2532
2533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2535 self.0.options = v.into();
2536 self
2537 }
2538
2539 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2541 (*self.0.stub)
2542 .get_location(self.0.request, self.0.options)
2543 .await
2544 .map(crate::Response::into_body)
2545 }
2546
2547 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2549 self.0.request.name = v.into();
2550 self
2551 }
2552 }
2553
2554 #[doc(hidden)]
2555 impl crate::RequestBuilder for GetLocation {
2556 fn request_options(&mut self) -> &mut crate::RequestOptions {
2557 &mut self.0.options
2558 }
2559 }
2560
2561 #[derive(Clone, Debug)]
2582 pub struct ListOperations(
2583 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2584 );
2585
2586 impl ListOperations {
2587 pub(crate) fn new(
2588 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2589 ) -> Self {
2590 Self(RequestBuilder::new(stub))
2591 }
2592
2593 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2595 mut self,
2596 v: V,
2597 ) -> Self {
2598 self.0.request = v.into();
2599 self
2600 }
2601
2602 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2604 self.0.options = v.into();
2605 self
2606 }
2607
2608 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2610 (*self.0.stub)
2611 .list_operations(self.0.request, self.0.options)
2612 .await
2613 .map(crate::Response::into_body)
2614 }
2615
2616 pub fn by_page(
2618 self,
2619 ) -> impl google_cloud_gax::paginator::Paginator<
2620 google_cloud_longrunning::model::ListOperationsResponse,
2621 crate::Error,
2622 > {
2623 use std::clone::Clone;
2624 let token = self.0.request.page_token.clone();
2625 let execute = move |token: String| {
2626 let mut builder = self.clone();
2627 builder.0.request = builder.0.request.set_page_token(token);
2628 builder.send()
2629 };
2630 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2631 }
2632
2633 pub fn by_item(
2635 self,
2636 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2637 google_cloud_longrunning::model::ListOperationsResponse,
2638 crate::Error,
2639 > {
2640 use google_cloud_gax::paginator::Paginator;
2641 self.by_page().items()
2642 }
2643
2644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2646 self.0.request.name = v.into();
2647 self
2648 }
2649
2650 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2652 self.0.request.filter = v.into();
2653 self
2654 }
2655
2656 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2658 self.0.request.page_size = v.into();
2659 self
2660 }
2661
2662 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2664 self.0.request.page_token = v.into();
2665 self
2666 }
2667
2668 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2670 self.0.request.return_partial_success = v.into();
2671 self
2672 }
2673 }
2674
2675 #[doc(hidden)]
2676 impl crate::RequestBuilder for ListOperations {
2677 fn request_options(&mut self) -> &mut crate::RequestOptions {
2678 &mut self.0.options
2679 }
2680 }
2681
2682 #[derive(Clone, Debug)]
2699 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2700
2701 impl GetOperation {
2702 pub(crate) fn new(
2703 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2704 ) -> Self {
2705 Self(RequestBuilder::new(stub))
2706 }
2707
2708 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2710 mut self,
2711 v: V,
2712 ) -> Self {
2713 self.0.request = v.into();
2714 self
2715 }
2716
2717 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2719 self.0.options = v.into();
2720 self
2721 }
2722
2723 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2725 (*self.0.stub)
2726 .get_operation(self.0.request, self.0.options)
2727 .await
2728 .map(crate::Response::into_body)
2729 }
2730
2731 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2733 self.0.request.name = v.into();
2734 self
2735 }
2736 }
2737
2738 #[doc(hidden)]
2739 impl crate::RequestBuilder for GetOperation {
2740 fn request_options(&mut self) -> &mut crate::RequestOptions {
2741 &mut self.0.options
2742 }
2743 }
2744
2745 #[derive(Clone, Debug)]
2762 pub struct CancelOperation(
2763 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2764 );
2765
2766 impl CancelOperation {
2767 pub(crate) fn new(
2768 stub: std::sync::Arc<dyn super::super::stub::dynamic::Deployments>,
2769 ) -> Self {
2770 Self(RequestBuilder::new(stub))
2771 }
2772
2773 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2775 mut self,
2776 v: V,
2777 ) -> Self {
2778 self.0.request = v.into();
2779 self
2780 }
2781
2782 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2784 self.0.options = v.into();
2785 self
2786 }
2787
2788 pub async fn send(self) -> Result<()> {
2790 (*self.0.stub)
2791 .cancel_operation(self.0.request, self.0.options)
2792 .await
2793 .map(crate::Response::into_body)
2794 }
2795
2796 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2798 self.0.request.name = v.into();
2799 self
2800 }
2801 }
2802
2803 #[doc(hidden)]
2804 impl crate::RequestBuilder for CancelOperation {
2805 fn request_options(&mut self) -> &mut crate::RequestOptions {
2806 &mut self.0.options
2807 }
2808 }
2809}
2810
2811#[cfg(feature = "entity-types")]
2813#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
2814pub mod entity_types {
2815 use crate::Result;
2816
2817 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2831
2832 pub(crate) mod client {
2833 use super::super::super::client::EntityTypes;
2834 pub struct Factory;
2835 impl crate::ClientFactory for Factory {
2836 type Client = EntityTypes;
2837 type Credentials = gaxi::options::Credentials;
2838 async fn build(
2839 self,
2840 config: gaxi::options::ClientConfig,
2841 ) -> crate::ClientBuilderResult<Self::Client> {
2842 Self::Client::new(config).await
2843 }
2844 }
2845 }
2846
2847 #[derive(Clone, Debug)]
2849 pub(crate) struct RequestBuilder<R: std::default::Default> {
2850 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2851 request: R,
2852 options: crate::RequestOptions,
2853 }
2854
2855 impl<R> RequestBuilder<R>
2856 where
2857 R: std::default::Default,
2858 {
2859 pub(crate) fn new(
2860 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2861 ) -> Self {
2862 Self {
2863 stub,
2864 request: R::default(),
2865 options: crate::RequestOptions::default(),
2866 }
2867 }
2868 }
2869
2870 #[derive(Clone, Debug)]
2887 pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
2888
2889 impl GetEntityType {
2890 pub(crate) fn new(
2891 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2892 ) -> Self {
2893 Self(RequestBuilder::new(stub))
2894 }
2895
2896 pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
2898 self.0.request = v.into();
2899 self
2900 }
2901
2902 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2904 self.0.options = v.into();
2905 self
2906 }
2907
2908 pub async fn send(self) -> Result<crate::model::EntityType> {
2910 (*self.0.stub)
2911 .get_entity_type(self.0.request, self.0.options)
2912 .await
2913 .map(crate::Response::into_body)
2914 }
2915
2916 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2920 self.0.request.name = v.into();
2921 self
2922 }
2923
2924 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
2926 self.0.request.language_code = v.into();
2927 self
2928 }
2929 }
2930
2931 #[doc(hidden)]
2932 impl crate::RequestBuilder for GetEntityType {
2933 fn request_options(&mut self) -> &mut crate::RequestOptions {
2934 &mut self.0.options
2935 }
2936 }
2937
2938 #[derive(Clone, Debug)]
2955 pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
2956
2957 impl CreateEntityType {
2958 pub(crate) fn new(
2959 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
2960 ) -> Self {
2961 Self(RequestBuilder::new(stub))
2962 }
2963
2964 pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
2966 mut self,
2967 v: V,
2968 ) -> Self {
2969 self.0.request = v.into();
2970 self
2971 }
2972
2973 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2975 self.0.options = v.into();
2976 self
2977 }
2978
2979 pub async fn send(self) -> Result<crate::model::EntityType> {
2981 (*self.0.stub)
2982 .create_entity_type(self.0.request, self.0.options)
2983 .await
2984 .map(crate::Response::into_body)
2985 }
2986
2987 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2991 self.0.request.parent = v.into();
2992 self
2993 }
2994
2995 pub fn set_entity_type<T>(mut self, v: T) -> Self
2999 where
3000 T: std::convert::Into<crate::model::EntityType>,
3001 {
3002 self.0.request.entity_type = std::option::Option::Some(v.into());
3003 self
3004 }
3005
3006 pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
3010 where
3011 T: std::convert::Into<crate::model::EntityType>,
3012 {
3013 self.0.request.entity_type = v.map(|x| x.into());
3014 self
3015 }
3016
3017 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3019 self.0.request.language_code = v.into();
3020 self
3021 }
3022 }
3023
3024 #[doc(hidden)]
3025 impl crate::RequestBuilder for CreateEntityType {
3026 fn request_options(&mut self) -> &mut crate::RequestOptions {
3027 &mut self.0.options
3028 }
3029 }
3030
3031 #[derive(Clone, Debug)]
3048 pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
3049
3050 impl UpdateEntityType {
3051 pub(crate) fn new(
3052 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3053 ) -> Self {
3054 Self(RequestBuilder::new(stub))
3055 }
3056
3057 pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
3059 mut self,
3060 v: V,
3061 ) -> Self {
3062 self.0.request = v.into();
3063 self
3064 }
3065
3066 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3068 self.0.options = v.into();
3069 self
3070 }
3071
3072 pub async fn send(self) -> Result<crate::model::EntityType> {
3074 (*self.0.stub)
3075 .update_entity_type(self.0.request, self.0.options)
3076 .await
3077 .map(crate::Response::into_body)
3078 }
3079
3080 pub fn set_entity_type<T>(mut self, v: T) -> Self
3084 where
3085 T: std::convert::Into<crate::model::EntityType>,
3086 {
3087 self.0.request.entity_type = std::option::Option::Some(v.into());
3088 self
3089 }
3090
3091 pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
3095 where
3096 T: std::convert::Into<crate::model::EntityType>,
3097 {
3098 self.0.request.entity_type = v.map(|x| x.into());
3099 self
3100 }
3101
3102 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3104 self.0.request.language_code = v.into();
3105 self
3106 }
3107
3108 pub fn set_update_mask<T>(mut self, v: T) -> Self
3110 where
3111 T: std::convert::Into<wkt::FieldMask>,
3112 {
3113 self.0.request.update_mask = std::option::Option::Some(v.into());
3114 self
3115 }
3116
3117 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3119 where
3120 T: std::convert::Into<wkt::FieldMask>,
3121 {
3122 self.0.request.update_mask = v.map(|x| x.into());
3123 self
3124 }
3125 }
3126
3127 #[doc(hidden)]
3128 impl crate::RequestBuilder for UpdateEntityType {
3129 fn request_options(&mut self) -> &mut crate::RequestOptions {
3130 &mut self.0.options
3131 }
3132 }
3133
3134 #[derive(Clone, Debug)]
3151 pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
3152
3153 impl DeleteEntityType {
3154 pub(crate) fn new(
3155 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3156 ) -> Self {
3157 Self(RequestBuilder::new(stub))
3158 }
3159
3160 pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
3162 mut self,
3163 v: V,
3164 ) -> Self {
3165 self.0.request = v.into();
3166 self
3167 }
3168
3169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3171 self.0.options = v.into();
3172 self
3173 }
3174
3175 pub async fn send(self) -> Result<()> {
3177 (*self.0.stub)
3178 .delete_entity_type(self.0.request, self.0.options)
3179 .await
3180 .map(crate::Response::into_body)
3181 }
3182
3183 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3187 self.0.request.name = v.into();
3188 self
3189 }
3190
3191 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3193 self.0.request.force = v.into();
3194 self
3195 }
3196 }
3197
3198 #[doc(hidden)]
3199 impl crate::RequestBuilder for DeleteEntityType {
3200 fn request_options(&mut self) -> &mut crate::RequestOptions {
3201 &mut self.0.options
3202 }
3203 }
3204
3205 #[derive(Clone, Debug)]
3226 pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
3227
3228 impl ListEntityTypes {
3229 pub(crate) fn new(
3230 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3231 ) -> Self {
3232 Self(RequestBuilder::new(stub))
3233 }
3234
3235 pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
3237 self.0.request = v.into();
3238 self
3239 }
3240
3241 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3243 self.0.options = v.into();
3244 self
3245 }
3246
3247 pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
3249 (*self.0.stub)
3250 .list_entity_types(self.0.request, self.0.options)
3251 .await
3252 .map(crate::Response::into_body)
3253 }
3254
3255 pub fn by_page(
3257 self,
3258 ) -> impl google_cloud_gax::paginator::Paginator<
3259 crate::model::ListEntityTypesResponse,
3260 crate::Error,
3261 > {
3262 use std::clone::Clone;
3263 let token = self.0.request.page_token.clone();
3264 let execute = move |token: String| {
3265 let mut builder = self.clone();
3266 builder.0.request = builder.0.request.set_page_token(token);
3267 builder.send()
3268 };
3269 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3270 }
3271
3272 pub fn by_item(
3274 self,
3275 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3276 crate::model::ListEntityTypesResponse,
3277 crate::Error,
3278 > {
3279 use google_cloud_gax::paginator::Paginator;
3280 self.by_page().items()
3281 }
3282
3283 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3287 self.0.request.parent = v.into();
3288 self
3289 }
3290
3291 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3293 self.0.request.language_code = v.into();
3294 self
3295 }
3296
3297 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3299 self.0.request.page_size = v.into();
3300 self
3301 }
3302
3303 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3305 self.0.request.page_token = v.into();
3306 self
3307 }
3308 }
3309
3310 #[doc(hidden)]
3311 impl crate::RequestBuilder for ListEntityTypes {
3312 fn request_options(&mut self) -> &mut crate::RequestOptions {
3313 &mut self.0.options
3314 }
3315 }
3316
3317 #[derive(Clone, Debug)]
3335 pub struct ExportEntityTypes(RequestBuilder<crate::model::ExportEntityTypesRequest>);
3336
3337 impl ExportEntityTypes {
3338 pub(crate) fn new(
3339 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3340 ) -> Self {
3341 Self(RequestBuilder::new(stub))
3342 }
3343
3344 pub fn with_request<V: Into<crate::model::ExportEntityTypesRequest>>(
3346 mut self,
3347 v: V,
3348 ) -> Self {
3349 self.0.request = v.into();
3350 self
3351 }
3352
3353 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3355 self.0.options = v.into();
3356 self
3357 }
3358
3359 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3366 (*self.0.stub)
3367 .export_entity_types(self.0.request, self.0.options)
3368 .await
3369 .map(crate::Response::into_body)
3370 }
3371
3372 pub fn poller(
3374 self,
3375 ) -> impl google_cloud_lro::Poller<
3376 crate::model::ExportEntityTypesResponse,
3377 crate::model::ExportEntityTypesMetadata,
3378 > {
3379 type Operation = google_cloud_lro::internal::Operation<
3380 crate::model::ExportEntityTypesResponse,
3381 crate::model::ExportEntityTypesMetadata,
3382 >;
3383 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3384 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3385
3386 let stub = self.0.stub.clone();
3387 let mut options = self.0.options.clone();
3388 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3389 let query = move |name| {
3390 let stub = stub.clone();
3391 let options = options.clone();
3392 async {
3393 let op = GetOperation::new(stub)
3394 .set_name(name)
3395 .with_options(options)
3396 .send()
3397 .await?;
3398 Ok(Operation::new(op))
3399 }
3400 };
3401
3402 let start = move || async {
3403 let op = self.send().await?;
3404 Ok(Operation::new(op))
3405 };
3406
3407 google_cloud_lro::internal::new_poller(
3408 polling_error_policy,
3409 polling_backoff_policy,
3410 start,
3411 query,
3412 )
3413 }
3414
3415 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3419 self.0.request.parent = v.into();
3420 self
3421 }
3422
3423 pub fn set_entity_types<T, V>(mut self, v: T) -> Self
3427 where
3428 T: std::iter::IntoIterator<Item = V>,
3429 V: std::convert::Into<std::string::String>,
3430 {
3431 use std::iter::Iterator;
3432 self.0.request.entity_types = v.into_iter().map(|i| i.into()).collect();
3433 self
3434 }
3435
3436 pub fn set_data_format<T: Into<crate::model::export_entity_types_request::DataFormat>>(
3438 mut self,
3439 v: T,
3440 ) -> Self {
3441 self.0.request.data_format = v.into();
3442 self
3443 }
3444
3445 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
3447 self.0.request.language_code = v.into();
3448 self
3449 }
3450
3451 pub fn set_destination<
3456 T: Into<Option<crate::model::export_entity_types_request::Destination>>,
3457 >(
3458 mut self,
3459 v: T,
3460 ) -> Self {
3461 self.0.request.destination = v.into();
3462 self
3463 }
3464
3465 pub fn set_entity_types_uri<T: std::convert::Into<std::string::String>>(
3471 mut self,
3472 v: T,
3473 ) -> Self {
3474 self.0.request = self.0.request.set_entity_types_uri(v);
3475 self
3476 }
3477
3478 pub fn set_entity_types_content_inline<T: std::convert::Into<bool>>(
3484 mut self,
3485 v: T,
3486 ) -> Self {
3487 self.0.request = self.0.request.set_entity_types_content_inline(v);
3488 self
3489 }
3490 }
3491
3492 #[doc(hidden)]
3493 impl crate::RequestBuilder for ExportEntityTypes {
3494 fn request_options(&mut self) -> &mut crate::RequestOptions {
3495 &mut self.0.options
3496 }
3497 }
3498
3499 #[derive(Clone, Debug)]
3517 pub struct ImportEntityTypes(RequestBuilder<crate::model::ImportEntityTypesRequest>);
3518
3519 impl ImportEntityTypes {
3520 pub(crate) fn new(
3521 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3522 ) -> Self {
3523 Self(RequestBuilder::new(stub))
3524 }
3525
3526 pub fn with_request<V: Into<crate::model::ImportEntityTypesRequest>>(
3528 mut self,
3529 v: V,
3530 ) -> Self {
3531 self.0.request = v.into();
3532 self
3533 }
3534
3535 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3537 self.0.options = v.into();
3538 self
3539 }
3540
3541 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
3548 (*self.0.stub)
3549 .import_entity_types(self.0.request, self.0.options)
3550 .await
3551 .map(crate::Response::into_body)
3552 }
3553
3554 pub fn poller(
3556 self,
3557 ) -> impl google_cloud_lro::Poller<
3558 crate::model::ImportEntityTypesResponse,
3559 crate::model::ImportEntityTypesMetadata,
3560 > {
3561 type Operation = google_cloud_lro::internal::Operation<
3562 crate::model::ImportEntityTypesResponse,
3563 crate::model::ImportEntityTypesMetadata,
3564 >;
3565 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
3566 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
3567
3568 let stub = self.0.stub.clone();
3569 let mut options = self.0.options.clone();
3570 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
3571 let query = move |name| {
3572 let stub = stub.clone();
3573 let options = options.clone();
3574 async {
3575 let op = GetOperation::new(stub)
3576 .set_name(name)
3577 .with_options(options)
3578 .send()
3579 .await?;
3580 Ok(Operation::new(op))
3581 }
3582 };
3583
3584 let start = move || async {
3585 let op = self.send().await?;
3586 Ok(Operation::new(op))
3587 };
3588
3589 google_cloud_lro::internal::new_poller(
3590 polling_error_policy,
3591 polling_backoff_policy,
3592 start,
3593 query,
3594 )
3595 }
3596
3597 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3601 self.0.request.parent = v.into();
3602 self
3603 }
3604
3605 pub fn set_merge_option<T: Into<crate::model::import_entity_types_request::MergeOption>>(
3609 mut self,
3610 v: T,
3611 ) -> Self {
3612 self.0.request.merge_option = v.into();
3613 self
3614 }
3615
3616 pub fn set_target_entity_type<T: Into<std::string::String>>(mut self, v: T) -> Self {
3618 self.0.request.target_entity_type = v.into();
3619 self
3620 }
3621
3622 pub fn set_entity_types<
3627 T: Into<Option<crate::model::import_entity_types_request::EntityTypes>>,
3628 >(
3629 mut self,
3630 v: T,
3631 ) -> Self {
3632 self.0.request.entity_types = v.into();
3633 self
3634 }
3635
3636 pub fn set_entity_types_uri<T: std::convert::Into<std::string::String>>(
3642 mut self,
3643 v: T,
3644 ) -> Self {
3645 self.0.request = self.0.request.set_entity_types_uri(v);
3646 self
3647 }
3648
3649 pub fn set_entity_types_content<
3655 T: std::convert::Into<std::boxed::Box<crate::model::InlineSource>>,
3656 >(
3657 mut self,
3658 v: T,
3659 ) -> Self {
3660 self.0.request = self.0.request.set_entity_types_content(v);
3661 self
3662 }
3663 }
3664
3665 #[doc(hidden)]
3666 impl crate::RequestBuilder for ImportEntityTypes {
3667 fn request_options(&mut self) -> &mut crate::RequestOptions {
3668 &mut self.0.options
3669 }
3670 }
3671
3672 #[derive(Clone, Debug)]
3693 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
3694
3695 impl ListLocations {
3696 pub(crate) fn new(
3697 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3698 ) -> Self {
3699 Self(RequestBuilder::new(stub))
3700 }
3701
3702 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
3704 mut self,
3705 v: V,
3706 ) -> Self {
3707 self.0.request = v.into();
3708 self
3709 }
3710
3711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3713 self.0.options = v.into();
3714 self
3715 }
3716
3717 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
3719 (*self.0.stub)
3720 .list_locations(self.0.request, self.0.options)
3721 .await
3722 .map(crate::Response::into_body)
3723 }
3724
3725 pub fn by_page(
3727 self,
3728 ) -> impl google_cloud_gax::paginator::Paginator<
3729 google_cloud_location::model::ListLocationsResponse,
3730 crate::Error,
3731 > {
3732 use std::clone::Clone;
3733 let token = self.0.request.page_token.clone();
3734 let execute = move |token: String| {
3735 let mut builder = self.clone();
3736 builder.0.request = builder.0.request.set_page_token(token);
3737 builder.send()
3738 };
3739 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3740 }
3741
3742 pub fn by_item(
3744 self,
3745 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3746 google_cloud_location::model::ListLocationsResponse,
3747 crate::Error,
3748 > {
3749 use google_cloud_gax::paginator::Paginator;
3750 self.by_page().items()
3751 }
3752
3753 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3755 self.0.request.name = v.into();
3756 self
3757 }
3758
3759 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3761 self.0.request.filter = v.into();
3762 self
3763 }
3764
3765 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3767 self.0.request.page_size = v.into();
3768 self
3769 }
3770
3771 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3773 self.0.request.page_token = v.into();
3774 self
3775 }
3776 }
3777
3778 #[doc(hidden)]
3779 impl crate::RequestBuilder for ListLocations {
3780 fn request_options(&mut self) -> &mut crate::RequestOptions {
3781 &mut self.0.options
3782 }
3783 }
3784
3785 #[derive(Clone, Debug)]
3802 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
3803
3804 impl GetLocation {
3805 pub(crate) fn new(
3806 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3807 ) -> Self {
3808 Self(RequestBuilder::new(stub))
3809 }
3810
3811 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
3813 mut self,
3814 v: V,
3815 ) -> Self {
3816 self.0.request = v.into();
3817 self
3818 }
3819
3820 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3822 self.0.options = v.into();
3823 self
3824 }
3825
3826 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
3828 (*self.0.stub)
3829 .get_location(self.0.request, self.0.options)
3830 .await
3831 .map(crate::Response::into_body)
3832 }
3833
3834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3836 self.0.request.name = v.into();
3837 self
3838 }
3839 }
3840
3841 #[doc(hidden)]
3842 impl crate::RequestBuilder for GetLocation {
3843 fn request_options(&mut self) -> &mut crate::RequestOptions {
3844 &mut self.0.options
3845 }
3846 }
3847
3848 #[derive(Clone, Debug)]
3869 pub struct ListOperations(
3870 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
3871 );
3872
3873 impl ListOperations {
3874 pub(crate) fn new(
3875 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3876 ) -> Self {
3877 Self(RequestBuilder::new(stub))
3878 }
3879
3880 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
3882 mut self,
3883 v: V,
3884 ) -> Self {
3885 self.0.request = v.into();
3886 self
3887 }
3888
3889 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3891 self.0.options = v.into();
3892 self
3893 }
3894
3895 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
3897 (*self.0.stub)
3898 .list_operations(self.0.request, self.0.options)
3899 .await
3900 .map(crate::Response::into_body)
3901 }
3902
3903 pub fn by_page(
3905 self,
3906 ) -> impl google_cloud_gax::paginator::Paginator<
3907 google_cloud_longrunning::model::ListOperationsResponse,
3908 crate::Error,
3909 > {
3910 use std::clone::Clone;
3911 let token = self.0.request.page_token.clone();
3912 let execute = move |token: String| {
3913 let mut builder = self.clone();
3914 builder.0.request = builder.0.request.set_page_token(token);
3915 builder.send()
3916 };
3917 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3918 }
3919
3920 pub fn by_item(
3922 self,
3923 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3924 google_cloud_longrunning::model::ListOperationsResponse,
3925 crate::Error,
3926 > {
3927 use google_cloud_gax::paginator::Paginator;
3928 self.by_page().items()
3929 }
3930
3931 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3933 self.0.request.name = v.into();
3934 self
3935 }
3936
3937 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3939 self.0.request.filter = v.into();
3940 self
3941 }
3942
3943 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3945 self.0.request.page_size = v.into();
3946 self
3947 }
3948
3949 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3951 self.0.request.page_token = v.into();
3952 self
3953 }
3954
3955 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
3957 self.0.request.return_partial_success = v.into();
3958 self
3959 }
3960 }
3961
3962 #[doc(hidden)]
3963 impl crate::RequestBuilder for ListOperations {
3964 fn request_options(&mut self) -> &mut crate::RequestOptions {
3965 &mut self.0.options
3966 }
3967 }
3968
3969 #[derive(Clone, Debug)]
3986 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
3987
3988 impl GetOperation {
3989 pub(crate) fn new(
3990 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
3991 ) -> Self {
3992 Self(RequestBuilder::new(stub))
3993 }
3994
3995 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
3997 mut self,
3998 v: V,
3999 ) -> Self {
4000 self.0.request = v.into();
4001 self
4002 }
4003
4004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4006 self.0.options = v.into();
4007 self
4008 }
4009
4010 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4012 (*self.0.stub)
4013 .get_operation(self.0.request, self.0.options)
4014 .await
4015 .map(crate::Response::into_body)
4016 }
4017
4018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4020 self.0.request.name = v.into();
4021 self
4022 }
4023 }
4024
4025 #[doc(hidden)]
4026 impl crate::RequestBuilder for GetOperation {
4027 fn request_options(&mut self) -> &mut crate::RequestOptions {
4028 &mut self.0.options
4029 }
4030 }
4031
4032 #[derive(Clone, Debug)]
4049 pub struct CancelOperation(
4050 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4051 );
4052
4053 impl CancelOperation {
4054 pub(crate) fn new(
4055 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
4056 ) -> Self {
4057 Self(RequestBuilder::new(stub))
4058 }
4059
4060 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4062 mut self,
4063 v: V,
4064 ) -> Self {
4065 self.0.request = v.into();
4066 self
4067 }
4068
4069 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4071 self.0.options = v.into();
4072 self
4073 }
4074
4075 pub async fn send(self) -> Result<()> {
4077 (*self.0.stub)
4078 .cancel_operation(self.0.request, self.0.options)
4079 .await
4080 .map(crate::Response::into_body)
4081 }
4082
4083 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4085 self.0.request.name = v.into();
4086 self
4087 }
4088 }
4089
4090 #[doc(hidden)]
4091 impl crate::RequestBuilder for CancelOperation {
4092 fn request_options(&mut self) -> &mut crate::RequestOptions {
4093 &mut self.0.options
4094 }
4095 }
4096}
4097
4098#[cfg(feature = "environments")]
4100#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
4101pub mod environments {
4102 use crate::Result;
4103
4104 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4118
4119 pub(crate) mod client {
4120 use super::super::super::client::Environments;
4121 pub struct Factory;
4122 impl crate::ClientFactory for Factory {
4123 type Client = Environments;
4124 type Credentials = gaxi::options::Credentials;
4125 async fn build(
4126 self,
4127 config: gaxi::options::ClientConfig,
4128 ) -> crate::ClientBuilderResult<Self::Client> {
4129 Self::Client::new(config).await
4130 }
4131 }
4132 }
4133
4134 #[derive(Clone, Debug)]
4136 pub(crate) struct RequestBuilder<R: std::default::Default> {
4137 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4138 request: R,
4139 options: crate::RequestOptions,
4140 }
4141
4142 impl<R> RequestBuilder<R>
4143 where
4144 R: std::default::Default,
4145 {
4146 pub(crate) fn new(
4147 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4148 ) -> Self {
4149 Self {
4150 stub,
4151 request: R::default(),
4152 options: crate::RequestOptions::default(),
4153 }
4154 }
4155 }
4156
4157 #[derive(Clone, Debug)]
4178 pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
4179
4180 impl ListEnvironments {
4181 pub(crate) fn new(
4182 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4183 ) -> Self {
4184 Self(RequestBuilder::new(stub))
4185 }
4186
4187 pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
4189 mut self,
4190 v: V,
4191 ) -> Self {
4192 self.0.request = v.into();
4193 self
4194 }
4195
4196 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4198 self.0.options = v.into();
4199 self
4200 }
4201
4202 pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
4204 (*self.0.stub)
4205 .list_environments(self.0.request, self.0.options)
4206 .await
4207 .map(crate::Response::into_body)
4208 }
4209
4210 pub fn by_page(
4212 self,
4213 ) -> impl google_cloud_gax::paginator::Paginator<
4214 crate::model::ListEnvironmentsResponse,
4215 crate::Error,
4216 > {
4217 use std::clone::Clone;
4218 let token = self.0.request.page_token.clone();
4219 let execute = move |token: String| {
4220 let mut builder = self.clone();
4221 builder.0.request = builder.0.request.set_page_token(token);
4222 builder.send()
4223 };
4224 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4225 }
4226
4227 pub fn by_item(
4229 self,
4230 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4231 crate::model::ListEnvironmentsResponse,
4232 crate::Error,
4233 > {
4234 use google_cloud_gax::paginator::Paginator;
4235 self.by_page().items()
4236 }
4237
4238 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4242 self.0.request.parent = v.into();
4243 self
4244 }
4245
4246 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4248 self.0.request.page_size = v.into();
4249 self
4250 }
4251
4252 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4254 self.0.request.page_token = v.into();
4255 self
4256 }
4257 }
4258
4259 #[doc(hidden)]
4260 impl crate::RequestBuilder for ListEnvironments {
4261 fn request_options(&mut self) -> &mut crate::RequestOptions {
4262 &mut self.0.options
4263 }
4264 }
4265
4266 #[derive(Clone, Debug)]
4283 pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
4284
4285 impl GetEnvironment {
4286 pub(crate) fn new(
4287 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4288 ) -> Self {
4289 Self(RequestBuilder::new(stub))
4290 }
4291
4292 pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
4294 self.0.request = v.into();
4295 self
4296 }
4297
4298 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4300 self.0.options = v.into();
4301 self
4302 }
4303
4304 pub async fn send(self) -> Result<crate::model::Environment> {
4306 (*self.0.stub)
4307 .get_environment(self.0.request, self.0.options)
4308 .await
4309 .map(crate::Response::into_body)
4310 }
4311
4312 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4316 self.0.request.name = v.into();
4317 self
4318 }
4319 }
4320
4321 #[doc(hidden)]
4322 impl crate::RequestBuilder for GetEnvironment {
4323 fn request_options(&mut self) -> &mut crate::RequestOptions {
4324 &mut self.0.options
4325 }
4326 }
4327
4328 #[derive(Clone, Debug)]
4346 pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
4347
4348 impl CreateEnvironment {
4349 pub(crate) fn new(
4350 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4351 ) -> Self {
4352 Self(RequestBuilder::new(stub))
4353 }
4354
4355 pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
4357 mut self,
4358 v: V,
4359 ) -> Self {
4360 self.0.request = v.into();
4361 self
4362 }
4363
4364 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4366 self.0.options = v.into();
4367 self
4368 }
4369
4370 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4377 (*self.0.stub)
4378 .create_environment(self.0.request, self.0.options)
4379 .await
4380 .map(crate::Response::into_body)
4381 }
4382
4383 pub fn poller(
4385 self,
4386 ) -> impl google_cloud_lro::Poller<crate::model::Environment, wkt::Struct> {
4387 type Operation =
4388 google_cloud_lro::internal::Operation<crate::model::Environment, wkt::Struct>;
4389 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4390 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4391
4392 let stub = self.0.stub.clone();
4393 let mut options = self.0.options.clone();
4394 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4395 let query = move |name| {
4396 let stub = stub.clone();
4397 let options = options.clone();
4398 async {
4399 let op = GetOperation::new(stub)
4400 .set_name(name)
4401 .with_options(options)
4402 .send()
4403 .await?;
4404 Ok(Operation::new(op))
4405 }
4406 };
4407
4408 let start = move || async {
4409 let op = self.send().await?;
4410 Ok(Operation::new(op))
4411 };
4412
4413 google_cloud_lro::internal::new_poller(
4414 polling_error_policy,
4415 polling_backoff_policy,
4416 start,
4417 query,
4418 )
4419 }
4420
4421 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4425 self.0.request.parent = v.into();
4426 self
4427 }
4428
4429 pub fn set_environment<T>(mut self, v: T) -> Self
4433 where
4434 T: std::convert::Into<crate::model::Environment>,
4435 {
4436 self.0.request.environment = std::option::Option::Some(v.into());
4437 self
4438 }
4439
4440 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
4444 where
4445 T: std::convert::Into<crate::model::Environment>,
4446 {
4447 self.0.request.environment = v.map(|x| x.into());
4448 self
4449 }
4450 }
4451
4452 #[doc(hidden)]
4453 impl crate::RequestBuilder for CreateEnvironment {
4454 fn request_options(&mut self) -> &mut crate::RequestOptions {
4455 &mut self.0.options
4456 }
4457 }
4458
4459 #[derive(Clone, Debug)]
4477 pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
4478
4479 impl UpdateEnvironment {
4480 pub(crate) fn new(
4481 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4482 ) -> Self {
4483 Self(RequestBuilder::new(stub))
4484 }
4485
4486 pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
4488 mut self,
4489 v: V,
4490 ) -> Self {
4491 self.0.request = v.into();
4492 self
4493 }
4494
4495 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4497 self.0.options = v.into();
4498 self
4499 }
4500
4501 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4508 (*self.0.stub)
4509 .update_environment(self.0.request, self.0.options)
4510 .await
4511 .map(crate::Response::into_body)
4512 }
4513
4514 pub fn poller(
4516 self,
4517 ) -> impl google_cloud_lro::Poller<crate::model::Environment, wkt::Struct> {
4518 type Operation =
4519 google_cloud_lro::internal::Operation<crate::model::Environment, wkt::Struct>;
4520 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4521 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4522
4523 let stub = self.0.stub.clone();
4524 let mut options = self.0.options.clone();
4525 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4526 let query = move |name| {
4527 let stub = stub.clone();
4528 let options = options.clone();
4529 async {
4530 let op = GetOperation::new(stub)
4531 .set_name(name)
4532 .with_options(options)
4533 .send()
4534 .await?;
4535 Ok(Operation::new(op))
4536 }
4537 };
4538
4539 let start = move || async {
4540 let op = self.send().await?;
4541 Ok(Operation::new(op))
4542 };
4543
4544 google_cloud_lro::internal::new_poller(
4545 polling_error_policy,
4546 polling_backoff_policy,
4547 start,
4548 query,
4549 )
4550 }
4551
4552 pub fn set_environment<T>(mut self, v: T) -> Self
4556 where
4557 T: std::convert::Into<crate::model::Environment>,
4558 {
4559 self.0.request.environment = std::option::Option::Some(v.into());
4560 self
4561 }
4562
4563 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
4567 where
4568 T: std::convert::Into<crate::model::Environment>,
4569 {
4570 self.0.request.environment = v.map(|x| x.into());
4571 self
4572 }
4573
4574 pub fn set_update_mask<T>(mut self, v: T) -> Self
4578 where
4579 T: std::convert::Into<wkt::FieldMask>,
4580 {
4581 self.0.request.update_mask = std::option::Option::Some(v.into());
4582 self
4583 }
4584
4585 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
4589 where
4590 T: std::convert::Into<wkt::FieldMask>,
4591 {
4592 self.0.request.update_mask = v.map(|x| x.into());
4593 self
4594 }
4595 }
4596
4597 #[doc(hidden)]
4598 impl crate::RequestBuilder for UpdateEnvironment {
4599 fn request_options(&mut self) -> &mut crate::RequestOptions {
4600 &mut self.0.options
4601 }
4602 }
4603
4604 #[derive(Clone, Debug)]
4621 pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
4622
4623 impl DeleteEnvironment {
4624 pub(crate) fn new(
4625 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4626 ) -> Self {
4627 Self(RequestBuilder::new(stub))
4628 }
4629
4630 pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
4632 mut self,
4633 v: V,
4634 ) -> Self {
4635 self.0.request = v.into();
4636 self
4637 }
4638
4639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4641 self.0.options = v.into();
4642 self
4643 }
4644
4645 pub async fn send(self) -> Result<()> {
4647 (*self.0.stub)
4648 .delete_environment(self.0.request, self.0.options)
4649 .await
4650 .map(crate::Response::into_body)
4651 }
4652
4653 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4657 self.0.request.name = v.into();
4658 self
4659 }
4660 }
4661
4662 #[doc(hidden)]
4663 impl crate::RequestBuilder for DeleteEnvironment {
4664 fn request_options(&mut self) -> &mut crate::RequestOptions {
4665 &mut self.0.options
4666 }
4667 }
4668
4669 #[derive(Clone, Debug)]
4690 pub struct LookupEnvironmentHistory(
4691 RequestBuilder<crate::model::LookupEnvironmentHistoryRequest>,
4692 );
4693
4694 impl LookupEnvironmentHistory {
4695 pub(crate) fn new(
4696 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4697 ) -> Self {
4698 Self(RequestBuilder::new(stub))
4699 }
4700
4701 pub fn with_request<V: Into<crate::model::LookupEnvironmentHistoryRequest>>(
4703 mut self,
4704 v: V,
4705 ) -> Self {
4706 self.0.request = v.into();
4707 self
4708 }
4709
4710 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4712 self.0.options = v.into();
4713 self
4714 }
4715
4716 pub async fn send(self) -> Result<crate::model::LookupEnvironmentHistoryResponse> {
4718 (*self.0.stub)
4719 .lookup_environment_history(self.0.request, self.0.options)
4720 .await
4721 .map(crate::Response::into_body)
4722 }
4723
4724 pub fn by_page(
4726 self,
4727 ) -> impl google_cloud_gax::paginator::Paginator<
4728 crate::model::LookupEnvironmentHistoryResponse,
4729 crate::Error,
4730 > {
4731 use std::clone::Clone;
4732 let token = self.0.request.page_token.clone();
4733 let execute = move |token: String| {
4734 let mut builder = self.clone();
4735 builder.0.request = builder.0.request.set_page_token(token);
4736 builder.send()
4737 };
4738 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4739 }
4740
4741 pub fn by_item(
4743 self,
4744 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4745 crate::model::LookupEnvironmentHistoryResponse,
4746 crate::Error,
4747 > {
4748 use google_cloud_gax::paginator::Paginator;
4749 self.by_page().items()
4750 }
4751
4752 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4756 self.0.request.name = v.into();
4757 self
4758 }
4759
4760 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4762 self.0.request.page_size = v.into();
4763 self
4764 }
4765
4766 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4768 self.0.request.page_token = v.into();
4769 self
4770 }
4771 }
4772
4773 #[doc(hidden)]
4774 impl crate::RequestBuilder for LookupEnvironmentHistory {
4775 fn request_options(&mut self) -> &mut crate::RequestOptions {
4776 &mut self.0.options
4777 }
4778 }
4779
4780 #[derive(Clone, Debug)]
4798 pub struct RunContinuousTest(RequestBuilder<crate::model::RunContinuousTestRequest>);
4799
4800 impl RunContinuousTest {
4801 pub(crate) fn new(
4802 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4803 ) -> Self {
4804 Self(RequestBuilder::new(stub))
4805 }
4806
4807 pub fn with_request<V: Into<crate::model::RunContinuousTestRequest>>(
4809 mut self,
4810 v: V,
4811 ) -> Self {
4812 self.0.request = v.into();
4813 self
4814 }
4815
4816 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4818 self.0.options = v.into();
4819 self
4820 }
4821
4822 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4829 (*self.0.stub)
4830 .run_continuous_test(self.0.request, self.0.options)
4831 .await
4832 .map(crate::Response::into_body)
4833 }
4834
4835 pub fn poller(
4837 self,
4838 ) -> impl google_cloud_lro::Poller<
4839 crate::model::RunContinuousTestResponse,
4840 crate::model::RunContinuousTestMetadata,
4841 > {
4842 type Operation = google_cloud_lro::internal::Operation<
4843 crate::model::RunContinuousTestResponse,
4844 crate::model::RunContinuousTestMetadata,
4845 >;
4846 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4847 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4848
4849 let stub = self.0.stub.clone();
4850 let mut options = self.0.options.clone();
4851 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4852 let query = move |name| {
4853 let stub = stub.clone();
4854 let options = options.clone();
4855 async {
4856 let op = GetOperation::new(stub)
4857 .set_name(name)
4858 .with_options(options)
4859 .send()
4860 .await?;
4861 Ok(Operation::new(op))
4862 }
4863 };
4864
4865 let start = move || async {
4866 let op = self.send().await?;
4867 Ok(Operation::new(op))
4868 };
4869
4870 google_cloud_lro::internal::new_poller(
4871 polling_error_policy,
4872 polling_backoff_policy,
4873 start,
4874 query,
4875 )
4876 }
4877
4878 pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
4882 self.0.request.environment = v.into();
4883 self
4884 }
4885 }
4886
4887 #[doc(hidden)]
4888 impl crate::RequestBuilder for RunContinuousTest {
4889 fn request_options(&mut self) -> &mut crate::RequestOptions {
4890 &mut self.0.options
4891 }
4892 }
4893
4894 #[derive(Clone, Debug)]
4915 pub struct ListContinuousTestResults(
4916 RequestBuilder<crate::model::ListContinuousTestResultsRequest>,
4917 );
4918
4919 impl ListContinuousTestResults {
4920 pub(crate) fn new(
4921 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
4922 ) -> Self {
4923 Self(RequestBuilder::new(stub))
4924 }
4925
4926 pub fn with_request<V: Into<crate::model::ListContinuousTestResultsRequest>>(
4928 mut self,
4929 v: V,
4930 ) -> Self {
4931 self.0.request = v.into();
4932 self
4933 }
4934
4935 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4937 self.0.options = v.into();
4938 self
4939 }
4940
4941 pub async fn send(self) -> Result<crate::model::ListContinuousTestResultsResponse> {
4943 (*self.0.stub)
4944 .list_continuous_test_results(self.0.request, self.0.options)
4945 .await
4946 .map(crate::Response::into_body)
4947 }
4948
4949 pub fn by_page(
4951 self,
4952 ) -> impl google_cloud_gax::paginator::Paginator<
4953 crate::model::ListContinuousTestResultsResponse,
4954 crate::Error,
4955 > {
4956 use std::clone::Clone;
4957 let token = self.0.request.page_token.clone();
4958 let execute = move |token: String| {
4959 let mut builder = self.clone();
4960 builder.0.request = builder.0.request.set_page_token(token);
4961 builder.send()
4962 };
4963 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4964 }
4965
4966 pub fn by_item(
4968 self,
4969 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4970 crate::model::ListContinuousTestResultsResponse,
4971 crate::Error,
4972 > {
4973 use google_cloud_gax::paginator::Paginator;
4974 self.by_page().items()
4975 }
4976
4977 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4981 self.0.request.parent = v.into();
4982 self
4983 }
4984
4985 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4987 self.0.request.page_size = v.into();
4988 self
4989 }
4990
4991 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4993 self.0.request.page_token = v.into();
4994 self
4995 }
4996 }
4997
4998 #[doc(hidden)]
4999 impl crate::RequestBuilder for ListContinuousTestResults {
5000 fn request_options(&mut self) -> &mut crate::RequestOptions {
5001 &mut self.0.options
5002 }
5003 }
5004
5005 #[derive(Clone, Debug)]
5023 pub struct DeployFlow(RequestBuilder<crate::model::DeployFlowRequest>);
5024
5025 impl DeployFlow {
5026 pub(crate) fn new(
5027 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5028 ) -> Self {
5029 Self(RequestBuilder::new(stub))
5030 }
5031
5032 pub fn with_request<V: Into<crate::model::DeployFlowRequest>>(mut self, v: V) -> Self {
5034 self.0.request = v.into();
5035 self
5036 }
5037
5038 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5040 self.0.options = v.into();
5041 self
5042 }
5043
5044 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5051 (*self.0.stub)
5052 .deploy_flow(self.0.request, self.0.options)
5053 .await
5054 .map(crate::Response::into_body)
5055 }
5056
5057 pub fn poller(
5059 self,
5060 ) -> impl google_cloud_lro::Poller<
5061 crate::model::DeployFlowResponse,
5062 crate::model::DeployFlowMetadata,
5063 > {
5064 type Operation = google_cloud_lro::internal::Operation<
5065 crate::model::DeployFlowResponse,
5066 crate::model::DeployFlowMetadata,
5067 >;
5068 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5069 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5070
5071 let stub = self.0.stub.clone();
5072 let mut options = self.0.options.clone();
5073 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5074 let query = move |name| {
5075 let stub = stub.clone();
5076 let options = options.clone();
5077 async {
5078 let op = GetOperation::new(stub)
5079 .set_name(name)
5080 .with_options(options)
5081 .send()
5082 .await?;
5083 Ok(Operation::new(op))
5084 }
5085 };
5086
5087 let start = move || async {
5088 let op = self.send().await?;
5089 Ok(Operation::new(op))
5090 };
5091
5092 google_cloud_lro::internal::new_poller(
5093 polling_error_policy,
5094 polling_backoff_policy,
5095 start,
5096 query,
5097 )
5098 }
5099
5100 pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
5104 self.0.request.environment = v.into();
5105 self
5106 }
5107
5108 pub fn set_flow_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
5112 self.0.request.flow_version = v.into();
5113 self
5114 }
5115 }
5116
5117 #[doc(hidden)]
5118 impl crate::RequestBuilder for DeployFlow {
5119 fn request_options(&mut self) -> &mut crate::RequestOptions {
5120 &mut self.0.options
5121 }
5122 }
5123
5124 #[derive(Clone, Debug)]
5145 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5146
5147 impl ListLocations {
5148 pub(crate) fn new(
5149 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5150 ) -> Self {
5151 Self(RequestBuilder::new(stub))
5152 }
5153
5154 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5156 mut self,
5157 v: V,
5158 ) -> Self {
5159 self.0.request = v.into();
5160 self
5161 }
5162
5163 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5165 self.0.options = v.into();
5166 self
5167 }
5168
5169 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5171 (*self.0.stub)
5172 .list_locations(self.0.request, self.0.options)
5173 .await
5174 .map(crate::Response::into_body)
5175 }
5176
5177 pub fn by_page(
5179 self,
5180 ) -> impl google_cloud_gax::paginator::Paginator<
5181 google_cloud_location::model::ListLocationsResponse,
5182 crate::Error,
5183 > {
5184 use std::clone::Clone;
5185 let token = self.0.request.page_token.clone();
5186 let execute = move |token: String| {
5187 let mut builder = self.clone();
5188 builder.0.request = builder.0.request.set_page_token(token);
5189 builder.send()
5190 };
5191 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5192 }
5193
5194 pub fn by_item(
5196 self,
5197 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5198 google_cloud_location::model::ListLocationsResponse,
5199 crate::Error,
5200 > {
5201 use google_cloud_gax::paginator::Paginator;
5202 self.by_page().items()
5203 }
5204
5205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5207 self.0.request.name = v.into();
5208 self
5209 }
5210
5211 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5213 self.0.request.filter = v.into();
5214 self
5215 }
5216
5217 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5219 self.0.request.page_size = v.into();
5220 self
5221 }
5222
5223 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5225 self.0.request.page_token = v.into();
5226 self
5227 }
5228 }
5229
5230 #[doc(hidden)]
5231 impl crate::RequestBuilder for ListLocations {
5232 fn request_options(&mut self) -> &mut crate::RequestOptions {
5233 &mut self.0.options
5234 }
5235 }
5236
5237 #[derive(Clone, Debug)]
5254 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5255
5256 impl GetLocation {
5257 pub(crate) fn new(
5258 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5259 ) -> Self {
5260 Self(RequestBuilder::new(stub))
5261 }
5262
5263 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5265 mut self,
5266 v: V,
5267 ) -> Self {
5268 self.0.request = v.into();
5269 self
5270 }
5271
5272 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5274 self.0.options = v.into();
5275 self
5276 }
5277
5278 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5280 (*self.0.stub)
5281 .get_location(self.0.request, self.0.options)
5282 .await
5283 .map(crate::Response::into_body)
5284 }
5285
5286 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5288 self.0.request.name = v.into();
5289 self
5290 }
5291 }
5292
5293 #[doc(hidden)]
5294 impl crate::RequestBuilder for GetLocation {
5295 fn request_options(&mut self) -> &mut crate::RequestOptions {
5296 &mut self.0.options
5297 }
5298 }
5299
5300 #[derive(Clone, Debug)]
5321 pub struct ListOperations(
5322 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5323 );
5324
5325 impl ListOperations {
5326 pub(crate) fn new(
5327 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5328 ) -> Self {
5329 Self(RequestBuilder::new(stub))
5330 }
5331
5332 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5334 mut self,
5335 v: V,
5336 ) -> Self {
5337 self.0.request = v.into();
5338 self
5339 }
5340
5341 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5343 self.0.options = v.into();
5344 self
5345 }
5346
5347 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5349 (*self.0.stub)
5350 .list_operations(self.0.request, self.0.options)
5351 .await
5352 .map(crate::Response::into_body)
5353 }
5354
5355 pub fn by_page(
5357 self,
5358 ) -> impl google_cloud_gax::paginator::Paginator<
5359 google_cloud_longrunning::model::ListOperationsResponse,
5360 crate::Error,
5361 > {
5362 use std::clone::Clone;
5363 let token = self.0.request.page_token.clone();
5364 let execute = move |token: String| {
5365 let mut builder = self.clone();
5366 builder.0.request = builder.0.request.set_page_token(token);
5367 builder.send()
5368 };
5369 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5370 }
5371
5372 pub fn by_item(
5374 self,
5375 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5376 google_cloud_longrunning::model::ListOperationsResponse,
5377 crate::Error,
5378 > {
5379 use google_cloud_gax::paginator::Paginator;
5380 self.by_page().items()
5381 }
5382
5383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5385 self.0.request.name = v.into();
5386 self
5387 }
5388
5389 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5391 self.0.request.filter = v.into();
5392 self
5393 }
5394
5395 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5397 self.0.request.page_size = v.into();
5398 self
5399 }
5400
5401 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5403 self.0.request.page_token = v.into();
5404 self
5405 }
5406
5407 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5409 self.0.request.return_partial_success = v.into();
5410 self
5411 }
5412 }
5413
5414 #[doc(hidden)]
5415 impl crate::RequestBuilder for ListOperations {
5416 fn request_options(&mut self) -> &mut crate::RequestOptions {
5417 &mut self.0.options
5418 }
5419 }
5420
5421 #[derive(Clone, Debug)]
5438 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5439
5440 impl GetOperation {
5441 pub(crate) fn new(
5442 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5443 ) -> Self {
5444 Self(RequestBuilder::new(stub))
5445 }
5446
5447 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5449 mut self,
5450 v: V,
5451 ) -> Self {
5452 self.0.request = v.into();
5453 self
5454 }
5455
5456 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5458 self.0.options = v.into();
5459 self
5460 }
5461
5462 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5464 (*self.0.stub)
5465 .get_operation(self.0.request, self.0.options)
5466 .await
5467 .map(crate::Response::into_body)
5468 }
5469
5470 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5472 self.0.request.name = v.into();
5473 self
5474 }
5475 }
5476
5477 #[doc(hidden)]
5478 impl crate::RequestBuilder for GetOperation {
5479 fn request_options(&mut self) -> &mut crate::RequestOptions {
5480 &mut self.0.options
5481 }
5482 }
5483
5484 #[derive(Clone, Debug)]
5501 pub struct CancelOperation(
5502 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5503 );
5504
5505 impl CancelOperation {
5506 pub(crate) fn new(
5507 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
5508 ) -> Self {
5509 Self(RequestBuilder::new(stub))
5510 }
5511
5512 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5514 mut self,
5515 v: V,
5516 ) -> Self {
5517 self.0.request = v.into();
5518 self
5519 }
5520
5521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5523 self.0.options = v.into();
5524 self
5525 }
5526
5527 pub async fn send(self) -> Result<()> {
5529 (*self.0.stub)
5530 .cancel_operation(self.0.request, self.0.options)
5531 .await
5532 .map(crate::Response::into_body)
5533 }
5534
5535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5537 self.0.request.name = v.into();
5538 self
5539 }
5540 }
5541
5542 #[doc(hidden)]
5543 impl crate::RequestBuilder for CancelOperation {
5544 fn request_options(&mut self) -> &mut crate::RequestOptions {
5545 &mut self.0.options
5546 }
5547 }
5548}
5549
5550#[cfg(feature = "examples")]
5552#[cfg_attr(docsrs, doc(cfg(feature = "examples")))]
5553pub mod examples {
5554 use crate::Result;
5555
5556 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5570
5571 pub(crate) mod client {
5572 use super::super::super::client::Examples;
5573 pub struct Factory;
5574 impl crate::ClientFactory for Factory {
5575 type Client = Examples;
5576 type Credentials = gaxi::options::Credentials;
5577 async fn build(
5578 self,
5579 config: gaxi::options::ClientConfig,
5580 ) -> crate::ClientBuilderResult<Self::Client> {
5581 Self::Client::new(config).await
5582 }
5583 }
5584 }
5585
5586 #[derive(Clone, Debug)]
5588 pub(crate) struct RequestBuilder<R: std::default::Default> {
5589 stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>,
5590 request: R,
5591 options: crate::RequestOptions,
5592 }
5593
5594 impl<R> RequestBuilder<R>
5595 where
5596 R: std::default::Default,
5597 {
5598 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5599 Self {
5600 stub,
5601 request: R::default(),
5602 options: crate::RequestOptions::default(),
5603 }
5604 }
5605 }
5606
5607 #[derive(Clone, Debug)]
5624 pub struct CreateExample(RequestBuilder<crate::model::CreateExampleRequest>);
5625
5626 impl CreateExample {
5627 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5628 Self(RequestBuilder::new(stub))
5629 }
5630
5631 pub fn with_request<V: Into<crate::model::CreateExampleRequest>>(mut self, v: V) -> Self {
5633 self.0.request = v.into();
5634 self
5635 }
5636
5637 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5639 self.0.options = v.into();
5640 self
5641 }
5642
5643 pub async fn send(self) -> Result<crate::model::Example> {
5645 (*self.0.stub)
5646 .create_example(self.0.request, self.0.options)
5647 .await
5648 .map(crate::Response::into_body)
5649 }
5650
5651 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5655 self.0.request.parent = v.into();
5656 self
5657 }
5658
5659 pub fn set_example<T>(mut self, v: T) -> Self
5663 where
5664 T: std::convert::Into<crate::model::Example>,
5665 {
5666 self.0.request.example = std::option::Option::Some(v.into());
5667 self
5668 }
5669
5670 pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
5674 where
5675 T: std::convert::Into<crate::model::Example>,
5676 {
5677 self.0.request.example = v.map(|x| x.into());
5678 self
5679 }
5680 }
5681
5682 #[doc(hidden)]
5683 impl crate::RequestBuilder for CreateExample {
5684 fn request_options(&mut self) -> &mut crate::RequestOptions {
5685 &mut self.0.options
5686 }
5687 }
5688
5689 #[derive(Clone, Debug)]
5706 pub struct DeleteExample(RequestBuilder<crate::model::DeleteExampleRequest>);
5707
5708 impl DeleteExample {
5709 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5710 Self(RequestBuilder::new(stub))
5711 }
5712
5713 pub fn with_request<V: Into<crate::model::DeleteExampleRequest>>(mut self, v: V) -> Self {
5715 self.0.request = v.into();
5716 self
5717 }
5718
5719 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5721 self.0.options = v.into();
5722 self
5723 }
5724
5725 pub async fn send(self) -> Result<()> {
5727 (*self.0.stub)
5728 .delete_example(self.0.request, self.0.options)
5729 .await
5730 .map(crate::Response::into_body)
5731 }
5732
5733 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5737 self.0.request.name = v.into();
5738 self
5739 }
5740 }
5741
5742 #[doc(hidden)]
5743 impl crate::RequestBuilder for DeleteExample {
5744 fn request_options(&mut self) -> &mut crate::RequestOptions {
5745 &mut self.0.options
5746 }
5747 }
5748
5749 #[derive(Clone, Debug)]
5770 pub struct ListExamples(RequestBuilder<crate::model::ListExamplesRequest>);
5771
5772 impl ListExamples {
5773 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5774 Self(RequestBuilder::new(stub))
5775 }
5776
5777 pub fn with_request<V: Into<crate::model::ListExamplesRequest>>(mut self, v: V) -> Self {
5779 self.0.request = v.into();
5780 self
5781 }
5782
5783 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5785 self.0.options = v.into();
5786 self
5787 }
5788
5789 pub async fn send(self) -> Result<crate::model::ListExamplesResponse> {
5791 (*self.0.stub)
5792 .list_examples(self.0.request, self.0.options)
5793 .await
5794 .map(crate::Response::into_body)
5795 }
5796
5797 pub fn by_page(
5799 self,
5800 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListExamplesResponse, crate::Error>
5801 {
5802 use std::clone::Clone;
5803 let token = self.0.request.page_token.clone();
5804 let execute = move |token: String| {
5805 let mut builder = self.clone();
5806 builder.0.request = builder.0.request.set_page_token(token);
5807 builder.send()
5808 };
5809 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5810 }
5811
5812 pub fn by_item(
5814 self,
5815 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5816 crate::model::ListExamplesResponse,
5817 crate::Error,
5818 > {
5819 use google_cloud_gax::paginator::Paginator;
5820 self.by_page().items()
5821 }
5822
5823 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5827 self.0.request.parent = v.into();
5828 self
5829 }
5830
5831 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5833 self.0.request.page_size = v.into();
5834 self
5835 }
5836
5837 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5839 self.0.request.page_token = v.into();
5840 self
5841 }
5842
5843 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
5845 self.0.request.language_code = v.into();
5846 self
5847 }
5848 }
5849
5850 #[doc(hidden)]
5851 impl crate::RequestBuilder for ListExamples {
5852 fn request_options(&mut self) -> &mut crate::RequestOptions {
5853 &mut self.0.options
5854 }
5855 }
5856
5857 #[derive(Clone, Debug)]
5874 pub struct GetExample(RequestBuilder<crate::model::GetExampleRequest>);
5875
5876 impl GetExample {
5877 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5878 Self(RequestBuilder::new(stub))
5879 }
5880
5881 pub fn with_request<V: Into<crate::model::GetExampleRequest>>(mut self, v: V) -> Self {
5883 self.0.request = v.into();
5884 self
5885 }
5886
5887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5889 self.0.options = v.into();
5890 self
5891 }
5892
5893 pub async fn send(self) -> Result<crate::model::Example> {
5895 (*self.0.stub)
5896 .get_example(self.0.request, self.0.options)
5897 .await
5898 .map(crate::Response::into_body)
5899 }
5900
5901 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5905 self.0.request.name = v.into();
5906 self
5907 }
5908 }
5909
5910 #[doc(hidden)]
5911 impl crate::RequestBuilder for GetExample {
5912 fn request_options(&mut self) -> &mut crate::RequestOptions {
5913 &mut self.0.options
5914 }
5915 }
5916
5917 #[derive(Clone, Debug)]
5934 pub struct UpdateExample(RequestBuilder<crate::model::UpdateExampleRequest>);
5935
5936 impl UpdateExample {
5937 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
5938 Self(RequestBuilder::new(stub))
5939 }
5940
5941 pub fn with_request<V: Into<crate::model::UpdateExampleRequest>>(mut self, v: V) -> Self {
5943 self.0.request = v.into();
5944 self
5945 }
5946
5947 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5949 self.0.options = v.into();
5950 self
5951 }
5952
5953 pub async fn send(self) -> Result<crate::model::Example> {
5955 (*self.0.stub)
5956 .update_example(self.0.request, self.0.options)
5957 .await
5958 .map(crate::Response::into_body)
5959 }
5960
5961 pub fn set_example<T>(mut self, v: T) -> Self
5965 where
5966 T: std::convert::Into<crate::model::Example>,
5967 {
5968 self.0.request.example = std::option::Option::Some(v.into());
5969 self
5970 }
5971
5972 pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
5976 where
5977 T: std::convert::Into<crate::model::Example>,
5978 {
5979 self.0.request.example = v.map(|x| x.into());
5980 self
5981 }
5982
5983 pub fn set_update_mask<T>(mut self, v: T) -> Self
5985 where
5986 T: std::convert::Into<wkt::FieldMask>,
5987 {
5988 self.0.request.update_mask = std::option::Option::Some(v.into());
5989 self
5990 }
5991
5992 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
5994 where
5995 T: std::convert::Into<wkt::FieldMask>,
5996 {
5997 self.0.request.update_mask = v.map(|x| x.into());
5998 self
5999 }
6000 }
6001
6002 #[doc(hidden)]
6003 impl crate::RequestBuilder for UpdateExample {
6004 fn request_options(&mut self) -> &mut crate::RequestOptions {
6005 &mut self.0.options
6006 }
6007 }
6008
6009 #[derive(Clone, Debug)]
6030 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6031
6032 impl ListLocations {
6033 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6034 Self(RequestBuilder::new(stub))
6035 }
6036
6037 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6039 mut self,
6040 v: V,
6041 ) -> Self {
6042 self.0.request = v.into();
6043 self
6044 }
6045
6046 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6048 self.0.options = v.into();
6049 self
6050 }
6051
6052 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6054 (*self.0.stub)
6055 .list_locations(self.0.request, self.0.options)
6056 .await
6057 .map(crate::Response::into_body)
6058 }
6059
6060 pub fn by_page(
6062 self,
6063 ) -> impl google_cloud_gax::paginator::Paginator<
6064 google_cloud_location::model::ListLocationsResponse,
6065 crate::Error,
6066 > {
6067 use std::clone::Clone;
6068 let token = self.0.request.page_token.clone();
6069 let execute = move |token: String| {
6070 let mut builder = self.clone();
6071 builder.0.request = builder.0.request.set_page_token(token);
6072 builder.send()
6073 };
6074 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6075 }
6076
6077 pub fn by_item(
6079 self,
6080 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6081 google_cloud_location::model::ListLocationsResponse,
6082 crate::Error,
6083 > {
6084 use google_cloud_gax::paginator::Paginator;
6085 self.by_page().items()
6086 }
6087
6088 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6090 self.0.request.name = v.into();
6091 self
6092 }
6093
6094 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6096 self.0.request.filter = v.into();
6097 self
6098 }
6099
6100 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6102 self.0.request.page_size = v.into();
6103 self
6104 }
6105
6106 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6108 self.0.request.page_token = v.into();
6109 self
6110 }
6111 }
6112
6113 #[doc(hidden)]
6114 impl crate::RequestBuilder for ListLocations {
6115 fn request_options(&mut self) -> &mut crate::RequestOptions {
6116 &mut self.0.options
6117 }
6118 }
6119
6120 #[derive(Clone, Debug)]
6137 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6138
6139 impl GetLocation {
6140 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6141 Self(RequestBuilder::new(stub))
6142 }
6143
6144 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6146 mut self,
6147 v: V,
6148 ) -> Self {
6149 self.0.request = v.into();
6150 self
6151 }
6152
6153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6155 self.0.options = v.into();
6156 self
6157 }
6158
6159 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6161 (*self.0.stub)
6162 .get_location(self.0.request, self.0.options)
6163 .await
6164 .map(crate::Response::into_body)
6165 }
6166
6167 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6169 self.0.request.name = v.into();
6170 self
6171 }
6172 }
6173
6174 #[doc(hidden)]
6175 impl crate::RequestBuilder for GetLocation {
6176 fn request_options(&mut self) -> &mut crate::RequestOptions {
6177 &mut self.0.options
6178 }
6179 }
6180
6181 #[derive(Clone, Debug)]
6202 pub struct ListOperations(
6203 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6204 );
6205
6206 impl ListOperations {
6207 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6208 Self(RequestBuilder::new(stub))
6209 }
6210
6211 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6213 mut self,
6214 v: V,
6215 ) -> Self {
6216 self.0.request = v.into();
6217 self
6218 }
6219
6220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6222 self.0.options = v.into();
6223 self
6224 }
6225
6226 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6228 (*self.0.stub)
6229 .list_operations(self.0.request, self.0.options)
6230 .await
6231 .map(crate::Response::into_body)
6232 }
6233
6234 pub fn by_page(
6236 self,
6237 ) -> impl google_cloud_gax::paginator::Paginator<
6238 google_cloud_longrunning::model::ListOperationsResponse,
6239 crate::Error,
6240 > {
6241 use std::clone::Clone;
6242 let token = self.0.request.page_token.clone();
6243 let execute = move |token: String| {
6244 let mut builder = self.clone();
6245 builder.0.request = builder.0.request.set_page_token(token);
6246 builder.send()
6247 };
6248 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6249 }
6250
6251 pub fn by_item(
6253 self,
6254 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6255 google_cloud_longrunning::model::ListOperationsResponse,
6256 crate::Error,
6257 > {
6258 use google_cloud_gax::paginator::Paginator;
6259 self.by_page().items()
6260 }
6261
6262 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6264 self.0.request.name = v.into();
6265 self
6266 }
6267
6268 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6270 self.0.request.filter = v.into();
6271 self
6272 }
6273
6274 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6276 self.0.request.page_size = v.into();
6277 self
6278 }
6279
6280 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6282 self.0.request.page_token = v.into();
6283 self
6284 }
6285
6286 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6288 self.0.request.return_partial_success = v.into();
6289 self
6290 }
6291 }
6292
6293 #[doc(hidden)]
6294 impl crate::RequestBuilder for ListOperations {
6295 fn request_options(&mut self) -> &mut crate::RequestOptions {
6296 &mut self.0.options
6297 }
6298 }
6299
6300 #[derive(Clone, Debug)]
6317 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6318
6319 impl GetOperation {
6320 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6321 Self(RequestBuilder::new(stub))
6322 }
6323
6324 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6326 mut self,
6327 v: V,
6328 ) -> Self {
6329 self.0.request = v.into();
6330 self
6331 }
6332
6333 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6335 self.0.options = v.into();
6336 self
6337 }
6338
6339 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6341 (*self.0.stub)
6342 .get_operation(self.0.request, self.0.options)
6343 .await
6344 .map(crate::Response::into_body)
6345 }
6346
6347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6349 self.0.request.name = v.into();
6350 self
6351 }
6352 }
6353
6354 #[doc(hidden)]
6355 impl crate::RequestBuilder for GetOperation {
6356 fn request_options(&mut self) -> &mut crate::RequestOptions {
6357 &mut self.0.options
6358 }
6359 }
6360
6361 #[derive(Clone, Debug)]
6378 pub struct CancelOperation(
6379 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6380 );
6381
6382 impl CancelOperation {
6383 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Examples>) -> Self {
6384 Self(RequestBuilder::new(stub))
6385 }
6386
6387 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6389 mut self,
6390 v: V,
6391 ) -> Self {
6392 self.0.request = v.into();
6393 self
6394 }
6395
6396 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6398 self.0.options = v.into();
6399 self
6400 }
6401
6402 pub async fn send(self) -> Result<()> {
6404 (*self.0.stub)
6405 .cancel_operation(self.0.request, self.0.options)
6406 .await
6407 .map(crate::Response::into_body)
6408 }
6409
6410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6412 self.0.request.name = v.into();
6413 self
6414 }
6415 }
6416
6417 #[doc(hidden)]
6418 impl crate::RequestBuilder for CancelOperation {
6419 fn request_options(&mut self) -> &mut crate::RequestOptions {
6420 &mut self.0.options
6421 }
6422 }
6423}
6424
6425#[cfg(feature = "experiments")]
6427#[cfg_attr(docsrs, doc(cfg(feature = "experiments")))]
6428pub mod experiments {
6429 use crate::Result;
6430
6431 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6445
6446 pub(crate) mod client {
6447 use super::super::super::client::Experiments;
6448 pub struct Factory;
6449 impl crate::ClientFactory for Factory {
6450 type Client = Experiments;
6451 type Credentials = gaxi::options::Credentials;
6452 async fn build(
6453 self,
6454 config: gaxi::options::ClientConfig,
6455 ) -> crate::ClientBuilderResult<Self::Client> {
6456 Self::Client::new(config).await
6457 }
6458 }
6459 }
6460
6461 #[derive(Clone, Debug)]
6463 pub(crate) struct RequestBuilder<R: std::default::Default> {
6464 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6465 request: R,
6466 options: crate::RequestOptions,
6467 }
6468
6469 impl<R> RequestBuilder<R>
6470 where
6471 R: std::default::Default,
6472 {
6473 pub(crate) fn new(
6474 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6475 ) -> Self {
6476 Self {
6477 stub,
6478 request: R::default(),
6479 options: crate::RequestOptions::default(),
6480 }
6481 }
6482 }
6483
6484 #[derive(Clone, Debug)]
6505 pub struct ListExperiments(RequestBuilder<crate::model::ListExperimentsRequest>);
6506
6507 impl ListExperiments {
6508 pub(crate) fn new(
6509 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6510 ) -> Self {
6511 Self(RequestBuilder::new(stub))
6512 }
6513
6514 pub fn with_request<V: Into<crate::model::ListExperimentsRequest>>(mut self, v: V) -> Self {
6516 self.0.request = v.into();
6517 self
6518 }
6519
6520 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6522 self.0.options = v.into();
6523 self
6524 }
6525
6526 pub async fn send(self) -> Result<crate::model::ListExperimentsResponse> {
6528 (*self.0.stub)
6529 .list_experiments(self.0.request, self.0.options)
6530 .await
6531 .map(crate::Response::into_body)
6532 }
6533
6534 pub fn by_page(
6536 self,
6537 ) -> impl google_cloud_gax::paginator::Paginator<
6538 crate::model::ListExperimentsResponse,
6539 crate::Error,
6540 > {
6541 use std::clone::Clone;
6542 let token = self.0.request.page_token.clone();
6543 let execute = move |token: String| {
6544 let mut builder = self.clone();
6545 builder.0.request = builder.0.request.set_page_token(token);
6546 builder.send()
6547 };
6548 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6549 }
6550
6551 pub fn by_item(
6553 self,
6554 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6555 crate::model::ListExperimentsResponse,
6556 crate::Error,
6557 > {
6558 use google_cloud_gax::paginator::Paginator;
6559 self.by_page().items()
6560 }
6561
6562 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6566 self.0.request.parent = v.into();
6567 self
6568 }
6569
6570 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6572 self.0.request.page_size = v.into();
6573 self
6574 }
6575
6576 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6578 self.0.request.page_token = v.into();
6579 self
6580 }
6581 }
6582
6583 #[doc(hidden)]
6584 impl crate::RequestBuilder for ListExperiments {
6585 fn request_options(&mut self) -> &mut crate::RequestOptions {
6586 &mut self.0.options
6587 }
6588 }
6589
6590 #[derive(Clone, Debug)]
6607 pub struct GetExperiment(RequestBuilder<crate::model::GetExperimentRequest>);
6608
6609 impl GetExperiment {
6610 pub(crate) fn new(
6611 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6612 ) -> Self {
6613 Self(RequestBuilder::new(stub))
6614 }
6615
6616 pub fn with_request<V: Into<crate::model::GetExperimentRequest>>(mut self, v: V) -> Self {
6618 self.0.request = v.into();
6619 self
6620 }
6621
6622 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6624 self.0.options = v.into();
6625 self
6626 }
6627
6628 pub async fn send(self) -> Result<crate::model::Experiment> {
6630 (*self.0.stub)
6631 .get_experiment(self.0.request, self.0.options)
6632 .await
6633 .map(crate::Response::into_body)
6634 }
6635
6636 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6640 self.0.request.name = v.into();
6641 self
6642 }
6643 }
6644
6645 #[doc(hidden)]
6646 impl crate::RequestBuilder for GetExperiment {
6647 fn request_options(&mut self) -> &mut crate::RequestOptions {
6648 &mut self.0.options
6649 }
6650 }
6651
6652 #[derive(Clone, Debug)]
6669 pub struct CreateExperiment(RequestBuilder<crate::model::CreateExperimentRequest>);
6670
6671 impl CreateExperiment {
6672 pub(crate) fn new(
6673 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6674 ) -> Self {
6675 Self(RequestBuilder::new(stub))
6676 }
6677
6678 pub fn with_request<V: Into<crate::model::CreateExperimentRequest>>(
6680 mut self,
6681 v: V,
6682 ) -> Self {
6683 self.0.request = v.into();
6684 self
6685 }
6686
6687 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6689 self.0.options = v.into();
6690 self
6691 }
6692
6693 pub async fn send(self) -> Result<crate::model::Experiment> {
6695 (*self.0.stub)
6696 .create_experiment(self.0.request, self.0.options)
6697 .await
6698 .map(crate::Response::into_body)
6699 }
6700
6701 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6705 self.0.request.parent = v.into();
6706 self
6707 }
6708
6709 pub fn set_experiment<T>(mut self, v: T) -> Self
6713 where
6714 T: std::convert::Into<crate::model::Experiment>,
6715 {
6716 self.0.request.experiment = std::option::Option::Some(v.into());
6717 self
6718 }
6719
6720 pub fn set_or_clear_experiment<T>(mut self, v: std::option::Option<T>) -> Self
6724 where
6725 T: std::convert::Into<crate::model::Experiment>,
6726 {
6727 self.0.request.experiment = v.map(|x| x.into());
6728 self
6729 }
6730 }
6731
6732 #[doc(hidden)]
6733 impl crate::RequestBuilder for CreateExperiment {
6734 fn request_options(&mut self) -> &mut crate::RequestOptions {
6735 &mut self.0.options
6736 }
6737 }
6738
6739 #[derive(Clone, Debug)]
6756 pub struct UpdateExperiment(RequestBuilder<crate::model::UpdateExperimentRequest>);
6757
6758 impl UpdateExperiment {
6759 pub(crate) fn new(
6760 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6761 ) -> Self {
6762 Self(RequestBuilder::new(stub))
6763 }
6764
6765 pub fn with_request<V: Into<crate::model::UpdateExperimentRequest>>(
6767 mut self,
6768 v: V,
6769 ) -> Self {
6770 self.0.request = v.into();
6771 self
6772 }
6773
6774 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6776 self.0.options = v.into();
6777 self
6778 }
6779
6780 pub async fn send(self) -> Result<crate::model::Experiment> {
6782 (*self.0.stub)
6783 .update_experiment(self.0.request, self.0.options)
6784 .await
6785 .map(crate::Response::into_body)
6786 }
6787
6788 pub fn set_experiment<T>(mut self, v: T) -> Self
6792 where
6793 T: std::convert::Into<crate::model::Experiment>,
6794 {
6795 self.0.request.experiment = std::option::Option::Some(v.into());
6796 self
6797 }
6798
6799 pub fn set_or_clear_experiment<T>(mut self, v: std::option::Option<T>) -> Self
6803 where
6804 T: std::convert::Into<crate::model::Experiment>,
6805 {
6806 self.0.request.experiment = v.map(|x| x.into());
6807 self
6808 }
6809
6810 pub fn set_update_mask<T>(mut self, v: T) -> Self
6814 where
6815 T: std::convert::Into<wkt::FieldMask>,
6816 {
6817 self.0.request.update_mask = std::option::Option::Some(v.into());
6818 self
6819 }
6820
6821 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
6825 where
6826 T: std::convert::Into<wkt::FieldMask>,
6827 {
6828 self.0.request.update_mask = v.map(|x| x.into());
6829 self
6830 }
6831 }
6832
6833 #[doc(hidden)]
6834 impl crate::RequestBuilder for UpdateExperiment {
6835 fn request_options(&mut self) -> &mut crate::RequestOptions {
6836 &mut self.0.options
6837 }
6838 }
6839
6840 #[derive(Clone, Debug)]
6857 pub struct DeleteExperiment(RequestBuilder<crate::model::DeleteExperimentRequest>);
6858
6859 impl DeleteExperiment {
6860 pub(crate) fn new(
6861 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6862 ) -> Self {
6863 Self(RequestBuilder::new(stub))
6864 }
6865
6866 pub fn with_request<V: Into<crate::model::DeleteExperimentRequest>>(
6868 mut self,
6869 v: V,
6870 ) -> Self {
6871 self.0.request = v.into();
6872 self
6873 }
6874
6875 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6877 self.0.options = v.into();
6878 self
6879 }
6880
6881 pub async fn send(self) -> Result<()> {
6883 (*self.0.stub)
6884 .delete_experiment(self.0.request, self.0.options)
6885 .await
6886 .map(crate::Response::into_body)
6887 }
6888
6889 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6893 self.0.request.name = v.into();
6894 self
6895 }
6896 }
6897
6898 #[doc(hidden)]
6899 impl crate::RequestBuilder for DeleteExperiment {
6900 fn request_options(&mut self) -> &mut crate::RequestOptions {
6901 &mut self.0.options
6902 }
6903 }
6904
6905 #[derive(Clone, Debug)]
6922 pub struct StartExperiment(RequestBuilder<crate::model::StartExperimentRequest>);
6923
6924 impl StartExperiment {
6925 pub(crate) fn new(
6926 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6927 ) -> Self {
6928 Self(RequestBuilder::new(stub))
6929 }
6930
6931 pub fn with_request<V: Into<crate::model::StartExperimentRequest>>(mut self, v: V) -> Self {
6933 self.0.request = v.into();
6934 self
6935 }
6936
6937 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6939 self.0.options = v.into();
6940 self
6941 }
6942
6943 pub async fn send(self) -> Result<crate::model::Experiment> {
6945 (*self.0.stub)
6946 .start_experiment(self.0.request, self.0.options)
6947 .await
6948 .map(crate::Response::into_body)
6949 }
6950
6951 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6955 self.0.request.name = v.into();
6956 self
6957 }
6958 }
6959
6960 #[doc(hidden)]
6961 impl crate::RequestBuilder for StartExperiment {
6962 fn request_options(&mut self) -> &mut crate::RequestOptions {
6963 &mut self.0.options
6964 }
6965 }
6966
6967 #[derive(Clone, Debug)]
6984 pub struct StopExperiment(RequestBuilder<crate::model::StopExperimentRequest>);
6985
6986 impl StopExperiment {
6987 pub(crate) fn new(
6988 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
6989 ) -> Self {
6990 Self(RequestBuilder::new(stub))
6991 }
6992
6993 pub fn with_request<V: Into<crate::model::StopExperimentRequest>>(mut self, v: V) -> Self {
6995 self.0.request = v.into();
6996 self
6997 }
6998
6999 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7001 self.0.options = v.into();
7002 self
7003 }
7004
7005 pub async fn send(self) -> Result<crate::model::Experiment> {
7007 (*self.0.stub)
7008 .stop_experiment(self.0.request, self.0.options)
7009 .await
7010 .map(crate::Response::into_body)
7011 }
7012
7013 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7017 self.0.request.name = v.into();
7018 self
7019 }
7020 }
7021
7022 #[doc(hidden)]
7023 impl crate::RequestBuilder for StopExperiment {
7024 fn request_options(&mut self) -> &mut crate::RequestOptions {
7025 &mut self.0.options
7026 }
7027 }
7028
7029 #[derive(Clone, Debug)]
7050 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
7051
7052 impl ListLocations {
7053 pub(crate) fn new(
7054 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7055 ) -> Self {
7056 Self(RequestBuilder::new(stub))
7057 }
7058
7059 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
7061 mut self,
7062 v: V,
7063 ) -> Self {
7064 self.0.request = v.into();
7065 self
7066 }
7067
7068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7070 self.0.options = v.into();
7071 self
7072 }
7073
7074 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
7076 (*self.0.stub)
7077 .list_locations(self.0.request, self.0.options)
7078 .await
7079 .map(crate::Response::into_body)
7080 }
7081
7082 pub fn by_page(
7084 self,
7085 ) -> impl google_cloud_gax::paginator::Paginator<
7086 google_cloud_location::model::ListLocationsResponse,
7087 crate::Error,
7088 > {
7089 use std::clone::Clone;
7090 let token = self.0.request.page_token.clone();
7091 let execute = move |token: String| {
7092 let mut builder = self.clone();
7093 builder.0.request = builder.0.request.set_page_token(token);
7094 builder.send()
7095 };
7096 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7097 }
7098
7099 pub fn by_item(
7101 self,
7102 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7103 google_cloud_location::model::ListLocationsResponse,
7104 crate::Error,
7105 > {
7106 use google_cloud_gax::paginator::Paginator;
7107 self.by_page().items()
7108 }
7109
7110 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7112 self.0.request.name = v.into();
7113 self
7114 }
7115
7116 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7118 self.0.request.filter = v.into();
7119 self
7120 }
7121
7122 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7124 self.0.request.page_size = v.into();
7125 self
7126 }
7127
7128 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7130 self.0.request.page_token = v.into();
7131 self
7132 }
7133 }
7134
7135 #[doc(hidden)]
7136 impl crate::RequestBuilder for ListLocations {
7137 fn request_options(&mut self) -> &mut crate::RequestOptions {
7138 &mut self.0.options
7139 }
7140 }
7141
7142 #[derive(Clone, Debug)]
7159 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
7160
7161 impl GetLocation {
7162 pub(crate) fn new(
7163 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7164 ) -> Self {
7165 Self(RequestBuilder::new(stub))
7166 }
7167
7168 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
7170 mut self,
7171 v: V,
7172 ) -> Self {
7173 self.0.request = v.into();
7174 self
7175 }
7176
7177 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7179 self.0.options = v.into();
7180 self
7181 }
7182
7183 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
7185 (*self.0.stub)
7186 .get_location(self.0.request, self.0.options)
7187 .await
7188 .map(crate::Response::into_body)
7189 }
7190
7191 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7193 self.0.request.name = v.into();
7194 self
7195 }
7196 }
7197
7198 #[doc(hidden)]
7199 impl crate::RequestBuilder for GetLocation {
7200 fn request_options(&mut self) -> &mut crate::RequestOptions {
7201 &mut self.0.options
7202 }
7203 }
7204
7205 #[derive(Clone, Debug)]
7226 pub struct ListOperations(
7227 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
7228 );
7229
7230 impl ListOperations {
7231 pub(crate) fn new(
7232 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7233 ) -> Self {
7234 Self(RequestBuilder::new(stub))
7235 }
7236
7237 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7239 mut self,
7240 v: V,
7241 ) -> Self {
7242 self.0.request = v.into();
7243 self
7244 }
7245
7246 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7248 self.0.options = v.into();
7249 self
7250 }
7251
7252 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7254 (*self.0.stub)
7255 .list_operations(self.0.request, self.0.options)
7256 .await
7257 .map(crate::Response::into_body)
7258 }
7259
7260 pub fn by_page(
7262 self,
7263 ) -> impl google_cloud_gax::paginator::Paginator<
7264 google_cloud_longrunning::model::ListOperationsResponse,
7265 crate::Error,
7266 > {
7267 use std::clone::Clone;
7268 let token = self.0.request.page_token.clone();
7269 let execute = move |token: String| {
7270 let mut builder = self.clone();
7271 builder.0.request = builder.0.request.set_page_token(token);
7272 builder.send()
7273 };
7274 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7275 }
7276
7277 pub fn by_item(
7279 self,
7280 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7281 google_cloud_longrunning::model::ListOperationsResponse,
7282 crate::Error,
7283 > {
7284 use google_cloud_gax::paginator::Paginator;
7285 self.by_page().items()
7286 }
7287
7288 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7290 self.0.request.name = v.into();
7291 self
7292 }
7293
7294 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7296 self.0.request.filter = v.into();
7297 self
7298 }
7299
7300 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7302 self.0.request.page_size = v.into();
7303 self
7304 }
7305
7306 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7308 self.0.request.page_token = v.into();
7309 self
7310 }
7311
7312 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7314 self.0.request.return_partial_success = v.into();
7315 self
7316 }
7317 }
7318
7319 #[doc(hidden)]
7320 impl crate::RequestBuilder for ListOperations {
7321 fn request_options(&mut self) -> &mut crate::RequestOptions {
7322 &mut self.0.options
7323 }
7324 }
7325
7326 #[derive(Clone, Debug)]
7343 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7344
7345 impl GetOperation {
7346 pub(crate) fn new(
7347 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7348 ) -> Self {
7349 Self(RequestBuilder::new(stub))
7350 }
7351
7352 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7354 mut self,
7355 v: V,
7356 ) -> Self {
7357 self.0.request = v.into();
7358 self
7359 }
7360
7361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7363 self.0.options = v.into();
7364 self
7365 }
7366
7367 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7369 (*self.0.stub)
7370 .get_operation(self.0.request, self.0.options)
7371 .await
7372 .map(crate::Response::into_body)
7373 }
7374
7375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7377 self.0.request.name = v.into();
7378 self
7379 }
7380 }
7381
7382 #[doc(hidden)]
7383 impl crate::RequestBuilder for GetOperation {
7384 fn request_options(&mut self) -> &mut crate::RequestOptions {
7385 &mut self.0.options
7386 }
7387 }
7388
7389 #[derive(Clone, Debug)]
7406 pub struct CancelOperation(
7407 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7408 );
7409
7410 impl CancelOperation {
7411 pub(crate) fn new(
7412 stub: std::sync::Arc<dyn super::super::stub::dynamic::Experiments>,
7413 ) -> Self {
7414 Self(RequestBuilder::new(stub))
7415 }
7416
7417 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7419 mut self,
7420 v: V,
7421 ) -> Self {
7422 self.0.request = v.into();
7423 self
7424 }
7425
7426 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7428 self.0.options = v.into();
7429 self
7430 }
7431
7432 pub async fn send(self) -> Result<()> {
7434 (*self.0.stub)
7435 .cancel_operation(self.0.request, self.0.options)
7436 .await
7437 .map(crate::Response::into_body)
7438 }
7439
7440 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7442 self.0.request.name = v.into();
7443 self
7444 }
7445 }
7446
7447 #[doc(hidden)]
7448 impl crate::RequestBuilder for CancelOperation {
7449 fn request_options(&mut self) -> &mut crate::RequestOptions {
7450 &mut self.0.options
7451 }
7452 }
7453}
7454
7455#[cfg(feature = "flows")]
7457#[cfg_attr(docsrs, doc(cfg(feature = "flows")))]
7458pub mod flows {
7459 use crate::Result;
7460
7461 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7475
7476 pub(crate) mod client {
7477 use super::super::super::client::Flows;
7478 pub struct Factory;
7479 impl crate::ClientFactory for Factory {
7480 type Client = Flows;
7481 type Credentials = gaxi::options::Credentials;
7482 async fn build(
7483 self,
7484 config: gaxi::options::ClientConfig,
7485 ) -> crate::ClientBuilderResult<Self::Client> {
7486 Self::Client::new(config).await
7487 }
7488 }
7489 }
7490
7491 #[derive(Clone, Debug)]
7493 pub(crate) struct RequestBuilder<R: std::default::Default> {
7494 stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>,
7495 request: R,
7496 options: crate::RequestOptions,
7497 }
7498
7499 impl<R> RequestBuilder<R>
7500 where
7501 R: std::default::Default,
7502 {
7503 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7504 Self {
7505 stub,
7506 request: R::default(),
7507 options: crate::RequestOptions::default(),
7508 }
7509 }
7510 }
7511
7512 #[derive(Clone, Debug)]
7529 pub struct CreateFlow(RequestBuilder<crate::model::CreateFlowRequest>);
7530
7531 impl CreateFlow {
7532 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7533 Self(RequestBuilder::new(stub))
7534 }
7535
7536 pub fn with_request<V: Into<crate::model::CreateFlowRequest>>(mut self, v: V) -> Self {
7538 self.0.request = v.into();
7539 self
7540 }
7541
7542 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7544 self.0.options = v.into();
7545 self
7546 }
7547
7548 pub async fn send(self) -> Result<crate::model::Flow> {
7550 (*self.0.stub)
7551 .create_flow(self.0.request, self.0.options)
7552 .await
7553 .map(crate::Response::into_body)
7554 }
7555
7556 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7560 self.0.request.parent = v.into();
7561 self
7562 }
7563
7564 pub fn set_flow<T>(mut self, v: T) -> Self
7568 where
7569 T: std::convert::Into<crate::model::Flow>,
7570 {
7571 self.0.request.flow = std::option::Option::Some(v.into());
7572 self
7573 }
7574
7575 pub fn set_or_clear_flow<T>(mut self, v: std::option::Option<T>) -> Self
7579 where
7580 T: std::convert::Into<crate::model::Flow>,
7581 {
7582 self.0.request.flow = v.map(|x| x.into());
7583 self
7584 }
7585
7586 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7588 self.0.request.language_code = v.into();
7589 self
7590 }
7591 }
7592
7593 #[doc(hidden)]
7594 impl crate::RequestBuilder for CreateFlow {
7595 fn request_options(&mut self) -> &mut crate::RequestOptions {
7596 &mut self.0.options
7597 }
7598 }
7599
7600 #[derive(Clone, Debug)]
7617 pub struct DeleteFlow(RequestBuilder<crate::model::DeleteFlowRequest>);
7618
7619 impl DeleteFlow {
7620 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7621 Self(RequestBuilder::new(stub))
7622 }
7623
7624 pub fn with_request<V: Into<crate::model::DeleteFlowRequest>>(mut self, v: V) -> Self {
7626 self.0.request = v.into();
7627 self
7628 }
7629
7630 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7632 self.0.options = v.into();
7633 self
7634 }
7635
7636 pub async fn send(self) -> Result<()> {
7638 (*self.0.stub)
7639 .delete_flow(self.0.request, self.0.options)
7640 .await
7641 .map(crate::Response::into_body)
7642 }
7643
7644 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7648 self.0.request.name = v.into();
7649 self
7650 }
7651
7652 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
7654 self.0.request.force = v.into();
7655 self
7656 }
7657 }
7658
7659 #[doc(hidden)]
7660 impl crate::RequestBuilder for DeleteFlow {
7661 fn request_options(&mut self) -> &mut crate::RequestOptions {
7662 &mut self.0.options
7663 }
7664 }
7665
7666 #[derive(Clone, Debug)]
7687 pub struct ListFlows(RequestBuilder<crate::model::ListFlowsRequest>);
7688
7689 impl ListFlows {
7690 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7691 Self(RequestBuilder::new(stub))
7692 }
7693
7694 pub fn with_request<V: Into<crate::model::ListFlowsRequest>>(mut self, v: V) -> Self {
7696 self.0.request = v.into();
7697 self
7698 }
7699
7700 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7702 self.0.options = v.into();
7703 self
7704 }
7705
7706 pub async fn send(self) -> Result<crate::model::ListFlowsResponse> {
7708 (*self.0.stub)
7709 .list_flows(self.0.request, self.0.options)
7710 .await
7711 .map(crate::Response::into_body)
7712 }
7713
7714 pub fn by_page(
7716 self,
7717 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListFlowsResponse, crate::Error>
7718 {
7719 use std::clone::Clone;
7720 let token = self.0.request.page_token.clone();
7721 let execute = move |token: String| {
7722 let mut builder = self.clone();
7723 builder.0.request = builder.0.request.set_page_token(token);
7724 builder.send()
7725 };
7726 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7727 }
7728
7729 pub fn by_item(
7731 self,
7732 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListFlowsResponse, crate::Error>
7733 {
7734 use google_cloud_gax::paginator::Paginator;
7735 self.by_page().items()
7736 }
7737
7738 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7742 self.0.request.parent = v.into();
7743 self
7744 }
7745
7746 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7748 self.0.request.page_size = v.into();
7749 self
7750 }
7751
7752 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7754 self.0.request.page_token = v.into();
7755 self
7756 }
7757
7758 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7760 self.0.request.language_code = v.into();
7761 self
7762 }
7763 }
7764
7765 #[doc(hidden)]
7766 impl crate::RequestBuilder for ListFlows {
7767 fn request_options(&mut self) -> &mut crate::RequestOptions {
7768 &mut self.0.options
7769 }
7770 }
7771
7772 #[derive(Clone, Debug)]
7789 pub struct GetFlow(RequestBuilder<crate::model::GetFlowRequest>);
7790
7791 impl GetFlow {
7792 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7793 Self(RequestBuilder::new(stub))
7794 }
7795
7796 pub fn with_request<V: Into<crate::model::GetFlowRequest>>(mut self, v: V) -> Self {
7798 self.0.request = v.into();
7799 self
7800 }
7801
7802 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7804 self.0.options = v.into();
7805 self
7806 }
7807
7808 pub async fn send(self) -> Result<crate::model::Flow> {
7810 (*self.0.stub)
7811 .get_flow(self.0.request, self.0.options)
7812 .await
7813 .map(crate::Response::into_body)
7814 }
7815
7816 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7820 self.0.request.name = v.into();
7821 self
7822 }
7823
7824 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7826 self.0.request.language_code = v.into();
7827 self
7828 }
7829 }
7830
7831 #[doc(hidden)]
7832 impl crate::RequestBuilder for GetFlow {
7833 fn request_options(&mut self) -> &mut crate::RequestOptions {
7834 &mut self.0.options
7835 }
7836 }
7837
7838 #[derive(Clone, Debug)]
7855 pub struct UpdateFlow(RequestBuilder<crate::model::UpdateFlowRequest>);
7856
7857 impl UpdateFlow {
7858 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7859 Self(RequestBuilder::new(stub))
7860 }
7861
7862 pub fn with_request<V: Into<crate::model::UpdateFlowRequest>>(mut self, v: V) -> Self {
7864 self.0.request = v.into();
7865 self
7866 }
7867
7868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7870 self.0.options = v.into();
7871 self
7872 }
7873
7874 pub async fn send(self) -> Result<crate::model::Flow> {
7876 (*self.0.stub)
7877 .update_flow(self.0.request, self.0.options)
7878 .await
7879 .map(crate::Response::into_body)
7880 }
7881
7882 pub fn set_flow<T>(mut self, v: T) -> Self
7886 where
7887 T: std::convert::Into<crate::model::Flow>,
7888 {
7889 self.0.request.flow = std::option::Option::Some(v.into());
7890 self
7891 }
7892
7893 pub fn set_or_clear_flow<T>(mut self, v: std::option::Option<T>) -> Self
7897 where
7898 T: std::convert::Into<crate::model::Flow>,
7899 {
7900 self.0.request.flow = v.map(|x| x.into());
7901 self
7902 }
7903
7904 pub fn set_update_mask<T>(mut self, v: T) -> Self
7906 where
7907 T: std::convert::Into<wkt::FieldMask>,
7908 {
7909 self.0.request.update_mask = std::option::Option::Some(v.into());
7910 self
7911 }
7912
7913 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7915 where
7916 T: std::convert::Into<wkt::FieldMask>,
7917 {
7918 self.0.request.update_mask = v.map(|x| x.into());
7919 self
7920 }
7921
7922 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
7924 self.0.request.language_code = v.into();
7925 self
7926 }
7927 }
7928
7929 #[doc(hidden)]
7930 impl crate::RequestBuilder for UpdateFlow {
7931 fn request_options(&mut self) -> &mut crate::RequestOptions {
7932 &mut self.0.options
7933 }
7934 }
7935
7936 #[derive(Clone, Debug)]
7954 pub struct TrainFlow(RequestBuilder<crate::model::TrainFlowRequest>);
7955
7956 impl TrainFlow {
7957 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
7958 Self(RequestBuilder::new(stub))
7959 }
7960
7961 pub fn with_request<V: Into<crate::model::TrainFlowRequest>>(mut self, v: V) -> Self {
7963 self.0.request = v.into();
7964 self
7965 }
7966
7967 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7969 self.0.options = v.into();
7970 self
7971 }
7972
7973 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7980 (*self.0.stub)
7981 .train_flow(self.0.request, self.0.options)
7982 .await
7983 .map(crate::Response::into_body)
7984 }
7985
7986 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
7988 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
7989 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7990 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7991
7992 let stub = self.0.stub.clone();
7993 let mut options = self.0.options.clone();
7994 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7995 let query = move |name| {
7996 let stub = stub.clone();
7997 let options = options.clone();
7998 async {
7999 let op = GetOperation::new(stub)
8000 .set_name(name)
8001 .with_options(options)
8002 .send()
8003 .await?;
8004 Ok(Operation::new(op))
8005 }
8006 };
8007
8008 let start = move || async {
8009 let op = self.send().await?;
8010 Ok(Operation::new(op))
8011 };
8012
8013 google_cloud_lro::internal::new_unit_response_poller(
8014 polling_error_policy,
8015 polling_backoff_policy,
8016 start,
8017 query,
8018 )
8019 }
8020
8021 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8025 self.0.request.name = v.into();
8026 self
8027 }
8028 }
8029
8030 #[doc(hidden)]
8031 impl crate::RequestBuilder for TrainFlow {
8032 fn request_options(&mut self) -> &mut crate::RequestOptions {
8033 &mut self.0.options
8034 }
8035 }
8036
8037 #[derive(Clone, Debug)]
8054 pub struct ValidateFlow(RequestBuilder<crate::model::ValidateFlowRequest>);
8055
8056 impl ValidateFlow {
8057 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8058 Self(RequestBuilder::new(stub))
8059 }
8060
8061 pub fn with_request<V: Into<crate::model::ValidateFlowRequest>>(mut self, v: V) -> Self {
8063 self.0.request = v.into();
8064 self
8065 }
8066
8067 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8069 self.0.options = v.into();
8070 self
8071 }
8072
8073 pub async fn send(self) -> Result<crate::model::FlowValidationResult> {
8075 (*self.0.stub)
8076 .validate_flow(self.0.request, self.0.options)
8077 .await
8078 .map(crate::Response::into_body)
8079 }
8080
8081 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8085 self.0.request.name = v.into();
8086 self
8087 }
8088
8089 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
8091 self.0.request.language_code = v.into();
8092 self
8093 }
8094 }
8095
8096 #[doc(hidden)]
8097 impl crate::RequestBuilder for ValidateFlow {
8098 fn request_options(&mut self) -> &mut crate::RequestOptions {
8099 &mut self.0.options
8100 }
8101 }
8102
8103 #[derive(Clone, Debug)]
8120 pub struct GetFlowValidationResult(
8121 RequestBuilder<crate::model::GetFlowValidationResultRequest>,
8122 );
8123
8124 impl GetFlowValidationResult {
8125 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8126 Self(RequestBuilder::new(stub))
8127 }
8128
8129 pub fn with_request<V: Into<crate::model::GetFlowValidationResultRequest>>(
8131 mut self,
8132 v: V,
8133 ) -> Self {
8134 self.0.request = v.into();
8135 self
8136 }
8137
8138 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8140 self.0.options = v.into();
8141 self
8142 }
8143
8144 pub async fn send(self) -> Result<crate::model::FlowValidationResult> {
8146 (*self.0.stub)
8147 .get_flow_validation_result(self.0.request, self.0.options)
8148 .await
8149 .map(crate::Response::into_body)
8150 }
8151
8152 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8156 self.0.request.name = v.into();
8157 self
8158 }
8159
8160 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
8162 self.0.request.language_code = v.into();
8163 self
8164 }
8165 }
8166
8167 #[doc(hidden)]
8168 impl crate::RequestBuilder for GetFlowValidationResult {
8169 fn request_options(&mut self) -> &mut crate::RequestOptions {
8170 &mut self.0.options
8171 }
8172 }
8173
8174 #[derive(Clone, Debug)]
8192 pub struct ImportFlow(RequestBuilder<crate::model::ImportFlowRequest>);
8193
8194 impl ImportFlow {
8195 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8196 Self(RequestBuilder::new(stub))
8197 }
8198
8199 pub fn with_request<V: Into<crate::model::ImportFlowRequest>>(mut self, v: V) -> Self {
8201 self.0.request = v.into();
8202 self
8203 }
8204
8205 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8207 self.0.options = v.into();
8208 self
8209 }
8210
8211 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8218 (*self.0.stub)
8219 .import_flow(self.0.request, self.0.options)
8220 .await
8221 .map(crate::Response::into_body)
8222 }
8223
8224 pub fn poller(
8226 self,
8227 ) -> impl google_cloud_lro::Poller<crate::model::ImportFlowResponse, wkt::Struct> {
8228 type Operation = google_cloud_lro::internal::Operation<
8229 crate::model::ImportFlowResponse,
8230 wkt::Struct,
8231 >;
8232 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8233 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8234
8235 let stub = self.0.stub.clone();
8236 let mut options = self.0.options.clone();
8237 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8238 let query = move |name| {
8239 let stub = stub.clone();
8240 let options = options.clone();
8241 async {
8242 let op = GetOperation::new(stub)
8243 .set_name(name)
8244 .with_options(options)
8245 .send()
8246 .await?;
8247 Ok(Operation::new(op))
8248 }
8249 };
8250
8251 let start = move || async {
8252 let op = self.send().await?;
8253 Ok(Operation::new(op))
8254 };
8255
8256 google_cloud_lro::internal::new_poller(
8257 polling_error_policy,
8258 polling_backoff_policy,
8259 start,
8260 query,
8261 )
8262 }
8263
8264 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8268 self.0.request.parent = v.into();
8269 self
8270 }
8271
8272 pub fn set_import_option<T: Into<crate::model::import_flow_request::ImportOption>>(
8274 mut self,
8275 v: T,
8276 ) -> Self {
8277 self.0.request.import_option = v.into();
8278 self
8279 }
8280
8281 pub fn set_flow_import_strategy<T>(mut self, v: T) -> Self
8283 where
8284 T: std::convert::Into<crate::model::FlowImportStrategy>,
8285 {
8286 self.0.request.flow_import_strategy = std::option::Option::Some(v.into());
8287 self
8288 }
8289
8290 pub fn set_or_clear_flow_import_strategy<T>(mut self, v: std::option::Option<T>) -> Self
8292 where
8293 T: std::convert::Into<crate::model::FlowImportStrategy>,
8294 {
8295 self.0.request.flow_import_strategy = v.map(|x| x.into());
8296 self
8297 }
8298
8299 pub fn set_flow<T: Into<Option<crate::model::import_flow_request::Flow>>>(
8304 mut self,
8305 v: T,
8306 ) -> Self {
8307 self.0.request.flow = v.into();
8308 self
8309 }
8310
8311 pub fn set_flow_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
8317 self.0.request = self.0.request.set_flow_uri(v);
8318 self
8319 }
8320
8321 pub fn set_flow_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
8327 self.0.request = self.0.request.set_flow_content(v);
8328 self
8329 }
8330 }
8331
8332 #[doc(hidden)]
8333 impl crate::RequestBuilder for ImportFlow {
8334 fn request_options(&mut self) -> &mut crate::RequestOptions {
8335 &mut self.0.options
8336 }
8337 }
8338
8339 #[derive(Clone, Debug)]
8357 pub struct ExportFlow(RequestBuilder<crate::model::ExportFlowRequest>);
8358
8359 impl ExportFlow {
8360 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8361 Self(RequestBuilder::new(stub))
8362 }
8363
8364 pub fn with_request<V: Into<crate::model::ExportFlowRequest>>(mut self, v: V) -> Self {
8366 self.0.request = v.into();
8367 self
8368 }
8369
8370 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8372 self.0.options = v.into();
8373 self
8374 }
8375
8376 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8383 (*self.0.stub)
8384 .export_flow(self.0.request, self.0.options)
8385 .await
8386 .map(crate::Response::into_body)
8387 }
8388
8389 pub fn poller(
8391 self,
8392 ) -> impl google_cloud_lro::Poller<crate::model::ExportFlowResponse, wkt::Struct> {
8393 type Operation = google_cloud_lro::internal::Operation<
8394 crate::model::ExportFlowResponse,
8395 wkt::Struct,
8396 >;
8397 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8398 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8399
8400 let stub = self.0.stub.clone();
8401 let mut options = self.0.options.clone();
8402 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8403 let query = move |name| {
8404 let stub = stub.clone();
8405 let options = options.clone();
8406 async {
8407 let op = GetOperation::new(stub)
8408 .set_name(name)
8409 .with_options(options)
8410 .send()
8411 .await?;
8412 Ok(Operation::new(op))
8413 }
8414 };
8415
8416 let start = move || async {
8417 let op = self.send().await?;
8418 Ok(Operation::new(op))
8419 };
8420
8421 google_cloud_lro::internal::new_poller(
8422 polling_error_policy,
8423 polling_backoff_policy,
8424 start,
8425 query,
8426 )
8427 }
8428
8429 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8433 self.0.request.name = v.into();
8434 self
8435 }
8436
8437 pub fn set_flow_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
8439 self.0.request.flow_uri = v.into();
8440 self
8441 }
8442
8443 pub fn set_include_referenced_flows<T: Into<bool>>(mut self, v: T) -> Self {
8445 self.0.request.include_referenced_flows = v.into();
8446 self
8447 }
8448 }
8449
8450 #[doc(hidden)]
8451 impl crate::RequestBuilder for ExportFlow {
8452 fn request_options(&mut self) -> &mut crate::RequestOptions {
8453 &mut self.0.options
8454 }
8455 }
8456
8457 #[derive(Clone, Debug)]
8478 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8479
8480 impl ListLocations {
8481 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8482 Self(RequestBuilder::new(stub))
8483 }
8484
8485 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8487 mut self,
8488 v: V,
8489 ) -> Self {
8490 self.0.request = v.into();
8491 self
8492 }
8493
8494 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8496 self.0.options = v.into();
8497 self
8498 }
8499
8500 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8502 (*self.0.stub)
8503 .list_locations(self.0.request, self.0.options)
8504 .await
8505 .map(crate::Response::into_body)
8506 }
8507
8508 pub fn by_page(
8510 self,
8511 ) -> impl google_cloud_gax::paginator::Paginator<
8512 google_cloud_location::model::ListLocationsResponse,
8513 crate::Error,
8514 > {
8515 use std::clone::Clone;
8516 let token = self.0.request.page_token.clone();
8517 let execute = move |token: String| {
8518 let mut builder = self.clone();
8519 builder.0.request = builder.0.request.set_page_token(token);
8520 builder.send()
8521 };
8522 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8523 }
8524
8525 pub fn by_item(
8527 self,
8528 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8529 google_cloud_location::model::ListLocationsResponse,
8530 crate::Error,
8531 > {
8532 use google_cloud_gax::paginator::Paginator;
8533 self.by_page().items()
8534 }
8535
8536 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8538 self.0.request.name = v.into();
8539 self
8540 }
8541
8542 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8544 self.0.request.filter = v.into();
8545 self
8546 }
8547
8548 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8550 self.0.request.page_size = v.into();
8551 self
8552 }
8553
8554 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8556 self.0.request.page_token = v.into();
8557 self
8558 }
8559 }
8560
8561 #[doc(hidden)]
8562 impl crate::RequestBuilder for ListLocations {
8563 fn request_options(&mut self) -> &mut crate::RequestOptions {
8564 &mut self.0.options
8565 }
8566 }
8567
8568 #[derive(Clone, Debug)]
8585 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8586
8587 impl GetLocation {
8588 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8589 Self(RequestBuilder::new(stub))
8590 }
8591
8592 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8594 mut self,
8595 v: V,
8596 ) -> Self {
8597 self.0.request = v.into();
8598 self
8599 }
8600
8601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8603 self.0.options = v.into();
8604 self
8605 }
8606
8607 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8609 (*self.0.stub)
8610 .get_location(self.0.request, self.0.options)
8611 .await
8612 .map(crate::Response::into_body)
8613 }
8614
8615 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8617 self.0.request.name = v.into();
8618 self
8619 }
8620 }
8621
8622 #[doc(hidden)]
8623 impl crate::RequestBuilder for GetLocation {
8624 fn request_options(&mut self) -> &mut crate::RequestOptions {
8625 &mut self.0.options
8626 }
8627 }
8628
8629 #[derive(Clone, Debug)]
8650 pub struct ListOperations(
8651 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8652 );
8653
8654 impl ListOperations {
8655 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8656 Self(RequestBuilder::new(stub))
8657 }
8658
8659 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8661 mut self,
8662 v: V,
8663 ) -> Self {
8664 self.0.request = v.into();
8665 self
8666 }
8667
8668 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8670 self.0.options = v.into();
8671 self
8672 }
8673
8674 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8676 (*self.0.stub)
8677 .list_operations(self.0.request, self.0.options)
8678 .await
8679 .map(crate::Response::into_body)
8680 }
8681
8682 pub fn by_page(
8684 self,
8685 ) -> impl google_cloud_gax::paginator::Paginator<
8686 google_cloud_longrunning::model::ListOperationsResponse,
8687 crate::Error,
8688 > {
8689 use std::clone::Clone;
8690 let token = self.0.request.page_token.clone();
8691 let execute = move |token: String| {
8692 let mut builder = self.clone();
8693 builder.0.request = builder.0.request.set_page_token(token);
8694 builder.send()
8695 };
8696 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8697 }
8698
8699 pub fn by_item(
8701 self,
8702 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8703 google_cloud_longrunning::model::ListOperationsResponse,
8704 crate::Error,
8705 > {
8706 use google_cloud_gax::paginator::Paginator;
8707 self.by_page().items()
8708 }
8709
8710 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8712 self.0.request.name = v.into();
8713 self
8714 }
8715
8716 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8718 self.0.request.filter = v.into();
8719 self
8720 }
8721
8722 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8724 self.0.request.page_size = v.into();
8725 self
8726 }
8727
8728 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8730 self.0.request.page_token = v.into();
8731 self
8732 }
8733
8734 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8736 self.0.request.return_partial_success = v.into();
8737 self
8738 }
8739 }
8740
8741 #[doc(hidden)]
8742 impl crate::RequestBuilder for ListOperations {
8743 fn request_options(&mut self) -> &mut crate::RequestOptions {
8744 &mut self.0.options
8745 }
8746 }
8747
8748 #[derive(Clone, Debug)]
8765 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8766
8767 impl GetOperation {
8768 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8769 Self(RequestBuilder::new(stub))
8770 }
8771
8772 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8774 mut self,
8775 v: V,
8776 ) -> Self {
8777 self.0.request = v.into();
8778 self
8779 }
8780
8781 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8783 self.0.options = v.into();
8784 self
8785 }
8786
8787 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8789 (*self.0.stub)
8790 .get_operation(self.0.request, self.0.options)
8791 .await
8792 .map(crate::Response::into_body)
8793 }
8794
8795 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8797 self.0.request.name = v.into();
8798 self
8799 }
8800 }
8801
8802 #[doc(hidden)]
8803 impl crate::RequestBuilder for GetOperation {
8804 fn request_options(&mut self) -> &mut crate::RequestOptions {
8805 &mut self.0.options
8806 }
8807 }
8808
8809 #[derive(Clone, Debug)]
8826 pub struct CancelOperation(
8827 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8828 );
8829
8830 impl CancelOperation {
8831 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Flows>) -> Self {
8832 Self(RequestBuilder::new(stub))
8833 }
8834
8835 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8837 mut self,
8838 v: V,
8839 ) -> Self {
8840 self.0.request = v.into();
8841 self
8842 }
8843
8844 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8846 self.0.options = v.into();
8847 self
8848 }
8849
8850 pub async fn send(self) -> Result<()> {
8852 (*self.0.stub)
8853 .cancel_operation(self.0.request, self.0.options)
8854 .await
8855 .map(crate::Response::into_body)
8856 }
8857
8858 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8860 self.0.request.name = v.into();
8861 self
8862 }
8863 }
8864
8865 #[doc(hidden)]
8866 impl crate::RequestBuilder for CancelOperation {
8867 fn request_options(&mut self) -> &mut crate::RequestOptions {
8868 &mut self.0.options
8869 }
8870 }
8871}
8872
8873#[cfg(feature = "generators")]
8875#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
8876pub mod generators {
8877 use crate::Result;
8878
8879 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8893
8894 pub(crate) mod client {
8895 use super::super::super::client::Generators;
8896 pub struct Factory;
8897 impl crate::ClientFactory for Factory {
8898 type Client = Generators;
8899 type Credentials = gaxi::options::Credentials;
8900 async fn build(
8901 self,
8902 config: gaxi::options::ClientConfig,
8903 ) -> crate::ClientBuilderResult<Self::Client> {
8904 Self::Client::new(config).await
8905 }
8906 }
8907 }
8908
8909 #[derive(Clone, Debug)]
8911 pub(crate) struct RequestBuilder<R: std::default::Default> {
8912 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
8913 request: R,
8914 options: crate::RequestOptions,
8915 }
8916
8917 impl<R> RequestBuilder<R>
8918 where
8919 R: std::default::Default,
8920 {
8921 pub(crate) fn new(
8922 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
8923 ) -> Self {
8924 Self {
8925 stub,
8926 request: R::default(),
8927 options: crate::RequestOptions::default(),
8928 }
8929 }
8930 }
8931
8932 #[derive(Clone, Debug)]
8953 pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
8954
8955 impl ListGenerators {
8956 pub(crate) fn new(
8957 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
8958 ) -> Self {
8959 Self(RequestBuilder::new(stub))
8960 }
8961
8962 pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
8964 self.0.request = v.into();
8965 self
8966 }
8967
8968 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8970 self.0.options = v.into();
8971 self
8972 }
8973
8974 pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
8976 (*self.0.stub)
8977 .list_generators(self.0.request, self.0.options)
8978 .await
8979 .map(crate::Response::into_body)
8980 }
8981
8982 pub fn by_page(
8984 self,
8985 ) -> impl google_cloud_gax::paginator::Paginator<
8986 crate::model::ListGeneratorsResponse,
8987 crate::Error,
8988 > {
8989 use std::clone::Clone;
8990 let token = self.0.request.page_token.clone();
8991 let execute = move |token: String| {
8992 let mut builder = self.clone();
8993 builder.0.request = builder.0.request.set_page_token(token);
8994 builder.send()
8995 };
8996 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8997 }
8998
8999 pub fn by_item(
9001 self,
9002 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9003 crate::model::ListGeneratorsResponse,
9004 crate::Error,
9005 > {
9006 use google_cloud_gax::paginator::Paginator;
9007 self.by_page().items()
9008 }
9009
9010 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9014 self.0.request.parent = v.into();
9015 self
9016 }
9017
9018 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9020 self.0.request.language_code = v.into();
9021 self
9022 }
9023
9024 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9026 self.0.request.page_size = v.into();
9027 self
9028 }
9029
9030 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9032 self.0.request.page_token = v.into();
9033 self
9034 }
9035 }
9036
9037 #[doc(hidden)]
9038 impl crate::RequestBuilder for ListGenerators {
9039 fn request_options(&mut self) -> &mut crate::RequestOptions {
9040 &mut self.0.options
9041 }
9042 }
9043
9044 #[derive(Clone, Debug)]
9061 pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
9062
9063 impl GetGenerator {
9064 pub(crate) fn new(
9065 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9066 ) -> Self {
9067 Self(RequestBuilder::new(stub))
9068 }
9069
9070 pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
9072 self.0.request = v.into();
9073 self
9074 }
9075
9076 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9078 self.0.options = v.into();
9079 self
9080 }
9081
9082 pub async fn send(self) -> Result<crate::model::Generator> {
9084 (*self.0.stub)
9085 .get_generator(self.0.request, self.0.options)
9086 .await
9087 .map(crate::Response::into_body)
9088 }
9089
9090 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9094 self.0.request.name = v.into();
9095 self
9096 }
9097
9098 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9100 self.0.request.language_code = v.into();
9101 self
9102 }
9103 }
9104
9105 #[doc(hidden)]
9106 impl crate::RequestBuilder for GetGenerator {
9107 fn request_options(&mut self) -> &mut crate::RequestOptions {
9108 &mut self.0.options
9109 }
9110 }
9111
9112 #[derive(Clone, Debug)]
9129 pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
9130
9131 impl CreateGenerator {
9132 pub(crate) fn new(
9133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9134 ) -> Self {
9135 Self(RequestBuilder::new(stub))
9136 }
9137
9138 pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
9140 self.0.request = v.into();
9141 self
9142 }
9143
9144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9146 self.0.options = v.into();
9147 self
9148 }
9149
9150 pub async fn send(self) -> Result<crate::model::Generator> {
9152 (*self.0.stub)
9153 .create_generator(self.0.request, self.0.options)
9154 .await
9155 .map(crate::Response::into_body)
9156 }
9157
9158 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9162 self.0.request.parent = v.into();
9163 self
9164 }
9165
9166 pub fn set_generator<T>(mut self, v: T) -> Self
9170 where
9171 T: std::convert::Into<crate::model::Generator>,
9172 {
9173 self.0.request.generator = std::option::Option::Some(v.into());
9174 self
9175 }
9176
9177 pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
9181 where
9182 T: std::convert::Into<crate::model::Generator>,
9183 {
9184 self.0.request.generator = v.map(|x| x.into());
9185 self
9186 }
9187
9188 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9190 self.0.request.language_code = v.into();
9191 self
9192 }
9193 }
9194
9195 #[doc(hidden)]
9196 impl crate::RequestBuilder for CreateGenerator {
9197 fn request_options(&mut self) -> &mut crate::RequestOptions {
9198 &mut self.0.options
9199 }
9200 }
9201
9202 #[derive(Clone, Debug)]
9219 pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
9220
9221 impl UpdateGenerator {
9222 pub(crate) fn new(
9223 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9224 ) -> Self {
9225 Self(RequestBuilder::new(stub))
9226 }
9227
9228 pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
9230 self.0.request = v.into();
9231 self
9232 }
9233
9234 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9236 self.0.options = v.into();
9237 self
9238 }
9239
9240 pub async fn send(self) -> Result<crate::model::Generator> {
9242 (*self.0.stub)
9243 .update_generator(self.0.request, self.0.options)
9244 .await
9245 .map(crate::Response::into_body)
9246 }
9247
9248 pub fn set_generator<T>(mut self, v: T) -> Self
9252 where
9253 T: std::convert::Into<crate::model::Generator>,
9254 {
9255 self.0.request.generator = std::option::Option::Some(v.into());
9256 self
9257 }
9258
9259 pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
9263 where
9264 T: std::convert::Into<crate::model::Generator>,
9265 {
9266 self.0.request.generator = v.map(|x| x.into());
9267 self
9268 }
9269
9270 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9272 self.0.request.language_code = v.into();
9273 self
9274 }
9275
9276 pub fn set_update_mask<T>(mut self, v: T) -> Self
9278 where
9279 T: std::convert::Into<wkt::FieldMask>,
9280 {
9281 self.0.request.update_mask = std::option::Option::Some(v.into());
9282 self
9283 }
9284
9285 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9287 where
9288 T: std::convert::Into<wkt::FieldMask>,
9289 {
9290 self.0.request.update_mask = v.map(|x| x.into());
9291 self
9292 }
9293 }
9294
9295 #[doc(hidden)]
9296 impl crate::RequestBuilder for UpdateGenerator {
9297 fn request_options(&mut self) -> &mut crate::RequestOptions {
9298 &mut self.0.options
9299 }
9300 }
9301
9302 #[derive(Clone, Debug)]
9319 pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
9320
9321 impl DeleteGenerator {
9322 pub(crate) fn new(
9323 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9324 ) -> Self {
9325 Self(RequestBuilder::new(stub))
9326 }
9327
9328 pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
9330 self.0.request = v.into();
9331 self
9332 }
9333
9334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9336 self.0.options = v.into();
9337 self
9338 }
9339
9340 pub async fn send(self) -> Result<()> {
9342 (*self.0.stub)
9343 .delete_generator(self.0.request, self.0.options)
9344 .await
9345 .map(crate::Response::into_body)
9346 }
9347
9348 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9352 self.0.request.name = v.into();
9353 self
9354 }
9355
9356 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
9358 self.0.request.force = v.into();
9359 self
9360 }
9361 }
9362
9363 #[doc(hidden)]
9364 impl crate::RequestBuilder for DeleteGenerator {
9365 fn request_options(&mut self) -> &mut crate::RequestOptions {
9366 &mut self.0.options
9367 }
9368 }
9369
9370 #[derive(Clone, Debug)]
9391 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9392
9393 impl ListLocations {
9394 pub(crate) fn new(
9395 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9396 ) -> Self {
9397 Self(RequestBuilder::new(stub))
9398 }
9399
9400 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9402 mut self,
9403 v: V,
9404 ) -> Self {
9405 self.0.request = v.into();
9406 self
9407 }
9408
9409 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9411 self.0.options = v.into();
9412 self
9413 }
9414
9415 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9417 (*self.0.stub)
9418 .list_locations(self.0.request, self.0.options)
9419 .await
9420 .map(crate::Response::into_body)
9421 }
9422
9423 pub fn by_page(
9425 self,
9426 ) -> impl google_cloud_gax::paginator::Paginator<
9427 google_cloud_location::model::ListLocationsResponse,
9428 crate::Error,
9429 > {
9430 use std::clone::Clone;
9431 let token = self.0.request.page_token.clone();
9432 let execute = move |token: String| {
9433 let mut builder = self.clone();
9434 builder.0.request = builder.0.request.set_page_token(token);
9435 builder.send()
9436 };
9437 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9438 }
9439
9440 pub fn by_item(
9442 self,
9443 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9444 google_cloud_location::model::ListLocationsResponse,
9445 crate::Error,
9446 > {
9447 use google_cloud_gax::paginator::Paginator;
9448 self.by_page().items()
9449 }
9450
9451 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9453 self.0.request.name = v.into();
9454 self
9455 }
9456
9457 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9459 self.0.request.filter = v.into();
9460 self
9461 }
9462
9463 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9465 self.0.request.page_size = v.into();
9466 self
9467 }
9468
9469 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9471 self.0.request.page_token = v.into();
9472 self
9473 }
9474 }
9475
9476 #[doc(hidden)]
9477 impl crate::RequestBuilder for ListLocations {
9478 fn request_options(&mut self) -> &mut crate::RequestOptions {
9479 &mut self.0.options
9480 }
9481 }
9482
9483 #[derive(Clone, Debug)]
9500 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9501
9502 impl GetLocation {
9503 pub(crate) fn new(
9504 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9505 ) -> Self {
9506 Self(RequestBuilder::new(stub))
9507 }
9508
9509 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9511 mut self,
9512 v: V,
9513 ) -> Self {
9514 self.0.request = v.into();
9515 self
9516 }
9517
9518 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9520 self.0.options = v.into();
9521 self
9522 }
9523
9524 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9526 (*self.0.stub)
9527 .get_location(self.0.request, self.0.options)
9528 .await
9529 .map(crate::Response::into_body)
9530 }
9531
9532 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9534 self.0.request.name = v.into();
9535 self
9536 }
9537 }
9538
9539 #[doc(hidden)]
9540 impl crate::RequestBuilder for GetLocation {
9541 fn request_options(&mut self) -> &mut crate::RequestOptions {
9542 &mut self.0.options
9543 }
9544 }
9545
9546 #[derive(Clone, Debug)]
9567 pub struct ListOperations(
9568 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9569 );
9570
9571 impl ListOperations {
9572 pub(crate) fn new(
9573 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9574 ) -> Self {
9575 Self(RequestBuilder::new(stub))
9576 }
9577
9578 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9580 mut self,
9581 v: V,
9582 ) -> Self {
9583 self.0.request = v.into();
9584 self
9585 }
9586
9587 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9589 self.0.options = v.into();
9590 self
9591 }
9592
9593 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9595 (*self.0.stub)
9596 .list_operations(self.0.request, self.0.options)
9597 .await
9598 .map(crate::Response::into_body)
9599 }
9600
9601 pub fn by_page(
9603 self,
9604 ) -> impl google_cloud_gax::paginator::Paginator<
9605 google_cloud_longrunning::model::ListOperationsResponse,
9606 crate::Error,
9607 > {
9608 use std::clone::Clone;
9609 let token = self.0.request.page_token.clone();
9610 let execute = move |token: String| {
9611 let mut builder = self.clone();
9612 builder.0.request = builder.0.request.set_page_token(token);
9613 builder.send()
9614 };
9615 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9616 }
9617
9618 pub fn by_item(
9620 self,
9621 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9622 google_cloud_longrunning::model::ListOperationsResponse,
9623 crate::Error,
9624 > {
9625 use google_cloud_gax::paginator::Paginator;
9626 self.by_page().items()
9627 }
9628
9629 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9631 self.0.request.name = v.into();
9632 self
9633 }
9634
9635 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9637 self.0.request.filter = v.into();
9638 self
9639 }
9640
9641 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9643 self.0.request.page_size = v.into();
9644 self
9645 }
9646
9647 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9649 self.0.request.page_token = v.into();
9650 self
9651 }
9652
9653 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9655 self.0.request.return_partial_success = v.into();
9656 self
9657 }
9658 }
9659
9660 #[doc(hidden)]
9661 impl crate::RequestBuilder for ListOperations {
9662 fn request_options(&mut self) -> &mut crate::RequestOptions {
9663 &mut self.0.options
9664 }
9665 }
9666
9667 #[derive(Clone, Debug)]
9684 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9685
9686 impl GetOperation {
9687 pub(crate) fn new(
9688 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9689 ) -> Self {
9690 Self(RequestBuilder::new(stub))
9691 }
9692
9693 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9695 mut self,
9696 v: V,
9697 ) -> Self {
9698 self.0.request = v.into();
9699 self
9700 }
9701
9702 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9704 self.0.options = v.into();
9705 self
9706 }
9707
9708 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9710 (*self.0.stub)
9711 .get_operation(self.0.request, self.0.options)
9712 .await
9713 .map(crate::Response::into_body)
9714 }
9715
9716 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9718 self.0.request.name = v.into();
9719 self
9720 }
9721 }
9722
9723 #[doc(hidden)]
9724 impl crate::RequestBuilder for GetOperation {
9725 fn request_options(&mut self) -> &mut crate::RequestOptions {
9726 &mut self.0.options
9727 }
9728 }
9729
9730 #[derive(Clone, Debug)]
9747 pub struct CancelOperation(
9748 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9749 );
9750
9751 impl CancelOperation {
9752 pub(crate) fn new(
9753 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
9754 ) -> Self {
9755 Self(RequestBuilder::new(stub))
9756 }
9757
9758 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9760 mut self,
9761 v: V,
9762 ) -> Self {
9763 self.0.request = v.into();
9764 self
9765 }
9766
9767 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9769 self.0.options = v.into();
9770 self
9771 }
9772
9773 pub async fn send(self) -> Result<()> {
9775 (*self.0.stub)
9776 .cancel_operation(self.0.request, self.0.options)
9777 .await
9778 .map(crate::Response::into_body)
9779 }
9780
9781 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9783 self.0.request.name = v.into();
9784 self
9785 }
9786 }
9787
9788 #[doc(hidden)]
9789 impl crate::RequestBuilder for CancelOperation {
9790 fn request_options(&mut self) -> &mut crate::RequestOptions {
9791 &mut self.0.options
9792 }
9793 }
9794}
9795
9796#[cfg(feature = "intents")]
9798#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
9799pub mod intents {
9800 use crate::Result;
9801
9802 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
9816
9817 pub(crate) mod client {
9818 use super::super::super::client::Intents;
9819 pub struct Factory;
9820 impl crate::ClientFactory for Factory {
9821 type Client = Intents;
9822 type Credentials = gaxi::options::Credentials;
9823 async fn build(
9824 self,
9825 config: gaxi::options::ClientConfig,
9826 ) -> crate::ClientBuilderResult<Self::Client> {
9827 Self::Client::new(config).await
9828 }
9829 }
9830 }
9831
9832 #[derive(Clone, Debug)]
9834 pub(crate) struct RequestBuilder<R: std::default::Default> {
9835 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
9836 request: R,
9837 options: crate::RequestOptions,
9838 }
9839
9840 impl<R> RequestBuilder<R>
9841 where
9842 R: std::default::Default,
9843 {
9844 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
9845 Self {
9846 stub,
9847 request: R::default(),
9848 options: crate::RequestOptions::default(),
9849 }
9850 }
9851 }
9852
9853 #[derive(Clone, Debug)]
9874 pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
9875
9876 impl ListIntents {
9877 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
9878 Self(RequestBuilder::new(stub))
9879 }
9880
9881 pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
9883 self.0.request = v.into();
9884 self
9885 }
9886
9887 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9889 self.0.options = v.into();
9890 self
9891 }
9892
9893 pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
9895 (*self.0.stub)
9896 .list_intents(self.0.request, self.0.options)
9897 .await
9898 .map(crate::Response::into_body)
9899 }
9900
9901 pub fn by_page(
9903 self,
9904 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIntentsResponse, crate::Error>
9905 {
9906 use std::clone::Clone;
9907 let token = self.0.request.page_token.clone();
9908 let execute = move |token: String| {
9909 let mut builder = self.clone();
9910 builder.0.request = builder.0.request.set_page_token(token);
9911 builder.send()
9912 };
9913 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9914 }
9915
9916 pub fn by_item(
9918 self,
9919 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9920 crate::model::ListIntentsResponse,
9921 crate::Error,
9922 > {
9923 use google_cloud_gax::paginator::Paginator;
9924 self.by_page().items()
9925 }
9926
9927 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
9931 self.0.request.parent = v.into();
9932 self
9933 }
9934
9935 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
9937 self.0.request.language_code = v.into();
9938 self
9939 }
9940
9941 pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
9943 self.0.request.intent_view = v.into();
9944 self
9945 }
9946
9947 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9949 self.0.request.page_size = v.into();
9950 self
9951 }
9952
9953 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9955 self.0.request.page_token = v.into();
9956 self
9957 }
9958 }
9959
9960 #[doc(hidden)]
9961 impl crate::RequestBuilder for ListIntents {
9962 fn request_options(&mut self) -> &mut crate::RequestOptions {
9963 &mut self.0.options
9964 }
9965 }
9966
9967 #[derive(Clone, Debug)]
9984 pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
9985
9986 impl GetIntent {
9987 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
9988 Self(RequestBuilder::new(stub))
9989 }
9990
9991 pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
9993 self.0.request = v.into();
9994 self
9995 }
9996
9997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9999 self.0.options = v.into();
10000 self
10001 }
10002
10003 pub async fn send(self) -> Result<crate::model::Intent> {
10005 (*self.0.stub)
10006 .get_intent(self.0.request, self.0.options)
10007 .await
10008 .map(crate::Response::into_body)
10009 }
10010
10011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10015 self.0.request.name = v.into();
10016 self
10017 }
10018
10019 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10021 self.0.request.language_code = v.into();
10022 self
10023 }
10024 }
10025
10026 #[doc(hidden)]
10027 impl crate::RequestBuilder for GetIntent {
10028 fn request_options(&mut self) -> &mut crate::RequestOptions {
10029 &mut self.0.options
10030 }
10031 }
10032
10033 #[derive(Clone, Debug)]
10050 pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
10051
10052 impl CreateIntent {
10053 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10054 Self(RequestBuilder::new(stub))
10055 }
10056
10057 pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
10059 self.0.request = v.into();
10060 self
10061 }
10062
10063 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10065 self.0.options = v.into();
10066 self
10067 }
10068
10069 pub async fn send(self) -> Result<crate::model::Intent> {
10071 (*self.0.stub)
10072 .create_intent(self.0.request, self.0.options)
10073 .await
10074 .map(crate::Response::into_body)
10075 }
10076
10077 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10081 self.0.request.parent = v.into();
10082 self
10083 }
10084
10085 pub fn set_intent<T>(mut self, v: T) -> Self
10089 where
10090 T: std::convert::Into<crate::model::Intent>,
10091 {
10092 self.0.request.intent = std::option::Option::Some(v.into());
10093 self
10094 }
10095
10096 pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
10100 where
10101 T: std::convert::Into<crate::model::Intent>,
10102 {
10103 self.0.request.intent = v.map(|x| x.into());
10104 self
10105 }
10106
10107 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10109 self.0.request.language_code = v.into();
10110 self
10111 }
10112 }
10113
10114 #[doc(hidden)]
10115 impl crate::RequestBuilder for CreateIntent {
10116 fn request_options(&mut self) -> &mut crate::RequestOptions {
10117 &mut self.0.options
10118 }
10119 }
10120
10121 #[derive(Clone, Debug)]
10138 pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
10139
10140 impl UpdateIntent {
10141 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10142 Self(RequestBuilder::new(stub))
10143 }
10144
10145 pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
10147 self.0.request = v.into();
10148 self
10149 }
10150
10151 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10153 self.0.options = v.into();
10154 self
10155 }
10156
10157 pub async fn send(self) -> Result<crate::model::Intent> {
10159 (*self.0.stub)
10160 .update_intent(self.0.request, self.0.options)
10161 .await
10162 .map(crate::Response::into_body)
10163 }
10164
10165 pub fn set_intent<T>(mut self, v: T) -> Self
10169 where
10170 T: std::convert::Into<crate::model::Intent>,
10171 {
10172 self.0.request.intent = std::option::Option::Some(v.into());
10173 self
10174 }
10175
10176 pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
10180 where
10181 T: std::convert::Into<crate::model::Intent>,
10182 {
10183 self.0.request.intent = v.map(|x| x.into());
10184 self
10185 }
10186
10187 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10189 self.0.request.language_code = v.into();
10190 self
10191 }
10192
10193 pub fn set_update_mask<T>(mut self, v: T) -> Self
10195 where
10196 T: std::convert::Into<wkt::FieldMask>,
10197 {
10198 self.0.request.update_mask = std::option::Option::Some(v.into());
10199 self
10200 }
10201
10202 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
10204 where
10205 T: std::convert::Into<wkt::FieldMask>,
10206 {
10207 self.0.request.update_mask = v.map(|x| x.into());
10208 self
10209 }
10210 }
10211
10212 #[doc(hidden)]
10213 impl crate::RequestBuilder for UpdateIntent {
10214 fn request_options(&mut self) -> &mut crate::RequestOptions {
10215 &mut self.0.options
10216 }
10217 }
10218
10219 #[derive(Clone, Debug)]
10236 pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
10237
10238 impl DeleteIntent {
10239 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10240 Self(RequestBuilder::new(stub))
10241 }
10242
10243 pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
10245 self.0.request = v.into();
10246 self
10247 }
10248
10249 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10251 self.0.options = v.into();
10252 self
10253 }
10254
10255 pub async fn send(self) -> Result<()> {
10257 (*self.0.stub)
10258 .delete_intent(self.0.request, self.0.options)
10259 .await
10260 .map(crate::Response::into_body)
10261 }
10262
10263 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10267 self.0.request.name = v.into();
10268 self
10269 }
10270 }
10271
10272 #[doc(hidden)]
10273 impl crate::RequestBuilder for DeleteIntent {
10274 fn request_options(&mut self) -> &mut crate::RequestOptions {
10275 &mut self.0.options
10276 }
10277 }
10278
10279 #[derive(Clone, Debug)]
10297 pub struct ImportIntents(RequestBuilder<crate::model::ImportIntentsRequest>);
10298
10299 impl ImportIntents {
10300 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10301 Self(RequestBuilder::new(stub))
10302 }
10303
10304 pub fn with_request<V: Into<crate::model::ImportIntentsRequest>>(mut self, v: V) -> Self {
10306 self.0.request = v.into();
10307 self
10308 }
10309
10310 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10312 self.0.options = v.into();
10313 self
10314 }
10315
10316 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10323 (*self.0.stub)
10324 .import_intents(self.0.request, self.0.options)
10325 .await
10326 .map(crate::Response::into_body)
10327 }
10328
10329 pub fn poller(
10331 self,
10332 ) -> impl google_cloud_lro::Poller<
10333 crate::model::ImportIntentsResponse,
10334 crate::model::ImportIntentsMetadata,
10335 > {
10336 type Operation = google_cloud_lro::internal::Operation<
10337 crate::model::ImportIntentsResponse,
10338 crate::model::ImportIntentsMetadata,
10339 >;
10340 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10341 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10342
10343 let stub = self.0.stub.clone();
10344 let mut options = self.0.options.clone();
10345 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10346 let query = move |name| {
10347 let stub = stub.clone();
10348 let options = options.clone();
10349 async {
10350 let op = GetOperation::new(stub)
10351 .set_name(name)
10352 .with_options(options)
10353 .send()
10354 .await?;
10355 Ok(Operation::new(op))
10356 }
10357 };
10358
10359 let start = move || async {
10360 let op = self.send().await?;
10361 Ok(Operation::new(op))
10362 };
10363
10364 google_cloud_lro::internal::new_poller(
10365 polling_error_policy,
10366 polling_backoff_policy,
10367 start,
10368 query,
10369 )
10370 }
10371
10372 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10376 self.0.request.parent = v.into();
10377 self
10378 }
10379
10380 pub fn set_merge_option<T: Into<crate::model::import_intents_request::MergeOption>>(
10382 mut self,
10383 v: T,
10384 ) -> Self {
10385 self.0.request.merge_option = v.into();
10386 self
10387 }
10388
10389 pub fn set_intents<T: Into<Option<crate::model::import_intents_request::Intents>>>(
10394 mut self,
10395 v: T,
10396 ) -> Self {
10397 self.0.request.intents = v.into();
10398 self
10399 }
10400
10401 pub fn set_intents_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10407 self.0.request = self.0.request.set_intents_uri(v);
10408 self
10409 }
10410
10411 pub fn set_intents_content<
10417 T: std::convert::Into<std::boxed::Box<crate::model::InlineSource>>,
10418 >(
10419 mut self,
10420 v: T,
10421 ) -> Self {
10422 self.0.request = self.0.request.set_intents_content(v);
10423 self
10424 }
10425 }
10426
10427 #[doc(hidden)]
10428 impl crate::RequestBuilder for ImportIntents {
10429 fn request_options(&mut self) -> &mut crate::RequestOptions {
10430 &mut self.0.options
10431 }
10432 }
10433
10434 #[derive(Clone, Debug)]
10452 pub struct ExportIntents(RequestBuilder<crate::model::ExportIntentsRequest>);
10453
10454 impl ExportIntents {
10455 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10456 Self(RequestBuilder::new(stub))
10457 }
10458
10459 pub fn with_request<V: Into<crate::model::ExportIntentsRequest>>(mut self, v: V) -> Self {
10461 self.0.request = v.into();
10462 self
10463 }
10464
10465 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10467 self.0.options = v.into();
10468 self
10469 }
10470
10471 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10478 (*self.0.stub)
10479 .export_intents(self.0.request, self.0.options)
10480 .await
10481 .map(crate::Response::into_body)
10482 }
10483
10484 pub fn poller(
10486 self,
10487 ) -> impl google_cloud_lro::Poller<
10488 crate::model::ExportIntentsResponse,
10489 crate::model::ExportIntentsMetadata,
10490 > {
10491 type Operation = google_cloud_lro::internal::Operation<
10492 crate::model::ExportIntentsResponse,
10493 crate::model::ExportIntentsMetadata,
10494 >;
10495 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10496 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10497
10498 let stub = self.0.stub.clone();
10499 let mut options = self.0.options.clone();
10500 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10501 let query = move |name| {
10502 let stub = stub.clone();
10503 let options = options.clone();
10504 async {
10505 let op = GetOperation::new(stub)
10506 .set_name(name)
10507 .with_options(options)
10508 .send()
10509 .await?;
10510 Ok(Operation::new(op))
10511 }
10512 };
10513
10514 let start = move || async {
10515 let op = self.send().await?;
10516 Ok(Operation::new(op))
10517 };
10518
10519 google_cloud_lro::internal::new_poller(
10520 polling_error_policy,
10521 polling_backoff_policy,
10522 start,
10523 query,
10524 )
10525 }
10526
10527 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10531 self.0.request.parent = v.into();
10532 self
10533 }
10534
10535 pub fn set_intents<T, V>(mut self, v: T) -> Self
10539 where
10540 T: std::iter::IntoIterator<Item = V>,
10541 V: std::convert::Into<std::string::String>,
10542 {
10543 use std::iter::Iterator;
10544 self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
10545 self
10546 }
10547
10548 pub fn set_data_format<T: Into<crate::model::export_intents_request::DataFormat>>(
10550 mut self,
10551 v: T,
10552 ) -> Self {
10553 self.0.request.data_format = v.into();
10554 self
10555 }
10556
10557 pub fn set_destination<
10562 T: Into<Option<crate::model::export_intents_request::Destination>>,
10563 >(
10564 mut self,
10565 v: T,
10566 ) -> Self {
10567 self.0.request.destination = v.into();
10568 self
10569 }
10570
10571 pub fn set_intents_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
10577 self.0.request = self.0.request.set_intents_uri(v);
10578 self
10579 }
10580
10581 pub fn set_intents_content_inline<T: std::convert::Into<bool>>(mut self, v: T) -> Self {
10587 self.0.request = self.0.request.set_intents_content_inline(v);
10588 self
10589 }
10590 }
10591
10592 #[doc(hidden)]
10593 impl crate::RequestBuilder for ExportIntents {
10594 fn request_options(&mut self) -> &mut crate::RequestOptions {
10595 &mut self.0.options
10596 }
10597 }
10598
10599 #[derive(Clone, Debug)]
10620 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10621
10622 impl ListLocations {
10623 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10624 Self(RequestBuilder::new(stub))
10625 }
10626
10627 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10629 mut self,
10630 v: V,
10631 ) -> Self {
10632 self.0.request = v.into();
10633 self
10634 }
10635
10636 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10638 self.0.options = v.into();
10639 self
10640 }
10641
10642 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10644 (*self.0.stub)
10645 .list_locations(self.0.request, self.0.options)
10646 .await
10647 .map(crate::Response::into_body)
10648 }
10649
10650 pub fn by_page(
10652 self,
10653 ) -> impl google_cloud_gax::paginator::Paginator<
10654 google_cloud_location::model::ListLocationsResponse,
10655 crate::Error,
10656 > {
10657 use std::clone::Clone;
10658 let token = self.0.request.page_token.clone();
10659 let execute = move |token: String| {
10660 let mut builder = self.clone();
10661 builder.0.request = builder.0.request.set_page_token(token);
10662 builder.send()
10663 };
10664 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10665 }
10666
10667 pub fn by_item(
10669 self,
10670 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10671 google_cloud_location::model::ListLocationsResponse,
10672 crate::Error,
10673 > {
10674 use google_cloud_gax::paginator::Paginator;
10675 self.by_page().items()
10676 }
10677
10678 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10680 self.0.request.name = v.into();
10681 self
10682 }
10683
10684 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10686 self.0.request.filter = v.into();
10687 self
10688 }
10689
10690 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10692 self.0.request.page_size = v.into();
10693 self
10694 }
10695
10696 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10698 self.0.request.page_token = v.into();
10699 self
10700 }
10701 }
10702
10703 #[doc(hidden)]
10704 impl crate::RequestBuilder for ListLocations {
10705 fn request_options(&mut self) -> &mut crate::RequestOptions {
10706 &mut self.0.options
10707 }
10708 }
10709
10710 #[derive(Clone, Debug)]
10727 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10728
10729 impl GetLocation {
10730 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10731 Self(RequestBuilder::new(stub))
10732 }
10733
10734 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10736 mut self,
10737 v: V,
10738 ) -> Self {
10739 self.0.request = v.into();
10740 self
10741 }
10742
10743 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10745 self.0.options = v.into();
10746 self
10747 }
10748
10749 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10751 (*self.0.stub)
10752 .get_location(self.0.request, self.0.options)
10753 .await
10754 .map(crate::Response::into_body)
10755 }
10756
10757 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10759 self.0.request.name = v.into();
10760 self
10761 }
10762 }
10763
10764 #[doc(hidden)]
10765 impl crate::RequestBuilder for GetLocation {
10766 fn request_options(&mut self) -> &mut crate::RequestOptions {
10767 &mut self.0.options
10768 }
10769 }
10770
10771 #[derive(Clone, Debug)]
10792 pub struct ListOperations(
10793 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10794 );
10795
10796 impl ListOperations {
10797 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10798 Self(RequestBuilder::new(stub))
10799 }
10800
10801 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10803 mut self,
10804 v: V,
10805 ) -> Self {
10806 self.0.request = v.into();
10807 self
10808 }
10809
10810 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10812 self.0.options = v.into();
10813 self
10814 }
10815
10816 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10818 (*self.0.stub)
10819 .list_operations(self.0.request, self.0.options)
10820 .await
10821 .map(crate::Response::into_body)
10822 }
10823
10824 pub fn by_page(
10826 self,
10827 ) -> impl google_cloud_gax::paginator::Paginator<
10828 google_cloud_longrunning::model::ListOperationsResponse,
10829 crate::Error,
10830 > {
10831 use std::clone::Clone;
10832 let token = self.0.request.page_token.clone();
10833 let execute = move |token: String| {
10834 let mut builder = self.clone();
10835 builder.0.request = builder.0.request.set_page_token(token);
10836 builder.send()
10837 };
10838 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10839 }
10840
10841 pub fn by_item(
10843 self,
10844 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10845 google_cloud_longrunning::model::ListOperationsResponse,
10846 crate::Error,
10847 > {
10848 use google_cloud_gax::paginator::Paginator;
10849 self.by_page().items()
10850 }
10851
10852 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10854 self.0.request.name = v.into();
10855 self
10856 }
10857
10858 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10860 self.0.request.filter = v.into();
10861 self
10862 }
10863
10864 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10866 self.0.request.page_size = v.into();
10867 self
10868 }
10869
10870 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10872 self.0.request.page_token = v.into();
10873 self
10874 }
10875
10876 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10878 self.0.request.return_partial_success = v.into();
10879 self
10880 }
10881 }
10882
10883 #[doc(hidden)]
10884 impl crate::RequestBuilder for ListOperations {
10885 fn request_options(&mut self) -> &mut crate::RequestOptions {
10886 &mut self.0.options
10887 }
10888 }
10889
10890 #[derive(Clone, Debug)]
10907 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10908
10909 impl GetOperation {
10910 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10911 Self(RequestBuilder::new(stub))
10912 }
10913
10914 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10916 mut self,
10917 v: V,
10918 ) -> Self {
10919 self.0.request = v.into();
10920 self
10921 }
10922
10923 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10925 self.0.options = v.into();
10926 self
10927 }
10928
10929 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10931 (*self.0.stub)
10932 .get_operation(self.0.request, self.0.options)
10933 .await
10934 .map(crate::Response::into_body)
10935 }
10936
10937 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10939 self.0.request.name = v.into();
10940 self
10941 }
10942 }
10943
10944 #[doc(hidden)]
10945 impl crate::RequestBuilder for GetOperation {
10946 fn request_options(&mut self) -> &mut crate::RequestOptions {
10947 &mut self.0.options
10948 }
10949 }
10950
10951 #[derive(Clone, Debug)]
10968 pub struct CancelOperation(
10969 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10970 );
10971
10972 impl CancelOperation {
10973 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
10974 Self(RequestBuilder::new(stub))
10975 }
10976
10977 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10979 mut self,
10980 v: V,
10981 ) -> Self {
10982 self.0.request = v.into();
10983 self
10984 }
10985
10986 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10988 self.0.options = v.into();
10989 self
10990 }
10991
10992 pub async fn send(self) -> Result<()> {
10994 (*self.0.stub)
10995 .cancel_operation(self.0.request, self.0.options)
10996 .await
10997 .map(crate::Response::into_body)
10998 }
10999
11000 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11002 self.0.request.name = v.into();
11003 self
11004 }
11005 }
11006
11007 #[doc(hidden)]
11008 impl crate::RequestBuilder for CancelOperation {
11009 fn request_options(&mut self) -> &mut crate::RequestOptions {
11010 &mut self.0.options
11011 }
11012 }
11013}
11014
11015#[cfg(feature = "pages")]
11017#[cfg_attr(docsrs, doc(cfg(feature = "pages")))]
11018pub mod pages {
11019 use crate::Result;
11020
11021 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11035
11036 pub(crate) mod client {
11037 use super::super::super::client::Pages;
11038 pub struct Factory;
11039 impl crate::ClientFactory for Factory {
11040 type Client = Pages;
11041 type Credentials = gaxi::options::Credentials;
11042 async fn build(
11043 self,
11044 config: gaxi::options::ClientConfig,
11045 ) -> crate::ClientBuilderResult<Self::Client> {
11046 Self::Client::new(config).await
11047 }
11048 }
11049 }
11050
11051 #[derive(Clone, Debug)]
11053 pub(crate) struct RequestBuilder<R: std::default::Default> {
11054 stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>,
11055 request: R,
11056 options: crate::RequestOptions,
11057 }
11058
11059 impl<R> RequestBuilder<R>
11060 where
11061 R: std::default::Default,
11062 {
11063 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11064 Self {
11065 stub,
11066 request: R::default(),
11067 options: crate::RequestOptions::default(),
11068 }
11069 }
11070 }
11071
11072 #[derive(Clone, Debug)]
11093 pub struct ListPages(RequestBuilder<crate::model::ListPagesRequest>);
11094
11095 impl ListPages {
11096 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11097 Self(RequestBuilder::new(stub))
11098 }
11099
11100 pub fn with_request<V: Into<crate::model::ListPagesRequest>>(mut self, v: V) -> Self {
11102 self.0.request = v.into();
11103 self
11104 }
11105
11106 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11108 self.0.options = v.into();
11109 self
11110 }
11111
11112 pub async fn send(self) -> Result<crate::model::ListPagesResponse> {
11114 (*self.0.stub)
11115 .list_pages(self.0.request, self.0.options)
11116 .await
11117 .map(crate::Response::into_body)
11118 }
11119
11120 pub fn by_page(
11122 self,
11123 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPagesResponse, crate::Error>
11124 {
11125 use std::clone::Clone;
11126 let token = self.0.request.page_token.clone();
11127 let execute = move |token: String| {
11128 let mut builder = self.clone();
11129 builder.0.request = builder.0.request.set_page_token(token);
11130 builder.send()
11131 };
11132 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11133 }
11134
11135 pub fn by_item(
11137 self,
11138 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListPagesResponse, crate::Error>
11139 {
11140 use google_cloud_gax::paginator::Paginator;
11141 self.by_page().items()
11142 }
11143
11144 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11148 self.0.request.parent = v.into();
11149 self
11150 }
11151
11152 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11154 self.0.request.language_code = v.into();
11155 self
11156 }
11157
11158 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11160 self.0.request.page_size = v.into();
11161 self
11162 }
11163
11164 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11166 self.0.request.page_token = v.into();
11167 self
11168 }
11169 }
11170
11171 #[doc(hidden)]
11172 impl crate::RequestBuilder for ListPages {
11173 fn request_options(&mut self) -> &mut crate::RequestOptions {
11174 &mut self.0.options
11175 }
11176 }
11177
11178 #[derive(Clone, Debug)]
11195 pub struct GetPage(RequestBuilder<crate::model::GetPageRequest>);
11196
11197 impl GetPage {
11198 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11199 Self(RequestBuilder::new(stub))
11200 }
11201
11202 pub fn with_request<V: Into<crate::model::GetPageRequest>>(mut self, v: V) -> Self {
11204 self.0.request = v.into();
11205 self
11206 }
11207
11208 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11210 self.0.options = v.into();
11211 self
11212 }
11213
11214 pub async fn send(self) -> Result<crate::model::Page> {
11216 (*self.0.stub)
11217 .get_page(self.0.request, self.0.options)
11218 .await
11219 .map(crate::Response::into_body)
11220 }
11221
11222 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11226 self.0.request.name = v.into();
11227 self
11228 }
11229
11230 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11232 self.0.request.language_code = v.into();
11233 self
11234 }
11235 }
11236
11237 #[doc(hidden)]
11238 impl crate::RequestBuilder for GetPage {
11239 fn request_options(&mut self) -> &mut crate::RequestOptions {
11240 &mut self.0.options
11241 }
11242 }
11243
11244 #[derive(Clone, Debug)]
11261 pub struct CreatePage(RequestBuilder<crate::model::CreatePageRequest>);
11262
11263 impl CreatePage {
11264 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11265 Self(RequestBuilder::new(stub))
11266 }
11267
11268 pub fn with_request<V: Into<crate::model::CreatePageRequest>>(mut self, v: V) -> Self {
11270 self.0.request = v.into();
11271 self
11272 }
11273
11274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11276 self.0.options = v.into();
11277 self
11278 }
11279
11280 pub async fn send(self) -> Result<crate::model::Page> {
11282 (*self.0.stub)
11283 .create_page(self.0.request, self.0.options)
11284 .await
11285 .map(crate::Response::into_body)
11286 }
11287
11288 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11292 self.0.request.parent = v.into();
11293 self
11294 }
11295
11296 pub fn set_page<T>(mut self, v: T) -> Self
11300 where
11301 T: std::convert::Into<crate::model::Page>,
11302 {
11303 self.0.request.page = std::option::Option::Some(v.into());
11304 self
11305 }
11306
11307 pub fn set_or_clear_page<T>(mut self, v: std::option::Option<T>) -> Self
11311 where
11312 T: std::convert::Into<crate::model::Page>,
11313 {
11314 self.0.request.page = v.map(|x| x.into());
11315 self
11316 }
11317
11318 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11320 self.0.request.language_code = v.into();
11321 self
11322 }
11323 }
11324
11325 #[doc(hidden)]
11326 impl crate::RequestBuilder for CreatePage {
11327 fn request_options(&mut self) -> &mut crate::RequestOptions {
11328 &mut self.0.options
11329 }
11330 }
11331
11332 #[derive(Clone, Debug)]
11349 pub struct UpdatePage(RequestBuilder<crate::model::UpdatePageRequest>);
11350
11351 impl UpdatePage {
11352 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11353 Self(RequestBuilder::new(stub))
11354 }
11355
11356 pub fn with_request<V: Into<crate::model::UpdatePageRequest>>(mut self, v: V) -> Self {
11358 self.0.request = v.into();
11359 self
11360 }
11361
11362 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11364 self.0.options = v.into();
11365 self
11366 }
11367
11368 pub async fn send(self) -> Result<crate::model::Page> {
11370 (*self.0.stub)
11371 .update_page(self.0.request, self.0.options)
11372 .await
11373 .map(crate::Response::into_body)
11374 }
11375
11376 pub fn set_page<T>(mut self, v: T) -> Self
11380 where
11381 T: std::convert::Into<crate::model::Page>,
11382 {
11383 self.0.request.page = std::option::Option::Some(v.into());
11384 self
11385 }
11386
11387 pub fn set_or_clear_page<T>(mut self, v: std::option::Option<T>) -> Self
11391 where
11392 T: std::convert::Into<crate::model::Page>,
11393 {
11394 self.0.request.page = v.map(|x| x.into());
11395 self
11396 }
11397
11398 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11400 self.0.request.language_code = v.into();
11401 self
11402 }
11403
11404 pub fn set_update_mask<T>(mut self, v: T) -> Self
11406 where
11407 T: std::convert::Into<wkt::FieldMask>,
11408 {
11409 self.0.request.update_mask = std::option::Option::Some(v.into());
11410 self
11411 }
11412
11413 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11415 where
11416 T: std::convert::Into<wkt::FieldMask>,
11417 {
11418 self.0.request.update_mask = v.map(|x| x.into());
11419 self
11420 }
11421 }
11422
11423 #[doc(hidden)]
11424 impl crate::RequestBuilder for UpdatePage {
11425 fn request_options(&mut self) -> &mut crate::RequestOptions {
11426 &mut self.0.options
11427 }
11428 }
11429
11430 #[derive(Clone, Debug)]
11447 pub struct DeletePage(RequestBuilder<crate::model::DeletePageRequest>);
11448
11449 impl DeletePage {
11450 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11451 Self(RequestBuilder::new(stub))
11452 }
11453
11454 pub fn with_request<V: Into<crate::model::DeletePageRequest>>(mut self, v: V) -> Self {
11456 self.0.request = v.into();
11457 self
11458 }
11459
11460 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11462 self.0.options = v.into();
11463 self
11464 }
11465
11466 pub async fn send(self) -> Result<()> {
11468 (*self.0.stub)
11469 .delete_page(self.0.request, self.0.options)
11470 .await
11471 .map(crate::Response::into_body)
11472 }
11473
11474 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11478 self.0.request.name = v.into();
11479 self
11480 }
11481
11482 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
11484 self.0.request.force = v.into();
11485 self
11486 }
11487 }
11488
11489 #[doc(hidden)]
11490 impl crate::RequestBuilder for DeletePage {
11491 fn request_options(&mut self) -> &mut crate::RequestOptions {
11492 &mut self.0.options
11493 }
11494 }
11495
11496 #[derive(Clone, Debug)]
11517 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
11518
11519 impl ListLocations {
11520 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11521 Self(RequestBuilder::new(stub))
11522 }
11523
11524 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
11526 mut self,
11527 v: V,
11528 ) -> Self {
11529 self.0.request = v.into();
11530 self
11531 }
11532
11533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11535 self.0.options = v.into();
11536 self
11537 }
11538
11539 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
11541 (*self.0.stub)
11542 .list_locations(self.0.request, self.0.options)
11543 .await
11544 .map(crate::Response::into_body)
11545 }
11546
11547 pub fn by_page(
11549 self,
11550 ) -> impl google_cloud_gax::paginator::Paginator<
11551 google_cloud_location::model::ListLocationsResponse,
11552 crate::Error,
11553 > {
11554 use std::clone::Clone;
11555 let token = self.0.request.page_token.clone();
11556 let execute = move |token: String| {
11557 let mut builder = self.clone();
11558 builder.0.request = builder.0.request.set_page_token(token);
11559 builder.send()
11560 };
11561 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11562 }
11563
11564 pub fn by_item(
11566 self,
11567 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11568 google_cloud_location::model::ListLocationsResponse,
11569 crate::Error,
11570 > {
11571 use google_cloud_gax::paginator::Paginator;
11572 self.by_page().items()
11573 }
11574
11575 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11577 self.0.request.name = v.into();
11578 self
11579 }
11580
11581 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11583 self.0.request.filter = v.into();
11584 self
11585 }
11586
11587 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11589 self.0.request.page_size = v.into();
11590 self
11591 }
11592
11593 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11595 self.0.request.page_token = v.into();
11596 self
11597 }
11598 }
11599
11600 #[doc(hidden)]
11601 impl crate::RequestBuilder for ListLocations {
11602 fn request_options(&mut self) -> &mut crate::RequestOptions {
11603 &mut self.0.options
11604 }
11605 }
11606
11607 #[derive(Clone, Debug)]
11624 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
11625
11626 impl GetLocation {
11627 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11628 Self(RequestBuilder::new(stub))
11629 }
11630
11631 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
11633 mut self,
11634 v: V,
11635 ) -> Self {
11636 self.0.request = v.into();
11637 self
11638 }
11639
11640 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11642 self.0.options = v.into();
11643 self
11644 }
11645
11646 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
11648 (*self.0.stub)
11649 .get_location(self.0.request, self.0.options)
11650 .await
11651 .map(crate::Response::into_body)
11652 }
11653
11654 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11656 self.0.request.name = v.into();
11657 self
11658 }
11659 }
11660
11661 #[doc(hidden)]
11662 impl crate::RequestBuilder for GetLocation {
11663 fn request_options(&mut self) -> &mut crate::RequestOptions {
11664 &mut self.0.options
11665 }
11666 }
11667
11668 #[derive(Clone, Debug)]
11689 pub struct ListOperations(
11690 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
11691 );
11692
11693 impl ListOperations {
11694 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11695 Self(RequestBuilder::new(stub))
11696 }
11697
11698 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
11700 mut self,
11701 v: V,
11702 ) -> Self {
11703 self.0.request = v.into();
11704 self
11705 }
11706
11707 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11709 self.0.options = v.into();
11710 self
11711 }
11712
11713 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
11715 (*self.0.stub)
11716 .list_operations(self.0.request, self.0.options)
11717 .await
11718 .map(crate::Response::into_body)
11719 }
11720
11721 pub fn by_page(
11723 self,
11724 ) -> impl google_cloud_gax::paginator::Paginator<
11725 google_cloud_longrunning::model::ListOperationsResponse,
11726 crate::Error,
11727 > {
11728 use std::clone::Clone;
11729 let token = self.0.request.page_token.clone();
11730 let execute = move |token: String| {
11731 let mut builder = self.clone();
11732 builder.0.request = builder.0.request.set_page_token(token);
11733 builder.send()
11734 };
11735 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11736 }
11737
11738 pub fn by_item(
11740 self,
11741 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11742 google_cloud_longrunning::model::ListOperationsResponse,
11743 crate::Error,
11744 > {
11745 use google_cloud_gax::paginator::Paginator;
11746 self.by_page().items()
11747 }
11748
11749 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11751 self.0.request.name = v.into();
11752 self
11753 }
11754
11755 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
11757 self.0.request.filter = v.into();
11758 self
11759 }
11760
11761 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
11763 self.0.request.page_size = v.into();
11764 self
11765 }
11766
11767 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
11769 self.0.request.page_token = v.into();
11770 self
11771 }
11772
11773 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
11775 self.0.request.return_partial_success = v.into();
11776 self
11777 }
11778 }
11779
11780 #[doc(hidden)]
11781 impl crate::RequestBuilder for ListOperations {
11782 fn request_options(&mut self) -> &mut crate::RequestOptions {
11783 &mut self.0.options
11784 }
11785 }
11786
11787 #[derive(Clone, Debug)]
11804 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
11805
11806 impl GetOperation {
11807 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11808 Self(RequestBuilder::new(stub))
11809 }
11810
11811 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
11813 mut self,
11814 v: V,
11815 ) -> Self {
11816 self.0.request = v.into();
11817 self
11818 }
11819
11820 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11822 self.0.options = v.into();
11823 self
11824 }
11825
11826 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11828 (*self.0.stub)
11829 .get_operation(self.0.request, self.0.options)
11830 .await
11831 .map(crate::Response::into_body)
11832 }
11833
11834 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11836 self.0.request.name = v.into();
11837 self
11838 }
11839 }
11840
11841 #[doc(hidden)]
11842 impl crate::RequestBuilder for GetOperation {
11843 fn request_options(&mut self) -> &mut crate::RequestOptions {
11844 &mut self.0.options
11845 }
11846 }
11847
11848 #[derive(Clone, Debug)]
11865 pub struct CancelOperation(
11866 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
11867 );
11868
11869 impl CancelOperation {
11870 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Pages>) -> Self {
11871 Self(RequestBuilder::new(stub))
11872 }
11873
11874 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
11876 mut self,
11877 v: V,
11878 ) -> Self {
11879 self.0.request = v.into();
11880 self
11881 }
11882
11883 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11885 self.0.options = v.into();
11886 self
11887 }
11888
11889 pub async fn send(self) -> Result<()> {
11891 (*self.0.stub)
11892 .cancel_operation(self.0.request, self.0.options)
11893 .await
11894 .map(crate::Response::into_body)
11895 }
11896
11897 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11899 self.0.request.name = v.into();
11900 self
11901 }
11902 }
11903
11904 #[doc(hidden)]
11905 impl crate::RequestBuilder for CancelOperation {
11906 fn request_options(&mut self) -> &mut crate::RequestOptions {
11907 &mut self.0.options
11908 }
11909 }
11910}
11911
11912#[cfg(feature = "playbooks")]
11914#[cfg_attr(docsrs, doc(cfg(feature = "playbooks")))]
11915pub mod playbooks {
11916 use crate::Result;
11917
11918 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
11932
11933 pub(crate) mod client {
11934 use super::super::super::client::Playbooks;
11935 pub struct Factory;
11936 impl crate::ClientFactory for Factory {
11937 type Client = Playbooks;
11938 type Credentials = gaxi::options::Credentials;
11939 async fn build(
11940 self,
11941 config: gaxi::options::ClientConfig,
11942 ) -> crate::ClientBuilderResult<Self::Client> {
11943 Self::Client::new(config).await
11944 }
11945 }
11946 }
11947
11948 #[derive(Clone, Debug)]
11950 pub(crate) struct RequestBuilder<R: std::default::Default> {
11951 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
11952 request: R,
11953 options: crate::RequestOptions,
11954 }
11955
11956 impl<R> RequestBuilder<R>
11957 where
11958 R: std::default::Default,
11959 {
11960 pub(crate) fn new(
11961 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
11962 ) -> Self {
11963 Self {
11964 stub,
11965 request: R::default(),
11966 options: crate::RequestOptions::default(),
11967 }
11968 }
11969 }
11970
11971 #[derive(Clone, Debug)]
11988 pub struct CreatePlaybook(RequestBuilder<crate::model::CreatePlaybookRequest>);
11989
11990 impl CreatePlaybook {
11991 pub(crate) fn new(
11992 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
11993 ) -> Self {
11994 Self(RequestBuilder::new(stub))
11995 }
11996
11997 pub fn with_request<V: Into<crate::model::CreatePlaybookRequest>>(mut self, v: V) -> Self {
11999 self.0.request = v.into();
12000 self
12001 }
12002
12003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12005 self.0.options = v.into();
12006 self
12007 }
12008
12009 pub async fn send(self) -> Result<crate::model::Playbook> {
12011 (*self.0.stub)
12012 .create_playbook(self.0.request, self.0.options)
12013 .await
12014 .map(crate::Response::into_body)
12015 }
12016
12017 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12021 self.0.request.parent = v.into();
12022 self
12023 }
12024
12025 pub fn set_playbook<T>(mut self, v: T) -> Self
12029 where
12030 T: std::convert::Into<crate::model::Playbook>,
12031 {
12032 self.0.request.playbook = std::option::Option::Some(v.into());
12033 self
12034 }
12035
12036 pub fn set_or_clear_playbook<T>(mut self, v: std::option::Option<T>) -> Self
12040 where
12041 T: std::convert::Into<crate::model::Playbook>,
12042 {
12043 self.0.request.playbook = v.map(|x| x.into());
12044 self
12045 }
12046 }
12047
12048 #[doc(hidden)]
12049 impl crate::RequestBuilder for CreatePlaybook {
12050 fn request_options(&mut self) -> &mut crate::RequestOptions {
12051 &mut self.0.options
12052 }
12053 }
12054
12055 #[derive(Clone, Debug)]
12072 pub struct DeletePlaybook(RequestBuilder<crate::model::DeletePlaybookRequest>);
12073
12074 impl DeletePlaybook {
12075 pub(crate) fn new(
12076 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12077 ) -> Self {
12078 Self(RequestBuilder::new(stub))
12079 }
12080
12081 pub fn with_request<V: Into<crate::model::DeletePlaybookRequest>>(mut self, v: V) -> Self {
12083 self.0.request = v.into();
12084 self
12085 }
12086
12087 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12089 self.0.options = v.into();
12090 self
12091 }
12092
12093 pub async fn send(self) -> Result<()> {
12095 (*self.0.stub)
12096 .delete_playbook(self.0.request, self.0.options)
12097 .await
12098 .map(crate::Response::into_body)
12099 }
12100
12101 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12105 self.0.request.name = v.into();
12106 self
12107 }
12108 }
12109
12110 #[doc(hidden)]
12111 impl crate::RequestBuilder for DeletePlaybook {
12112 fn request_options(&mut self) -> &mut crate::RequestOptions {
12113 &mut self.0.options
12114 }
12115 }
12116
12117 #[derive(Clone, Debug)]
12138 pub struct ListPlaybooks(RequestBuilder<crate::model::ListPlaybooksRequest>);
12139
12140 impl ListPlaybooks {
12141 pub(crate) fn new(
12142 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12143 ) -> Self {
12144 Self(RequestBuilder::new(stub))
12145 }
12146
12147 pub fn with_request<V: Into<crate::model::ListPlaybooksRequest>>(mut self, v: V) -> Self {
12149 self.0.request = v.into();
12150 self
12151 }
12152
12153 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12155 self.0.options = v.into();
12156 self
12157 }
12158
12159 pub async fn send(self) -> Result<crate::model::ListPlaybooksResponse> {
12161 (*self.0.stub)
12162 .list_playbooks(self.0.request, self.0.options)
12163 .await
12164 .map(crate::Response::into_body)
12165 }
12166
12167 pub fn by_page(
12169 self,
12170 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListPlaybooksResponse, crate::Error>
12171 {
12172 use std::clone::Clone;
12173 let token = self.0.request.page_token.clone();
12174 let execute = move |token: String| {
12175 let mut builder = self.clone();
12176 builder.0.request = builder.0.request.set_page_token(token);
12177 builder.send()
12178 };
12179 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12180 }
12181
12182 pub fn by_item(
12184 self,
12185 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12186 crate::model::ListPlaybooksResponse,
12187 crate::Error,
12188 > {
12189 use google_cloud_gax::paginator::Paginator;
12190 self.by_page().items()
12191 }
12192
12193 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12197 self.0.request.parent = v.into();
12198 self
12199 }
12200
12201 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12203 self.0.request.page_size = v.into();
12204 self
12205 }
12206
12207 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12209 self.0.request.page_token = v.into();
12210 self
12211 }
12212 }
12213
12214 #[doc(hidden)]
12215 impl crate::RequestBuilder for ListPlaybooks {
12216 fn request_options(&mut self) -> &mut crate::RequestOptions {
12217 &mut self.0.options
12218 }
12219 }
12220
12221 #[derive(Clone, Debug)]
12238 pub struct GetPlaybook(RequestBuilder<crate::model::GetPlaybookRequest>);
12239
12240 impl GetPlaybook {
12241 pub(crate) fn new(
12242 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12243 ) -> Self {
12244 Self(RequestBuilder::new(stub))
12245 }
12246
12247 pub fn with_request<V: Into<crate::model::GetPlaybookRequest>>(mut self, v: V) -> Self {
12249 self.0.request = v.into();
12250 self
12251 }
12252
12253 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12255 self.0.options = v.into();
12256 self
12257 }
12258
12259 pub async fn send(self) -> Result<crate::model::Playbook> {
12261 (*self.0.stub)
12262 .get_playbook(self.0.request, self.0.options)
12263 .await
12264 .map(crate::Response::into_body)
12265 }
12266
12267 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12271 self.0.request.name = v.into();
12272 self
12273 }
12274 }
12275
12276 #[doc(hidden)]
12277 impl crate::RequestBuilder for GetPlaybook {
12278 fn request_options(&mut self) -> &mut crate::RequestOptions {
12279 &mut self.0.options
12280 }
12281 }
12282
12283 #[derive(Clone, Debug)]
12301 pub struct ExportPlaybook(RequestBuilder<crate::model::ExportPlaybookRequest>);
12302
12303 impl ExportPlaybook {
12304 pub(crate) fn new(
12305 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12306 ) -> Self {
12307 Self(RequestBuilder::new(stub))
12308 }
12309
12310 pub fn with_request<V: Into<crate::model::ExportPlaybookRequest>>(mut self, v: V) -> Self {
12312 self.0.request = v.into();
12313 self
12314 }
12315
12316 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12318 self.0.options = v.into();
12319 self
12320 }
12321
12322 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12329 (*self.0.stub)
12330 .export_playbook(self.0.request, self.0.options)
12331 .await
12332 .map(crate::Response::into_body)
12333 }
12334
12335 pub fn poller(
12337 self,
12338 ) -> impl google_cloud_lro::Poller<crate::model::ExportPlaybookResponse, wkt::Struct>
12339 {
12340 type Operation = google_cloud_lro::internal::Operation<
12341 crate::model::ExportPlaybookResponse,
12342 wkt::Struct,
12343 >;
12344 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12345 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12346
12347 let stub = self.0.stub.clone();
12348 let mut options = self.0.options.clone();
12349 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12350 let query = move |name| {
12351 let stub = stub.clone();
12352 let options = options.clone();
12353 async {
12354 let op = GetOperation::new(stub)
12355 .set_name(name)
12356 .with_options(options)
12357 .send()
12358 .await?;
12359 Ok(Operation::new(op))
12360 }
12361 };
12362
12363 let start = move || async {
12364 let op = self.send().await?;
12365 Ok(Operation::new(op))
12366 };
12367
12368 google_cloud_lro::internal::new_poller(
12369 polling_error_policy,
12370 polling_backoff_policy,
12371 start,
12372 query,
12373 )
12374 }
12375
12376 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12380 self.0.request.name = v.into();
12381 self
12382 }
12383
12384 pub fn set_playbook_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
12386 self.0.request.playbook_uri = v.into();
12387 self
12388 }
12389
12390 pub fn set_data_format<T: Into<crate::model::export_playbook_request::DataFormat>>(
12392 mut self,
12393 v: T,
12394 ) -> Self {
12395 self.0.request.data_format = v.into();
12396 self
12397 }
12398 }
12399
12400 #[doc(hidden)]
12401 impl crate::RequestBuilder for ExportPlaybook {
12402 fn request_options(&mut self) -> &mut crate::RequestOptions {
12403 &mut self.0.options
12404 }
12405 }
12406
12407 #[derive(Clone, Debug)]
12425 pub struct ImportPlaybook(RequestBuilder<crate::model::ImportPlaybookRequest>);
12426
12427 impl ImportPlaybook {
12428 pub(crate) fn new(
12429 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12430 ) -> Self {
12431 Self(RequestBuilder::new(stub))
12432 }
12433
12434 pub fn with_request<V: Into<crate::model::ImportPlaybookRequest>>(mut self, v: V) -> Self {
12436 self.0.request = v.into();
12437 self
12438 }
12439
12440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12442 self.0.options = v.into();
12443 self
12444 }
12445
12446 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12453 (*self.0.stub)
12454 .import_playbook(self.0.request, self.0.options)
12455 .await
12456 .map(crate::Response::into_body)
12457 }
12458
12459 pub fn poller(
12461 self,
12462 ) -> impl google_cloud_lro::Poller<crate::model::ImportPlaybookResponse, wkt::Struct>
12463 {
12464 type Operation = google_cloud_lro::internal::Operation<
12465 crate::model::ImportPlaybookResponse,
12466 wkt::Struct,
12467 >;
12468 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
12469 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
12470
12471 let stub = self.0.stub.clone();
12472 let mut options = self.0.options.clone();
12473 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
12474 let query = move |name| {
12475 let stub = stub.clone();
12476 let options = options.clone();
12477 async {
12478 let op = GetOperation::new(stub)
12479 .set_name(name)
12480 .with_options(options)
12481 .send()
12482 .await?;
12483 Ok(Operation::new(op))
12484 }
12485 };
12486
12487 let start = move || async {
12488 let op = self.send().await?;
12489 Ok(Operation::new(op))
12490 };
12491
12492 google_cloud_lro::internal::new_poller(
12493 polling_error_policy,
12494 polling_backoff_policy,
12495 start,
12496 query,
12497 )
12498 }
12499
12500 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12504 self.0.request.parent = v.into();
12505 self
12506 }
12507
12508 pub fn set_import_strategy<T>(mut self, v: T) -> Self
12510 where
12511 T: std::convert::Into<crate::model::PlaybookImportStrategy>,
12512 {
12513 self.0.request.import_strategy = std::option::Option::Some(v.into());
12514 self
12515 }
12516
12517 pub fn set_or_clear_import_strategy<T>(mut self, v: std::option::Option<T>) -> Self
12519 where
12520 T: std::convert::Into<crate::model::PlaybookImportStrategy>,
12521 {
12522 self.0.request.import_strategy = v.map(|x| x.into());
12523 self
12524 }
12525
12526 pub fn set_playbook<T: Into<Option<crate::model::import_playbook_request::Playbook>>>(
12531 mut self,
12532 v: T,
12533 ) -> Self {
12534 self.0.request.playbook = v.into();
12535 self
12536 }
12537
12538 pub fn set_playbook_uri<T: std::convert::Into<std::string::String>>(
12544 mut self,
12545 v: T,
12546 ) -> Self {
12547 self.0.request = self.0.request.set_playbook_uri(v);
12548 self
12549 }
12550
12551 pub fn set_playbook_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
12557 self.0.request = self.0.request.set_playbook_content(v);
12558 self
12559 }
12560 }
12561
12562 #[doc(hidden)]
12563 impl crate::RequestBuilder for ImportPlaybook {
12564 fn request_options(&mut self) -> &mut crate::RequestOptions {
12565 &mut self.0.options
12566 }
12567 }
12568
12569 #[derive(Clone, Debug)]
12586 pub struct UpdatePlaybook(RequestBuilder<crate::model::UpdatePlaybookRequest>);
12587
12588 impl UpdatePlaybook {
12589 pub(crate) fn new(
12590 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12591 ) -> Self {
12592 Self(RequestBuilder::new(stub))
12593 }
12594
12595 pub fn with_request<V: Into<crate::model::UpdatePlaybookRequest>>(mut self, v: V) -> Self {
12597 self.0.request = v.into();
12598 self
12599 }
12600
12601 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12603 self.0.options = v.into();
12604 self
12605 }
12606
12607 pub async fn send(self) -> Result<crate::model::Playbook> {
12609 (*self.0.stub)
12610 .update_playbook(self.0.request, self.0.options)
12611 .await
12612 .map(crate::Response::into_body)
12613 }
12614
12615 pub fn set_playbook<T>(mut self, v: T) -> Self
12619 where
12620 T: std::convert::Into<crate::model::Playbook>,
12621 {
12622 self.0.request.playbook = std::option::Option::Some(v.into());
12623 self
12624 }
12625
12626 pub fn set_or_clear_playbook<T>(mut self, v: std::option::Option<T>) -> Self
12630 where
12631 T: std::convert::Into<crate::model::Playbook>,
12632 {
12633 self.0.request.playbook = v.map(|x| x.into());
12634 self
12635 }
12636
12637 pub fn set_update_mask<T>(mut self, v: T) -> Self
12639 where
12640 T: std::convert::Into<wkt::FieldMask>,
12641 {
12642 self.0.request.update_mask = std::option::Option::Some(v.into());
12643 self
12644 }
12645
12646 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12648 where
12649 T: std::convert::Into<wkt::FieldMask>,
12650 {
12651 self.0.request.update_mask = v.map(|x| x.into());
12652 self
12653 }
12654 }
12655
12656 #[doc(hidden)]
12657 impl crate::RequestBuilder for UpdatePlaybook {
12658 fn request_options(&mut self) -> &mut crate::RequestOptions {
12659 &mut self.0.options
12660 }
12661 }
12662
12663 #[derive(Clone, Debug)]
12680 pub struct CreatePlaybookVersion(RequestBuilder<crate::model::CreatePlaybookVersionRequest>);
12681
12682 impl CreatePlaybookVersion {
12683 pub(crate) fn new(
12684 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12685 ) -> Self {
12686 Self(RequestBuilder::new(stub))
12687 }
12688
12689 pub fn with_request<V: Into<crate::model::CreatePlaybookVersionRequest>>(
12691 mut self,
12692 v: V,
12693 ) -> Self {
12694 self.0.request = v.into();
12695 self
12696 }
12697
12698 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12700 self.0.options = v.into();
12701 self
12702 }
12703
12704 pub async fn send(self) -> Result<crate::model::PlaybookVersion> {
12706 (*self.0.stub)
12707 .create_playbook_version(self.0.request, self.0.options)
12708 .await
12709 .map(crate::Response::into_body)
12710 }
12711
12712 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12716 self.0.request.parent = v.into();
12717 self
12718 }
12719
12720 pub fn set_playbook_version<T>(mut self, v: T) -> Self
12724 where
12725 T: std::convert::Into<crate::model::PlaybookVersion>,
12726 {
12727 self.0.request.playbook_version = std::option::Option::Some(v.into());
12728 self
12729 }
12730
12731 pub fn set_or_clear_playbook_version<T>(mut self, v: std::option::Option<T>) -> Self
12735 where
12736 T: std::convert::Into<crate::model::PlaybookVersion>,
12737 {
12738 self.0.request.playbook_version = v.map(|x| x.into());
12739 self
12740 }
12741 }
12742
12743 #[doc(hidden)]
12744 impl crate::RequestBuilder for CreatePlaybookVersion {
12745 fn request_options(&mut self) -> &mut crate::RequestOptions {
12746 &mut self.0.options
12747 }
12748 }
12749
12750 #[derive(Clone, Debug)]
12767 pub struct GetPlaybookVersion(RequestBuilder<crate::model::GetPlaybookVersionRequest>);
12768
12769 impl GetPlaybookVersion {
12770 pub(crate) fn new(
12771 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12772 ) -> Self {
12773 Self(RequestBuilder::new(stub))
12774 }
12775
12776 pub fn with_request<V: Into<crate::model::GetPlaybookVersionRequest>>(
12778 mut self,
12779 v: V,
12780 ) -> Self {
12781 self.0.request = v.into();
12782 self
12783 }
12784
12785 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12787 self.0.options = v.into();
12788 self
12789 }
12790
12791 pub async fn send(self) -> Result<crate::model::PlaybookVersion> {
12793 (*self.0.stub)
12794 .get_playbook_version(self.0.request, self.0.options)
12795 .await
12796 .map(crate::Response::into_body)
12797 }
12798
12799 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12803 self.0.request.name = v.into();
12804 self
12805 }
12806 }
12807
12808 #[doc(hidden)]
12809 impl crate::RequestBuilder for GetPlaybookVersion {
12810 fn request_options(&mut self) -> &mut crate::RequestOptions {
12811 &mut self.0.options
12812 }
12813 }
12814
12815 #[derive(Clone, Debug)]
12832 pub struct RestorePlaybookVersion(RequestBuilder<crate::model::RestorePlaybookVersionRequest>);
12833
12834 impl RestorePlaybookVersion {
12835 pub(crate) fn new(
12836 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12837 ) -> Self {
12838 Self(RequestBuilder::new(stub))
12839 }
12840
12841 pub fn with_request<V: Into<crate::model::RestorePlaybookVersionRequest>>(
12843 mut self,
12844 v: V,
12845 ) -> Self {
12846 self.0.request = v.into();
12847 self
12848 }
12849
12850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12852 self.0.options = v.into();
12853 self
12854 }
12855
12856 pub async fn send(self) -> Result<crate::model::RestorePlaybookVersionResponse> {
12858 (*self.0.stub)
12859 .restore_playbook_version(self.0.request, self.0.options)
12860 .await
12861 .map(crate::Response::into_body)
12862 }
12863
12864 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12868 self.0.request.name = v.into();
12869 self
12870 }
12871 }
12872
12873 #[doc(hidden)]
12874 impl crate::RequestBuilder for RestorePlaybookVersion {
12875 fn request_options(&mut self) -> &mut crate::RequestOptions {
12876 &mut self.0.options
12877 }
12878 }
12879
12880 #[derive(Clone, Debug)]
12901 pub struct ListPlaybookVersions(RequestBuilder<crate::model::ListPlaybookVersionsRequest>);
12902
12903 impl ListPlaybookVersions {
12904 pub(crate) fn new(
12905 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
12906 ) -> Self {
12907 Self(RequestBuilder::new(stub))
12908 }
12909
12910 pub fn with_request<V: Into<crate::model::ListPlaybookVersionsRequest>>(
12912 mut self,
12913 v: V,
12914 ) -> Self {
12915 self.0.request = v.into();
12916 self
12917 }
12918
12919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12921 self.0.options = v.into();
12922 self
12923 }
12924
12925 pub async fn send(self) -> Result<crate::model::ListPlaybookVersionsResponse> {
12927 (*self.0.stub)
12928 .list_playbook_versions(self.0.request, self.0.options)
12929 .await
12930 .map(crate::Response::into_body)
12931 }
12932
12933 pub fn by_page(
12935 self,
12936 ) -> impl google_cloud_gax::paginator::Paginator<
12937 crate::model::ListPlaybookVersionsResponse,
12938 crate::Error,
12939 > {
12940 use std::clone::Clone;
12941 let token = self.0.request.page_token.clone();
12942 let execute = move |token: String| {
12943 let mut builder = self.clone();
12944 builder.0.request = builder.0.request.set_page_token(token);
12945 builder.send()
12946 };
12947 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12948 }
12949
12950 pub fn by_item(
12952 self,
12953 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12954 crate::model::ListPlaybookVersionsResponse,
12955 crate::Error,
12956 > {
12957 use google_cloud_gax::paginator::Paginator;
12958 self.by_page().items()
12959 }
12960
12961 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12965 self.0.request.parent = v.into();
12966 self
12967 }
12968
12969 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12971 self.0.request.page_size = v.into();
12972 self
12973 }
12974
12975 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12977 self.0.request.page_token = v.into();
12978 self
12979 }
12980 }
12981
12982 #[doc(hidden)]
12983 impl crate::RequestBuilder for ListPlaybookVersions {
12984 fn request_options(&mut self) -> &mut crate::RequestOptions {
12985 &mut self.0.options
12986 }
12987 }
12988
12989 #[derive(Clone, Debug)]
13006 pub struct DeletePlaybookVersion(RequestBuilder<crate::model::DeletePlaybookVersionRequest>);
13007
13008 impl DeletePlaybookVersion {
13009 pub(crate) fn new(
13010 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13011 ) -> Self {
13012 Self(RequestBuilder::new(stub))
13013 }
13014
13015 pub fn with_request<V: Into<crate::model::DeletePlaybookVersionRequest>>(
13017 mut self,
13018 v: V,
13019 ) -> Self {
13020 self.0.request = v.into();
13021 self
13022 }
13023
13024 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13026 self.0.options = v.into();
13027 self
13028 }
13029
13030 pub async fn send(self) -> Result<()> {
13032 (*self.0.stub)
13033 .delete_playbook_version(self.0.request, self.0.options)
13034 .await
13035 .map(crate::Response::into_body)
13036 }
13037
13038 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13042 self.0.request.name = v.into();
13043 self
13044 }
13045 }
13046
13047 #[doc(hidden)]
13048 impl crate::RequestBuilder for DeletePlaybookVersion {
13049 fn request_options(&mut self) -> &mut crate::RequestOptions {
13050 &mut self.0.options
13051 }
13052 }
13053
13054 #[derive(Clone, Debug)]
13075 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13076
13077 impl ListLocations {
13078 pub(crate) fn new(
13079 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13080 ) -> Self {
13081 Self(RequestBuilder::new(stub))
13082 }
13083
13084 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13086 mut self,
13087 v: V,
13088 ) -> Self {
13089 self.0.request = v.into();
13090 self
13091 }
13092
13093 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13095 self.0.options = v.into();
13096 self
13097 }
13098
13099 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13101 (*self.0.stub)
13102 .list_locations(self.0.request, self.0.options)
13103 .await
13104 .map(crate::Response::into_body)
13105 }
13106
13107 pub fn by_page(
13109 self,
13110 ) -> impl google_cloud_gax::paginator::Paginator<
13111 google_cloud_location::model::ListLocationsResponse,
13112 crate::Error,
13113 > {
13114 use std::clone::Clone;
13115 let token = self.0.request.page_token.clone();
13116 let execute = move |token: String| {
13117 let mut builder = self.clone();
13118 builder.0.request = builder.0.request.set_page_token(token);
13119 builder.send()
13120 };
13121 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13122 }
13123
13124 pub fn by_item(
13126 self,
13127 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13128 google_cloud_location::model::ListLocationsResponse,
13129 crate::Error,
13130 > {
13131 use google_cloud_gax::paginator::Paginator;
13132 self.by_page().items()
13133 }
13134
13135 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13137 self.0.request.name = v.into();
13138 self
13139 }
13140
13141 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13143 self.0.request.filter = v.into();
13144 self
13145 }
13146
13147 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13149 self.0.request.page_size = v.into();
13150 self
13151 }
13152
13153 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13155 self.0.request.page_token = v.into();
13156 self
13157 }
13158 }
13159
13160 #[doc(hidden)]
13161 impl crate::RequestBuilder for ListLocations {
13162 fn request_options(&mut self) -> &mut crate::RequestOptions {
13163 &mut self.0.options
13164 }
13165 }
13166
13167 #[derive(Clone, Debug)]
13184 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13185
13186 impl GetLocation {
13187 pub(crate) fn new(
13188 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13189 ) -> Self {
13190 Self(RequestBuilder::new(stub))
13191 }
13192
13193 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13195 mut self,
13196 v: V,
13197 ) -> Self {
13198 self.0.request = v.into();
13199 self
13200 }
13201
13202 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13204 self.0.options = v.into();
13205 self
13206 }
13207
13208 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13210 (*self.0.stub)
13211 .get_location(self.0.request, self.0.options)
13212 .await
13213 .map(crate::Response::into_body)
13214 }
13215
13216 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13218 self.0.request.name = v.into();
13219 self
13220 }
13221 }
13222
13223 #[doc(hidden)]
13224 impl crate::RequestBuilder for GetLocation {
13225 fn request_options(&mut self) -> &mut crate::RequestOptions {
13226 &mut self.0.options
13227 }
13228 }
13229
13230 #[derive(Clone, Debug)]
13251 pub struct ListOperations(
13252 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13253 );
13254
13255 impl ListOperations {
13256 pub(crate) fn new(
13257 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13258 ) -> Self {
13259 Self(RequestBuilder::new(stub))
13260 }
13261
13262 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13264 mut self,
13265 v: V,
13266 ) -> Self {
13267 self.0.request = v.into();
13268 self
13269 }
13270
13271 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13273 self.0.options = v.into();
13274 self
13275 }
13276
13277 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13279 (*self.0.stub)
13280 .list_operations(self.0.request, self.0.options)
13281 .await
13282 .map(crate::Response::into_body)
13283 }
13284
13285 pub fn by_page(
13287 self,
13288 ) -> impl google_cloud_gax::paginator::Paginator<
13289 google_cloud_longrunning::model::ListOperationsResponse,
13290 crate::Error,
13291 > {
13292 use std::clone::Clone;
13293 let token = self.0.request.page_token.clone();
13294 let execute = move |token: String| {
13295 let mut builder = self.clone();
13296 builder.0.request = builder.0.request.set_page_token(token);
13297 builder.send()
13298 };
13299 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13300 }
13301
13302 pub fn by_item(
13304 self,
13305 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13306 google_cloud_longrunning::model::ListOperationsResponse,
13307 crate::Error,
13308 > {
13309 use google_cloud_gax::paginator::Paginator;
13310 self.by_page().items()
13311 }
13312
13313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13315 self.0.request.name = v.into();
13316 self
13317 }
13318
13319 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13321 self.0.request.filter = v.into();
13322 self
13323 }
13324
13325 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13327 self.0.request.page_size = v.into();
13328 self
13329 }
13330
13331 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13333 self.0.request.page_token = v.into();
13334 self
13335 }
13336
13337 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13339 self.0.request.return_partial_success = v.into();
13340 self
13341 }
13342 }
13343
13344 #[doc(hidden)]
13345 impl crate::RequestBuilder for ListOperations {
13346 fn request_options(&mut self) -> &mut crate::RequestOptions {
13347 &mut self.0.options
13348 }
13349 }
13350
13351 #[derive(Clone, Debug)]
13368 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13369
13370 impl GetOperation {
13371 pub(crate) fn new(
13372 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13373 ) -> Self {
13374 Self(RequestBuilder::new(stub))
13375 }
13376
13377 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13379 mut self,
13380 v: V,
13381 ) -> Self {
13382 self.0.request = v.into();
13383 self
13384 }
13385
13386 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13388 self.0.options = v.into();
13389 self
13390 }
13391
13392 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13394 (*self.0.stub)
13395 .get_operation(self.0.request, self.0.options)
13396 .await
13397 .map(crate::Response::into_body)
13398 }
13399
13400 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13402 self.0.request.name = v.into();
13403 self
13404 }
13405 }
13406
13407 #[doc(hidden)]
13408 impl crate::RequestBuilder for GetOperation {
13409 fn request_options(&mut self) -> &mut crate::RequestOptions {
13410 &mut self.0.options
13411 }
13412 }
13413
13414 #[derive(Clone, Debug)]
13431 pub struct CancelOperation(
13432 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13433 );
13434
13435 impl CancelOperation {
13436 pub(crate) fn new(
13437 stub: std::sync::Arc<dyn super::super::stub::dynamic::Playbooks>,
13438 ) -> Self {
13439 Self(RequestBuilder::new(stub))
13440 }
13441
13442 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13444 mut self,
13445 v: V,
13446 ) -> Self {
13447 self.0.request = v.into();
13448 self
13449 }
13450
13451 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13453 self.0.options = v.into();
13454 self
13455 }
13456
13457 pub async fn send(self) -> Result<()> {
13459 (*self.0.stub)
13460 .cancel_operation(self.0.request, self.0.options)
13461 .await
13462 .map(crate::Response::into_body)
13463 }
13464
13465 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13467 self.0.request.name = v.into();
13468 self
13469 }
13470 }
13471
13472 #[doc(hidden)]
13473 impl crate::RequestBuilder for CancelOperation {
13474 fn request_options(&mut self) -> &mut crate::RequestOptions {
13475 &mut self.0.options
13476 }
13477 }
13478}
13479
13480#[cfg(feature = "security-settings-service")]
13482#[cfg_attr(docsrs, doc(cfg(feature = "security-settings-service")))]
13483pub mod security_settings_service {
13484 use crate::Result;
13485
13486 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13500
13501 pub(crate) mod client {
13502 use super::super::super::client::SecuritySettingsService;
13503 pub struct Factory;
13504 impl crate::ClientFactory for Factory {
13505 type Client = SecuritySettingsService;
13506 type Credentials = gaxi::options::Credentials;
13507 async fn build(
13508 self,
13509 config: gaxi::options::ClientConfig,
13510 ) -> crate::ClientBuilderResult<Self::Client> {
13511 Self::Client::new(config).await
13512 }
13513 }
13514 }
13515
13516 #[derive(Clone, Debug)]
13518 pub(crate) struct RequestBuilder<R: std::default::Default> {
13519 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13520 request: R,
13521 options: crate::RequestOptions,
13522 }
13523
13524 impl<R> RequestBuilder<R>
13525 where
13526 R: std::default::Default,
13527 {
13528 pub(crate) fn new(
13529 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13530 ) -> Self {
13531 Self {
13532 stub,
13533 request: R::default(),
13534 options: crate::RequestOptions::default(),
13535 }
13536 }
13537 }
13538
13539 #[derive(Clone, Debug)]
13556 pub struct CreateSecuritySettings(RequestBuilder<crate::model::CreateSecuritySettingsRequest>);
13557
13558 impl CreateSecuritySettings {
13559 pub(crate) fn new(
13560 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13561 ) -> Self {
13562 Self(RequestBuilder::new(stub))
13563 }
13564
13565 pub fn with_request<V: Into<crate::model::CreateSecuritySettingsRequest>>(
13567 mut self,
13568 v: V,
13569 ) -> Self {
13570 self.0.request = v.into();
13571 self
13572 }
13573
13574 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13576 self.0.options = v.into();
13577 self
13578 }
13579
13580 pub async fn send(self) -> Result<crate::model::SecuritySettings> {
13582 (*self.0.stub)
13583 .create_security_settings(self.0.request, self.0.options)
13584 .await
13585 .map(crate::Response::into_body)
13586 }
13587
13588 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13592 self.0.request.parent = v.into();
13593 self
13594 }
13595
13596 pub fn set_security_settings<T>(mut self, v: T) -> Self
13600 where
13601 T: std::convert::Into<crate::model::SecuritySettings>,
13602 {
13603 self.0.request.security_settings = std::option::Option::Some(v.into());
13604 self
13605 }
13606
13607 pub fn set_or_clear_security_settings<T>(mut self, v: std::option::Option<T>) -> Self
13611 where
13612 T: std::convert::Into<crate::model::SecuritySettings>,
13613 {
13614 self.0.request.security_settings = v.map(|x| x.into());
13615 self
13616 }
13617 }
13618
13619 #[doc(hidden)]
13620 impl crate::RequestBuilder for CreateSecuritySettings {
13621 fn request_options(&mut self) -> &mut crate::RequestOptions {
13622 &mut self.0.options
13623 }
13624 }
13625
13626 #[derive(Clone, Debug)]
13643 pub struct GetSecuritySettings(RequestBuilder<crate::model::GetSecuritySettingsRequest>);
13644
13645 impl GetSecuritySettings {
13646 pub(crate) fn new(
13647 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13648 ) -> Self {
13649 Self(RequestBuilder::new(stub))
13650 }
13651
13652 pub fn with_request<V: Into<crate::model::GetSecuritySettingsRequest>>(
13654 mut self,
13655 v: V,
13656 ) -> Self {
13657 self.0.request = v.into();
13658 self
13659 }
13660
13661 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13663 self.0.options = v.into();
13664 self
13665 }
13666
13667 pub async fn send(self) -> Result<crate::model::SecuritySettings> {
13669 (*self.0.stub)
13670 .get_security_settings(self.0.request, self.0.options)
13671 .await
13672 .map(crate::Response::into_body)
13673 }
13674
13675 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13679 self.0.request.name = v.into();
13680 self
13681 }
13682 }
13683
13684 #[doc(hidden)]
13685 impl crate::RequestBuilder for GetSecuritySettings {
13686 fn request_options(&mut self) -> &mut crate::RequestOptions {
13687 &mut self.0.options
13688 }
13689 }
13690
13691 #[derive(Clone, Debug)]
13708 pub struct UpdateSecuritySettings(RequestBuilder<crate::model::UpdateSecuritySettingsRequest>);
13709
13710 impl UpdateSecuritySettings {
13711 pub(crate) fn new(
13712 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13713 ) -> Self {
13714 Self(RequestBuilder::new(stub))
13715 }
13716
13717 pub fn with_request<V: Into<crate::model::UpdateSecuritySettingsRequest>>(
13719 mut self,
13720 v: V,
13721 ) -> Self {
13722 self.0.request = v.into();
13723 self
13724 }
13725
13726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13728 self.0.options = v.into();
13729 self
13730 }
13731
13732 pub async fn send(self) -> Result<crate::model::SecuritySettings> {
13734 (*self.0.stub)
13735 .update_security_settings(self.0.request, self.0.options)
13736 .await
13737 .map(crate::Response::into_body)
13738 }
13739
13740 pub fn set_security_settings<T>(mut self, v: T) -> Self
13744 where
13745 T: std::convert::Into<crate::model::SecuritySettings>,
13746 {
13747 self.0.request.security_settings = std::option::Option::Some(v.into());
13748 self
13749 }
13750
13751 pub fn set_or_clear_security_settings<T>(mut self, v: std::option::Option<T>) -> Self
13755 where
13756 T: std::convert::Into<crate::model::SecuritySettings>,
13757 {
13758 self.0.request.security_settings = v.map(|x| x.into());
13759 self
13760 }
13761
13762 pub fn set_update_mask<T>(mut self, v: T) -> Self
13766 where
13767 T: std::convert::Into<wkt::FieldMask>,
13768 {
13769 self.0.request.update_mask = std::option::Option::Some(v.into());
13770 self
13771 }
13772
13773 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13777 where
13778 T: std::convert::Into<wkt::FieldMask>,
13779 {
13780 self.0.request.update_mask = v.map(|x| x.into());
13781 self
13782 }
13783 }
13784
13785 #[doc(hidden)]
13786 impl crate::RequestBuilder for UpdateSecuritySettings {
13787 fn request_options(&mut self) -> &mut crate::RequestOptions {
13788 &mut self.0.options
13789 }
13790 }
13791
13792 #[derive(Clone, Debug)]
13813 pub struct ListSecuritySettings(RequestBuilder<crate::model::ListSecuritySettingsRequest>);
13814
13815 impl ListSecuritySettings {
13816 pub(crate) fn new(
13817 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13818 ) -> Self {
13819 Self(RequestBuilder::new(stub))
13820 }
13821
13822 pub fn with_request<V: Into<crate::model::ListSecuritySettingsRequest>>(
13824 mut self,
13825 v: V,
13826 ) -> Self {
13827 self.0.request = v.into();
13828 self
13829 }
13830
13831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13833 self.0.options = v.into();
13834 self
13835 }
13836
13837 pub async fn send(self) -> Result<crate::model::ListSecuritySettingsResponse> {
13839 (*self.0.stub)
13840 .list_security_settings(self.0.request, self.0.options)
13841 .await
13842 .map(crate::Response::into_body)
13843 }
13844
13845 pub fn by_page(
13847 self,
13848 ) -> impl google_cloud_gax::paginator::Paginator<
13849 crate::model::ListSecuritySettingsResponse,
13850 crate::Error,
13851 > {
13852 use std::clone::Clone;
13853 let token = self.0.request.page_token.clone();
13854 let execute = move |token: String| {
13855 let mut builder = self.clone();
13856 builder.0.request = builder.0.request.set_page_token(token);
13857 builder.send()
13858 };
13859 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13860 }
13861
13862 pub fn by_item(
13864 self,
13865 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13866 crate::model::ListSecuritySettingsResponse,
13867 crate::Error,
13868 > {
13869 use google_cloud_gax::paginator::Paginator;
13870 self.by_page().items()
13871 }
13872
13873 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
13877 self.0.request.parent = v.into();
13878 self
13879 }
13880
13881 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13883 self.0.request.page_size = v.into();
13884 self
13885 }
13886
13887 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13889 self.0.request.page_token = v.into();
13890 self
13891 }
13892 }
13893
13894 #[doc(hidden)]
13895 impl crate::RequestBuilder for ListSecuritySettings {
13896 fn request_options(&mut self) -> &mut crate::RequestOptions {
13897 &mut self.0.options
13898 }
13899 }
13900
13901 #[derive(Clone, Debug)]
13918 pub struct DeleteSecuritySettings(RequestBuilder<crate::model::DeleteSecuritySettingsRequest>);
13919
13920 impl DeleteSecuritySettings {
13921 pub(crate) fn new(
13922 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13923 ) -> Self {
13924 Self(RequestBuilder::new(stub))
13925 }
13926
13927 pub fn with_request<V: Into<crate::model::DeleteSecuritySettingsRequest>>(
13929 mut self,
13930 v: V,
13931 ) -> Self {
13932 self.0.request = v.into();
13933 self
13934 }
13935
13936 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13938 self.0.options = v.into();
13939 self
13940 }
13941
13942 pub async fn send(self) -> Result<()> {
13944 (*self.0.stub)
13945 .delete_security_settings(self.0.request, self.0.options)
13946 .await
13947 .map(crate::Response::into_body)
13948 }
13949
13950 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13954 self.0.request.name = v.into();
13955 self
13956 }
13957 }
13958
13959 #[doc(hidden)]
13960 impl crate::RequestBuilder for DeleteSecuritySettings {
13961 fn request_options(&mut self) -> &mut crate::RequestOptions {
13962 &mut self.0.options
13963 }
13964 }
13965
13966 #[derive(Clone, Debug)]
13987 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13988
13989 impl ListLocations {
13990 pub(crate) fn new(
13991 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
13992 ) -> Self {
13993 Self(RequestBuilder::new(stub))
13994 }
13995
13996 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13998 mut self,
13999 v: V,
14000 ) -> Self {
14001 self.0.request = v.into();
14002 self
14003 }
14004
14005 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14007 self.0.options = v.into();
14008 self
14009 }
14010
14011 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14013 (*self.0.stub)
14014 .list_locations(self.0.request, self.0.options)
14015 .await
14016 .map(crate::Response::into_body)
14017 }
14018
14019 pub fn by_page(
14021 self,
14022 ) -> impl google_cloud_gax::paginator::Paginator<
14023 google_cloud_location::model::ListLocationsResponse,
14024 crate::Error,
14025 > {
14026 use std::clone::Clone;
14027 let token = self.0.request.page_token.clone();
14028 let execute = move |token: String| {
14029 let mut builder = self.clone();
14030 builder.0.request = builder.0.request.set_page_token(token);
14031 builder.send()
14032 };
14033 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14034 }
14035
14036 pub fn by_item(
14038 self,
14039 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14040 google_cloud_location::model::ListLocationsResponse,
14041 crate::Error,
14042 > {
14043 use google_cloud_gax::paginator::Paginator;
14044 self.by_page().items()
14045 }
14046
14047 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14049 self.0.request.name = v.into();
14050 self
14051 }
14052
14053 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14055 self.0.request.filter = v.into();
14056 self
14057 }
14058
14059 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14061 self.0.request.page_size = v.into();
14062 self
14063 }
14064
14065 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14067 self.0.request.page_token = v.into();
14068 self
14069 }
14070 }
14071
14072 #[doc(hidden)]
14073 impl crate::RequestBuilder for ListLocations {
14074 fn request_options(&mut self) -> &mut crate::RequestOptions {
14075 &mut self.0.options
14076 }
14077 }
14078
14079 #[derive(Clone, Debug)]
14096 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14097
14098 impl GetLocation {
14099 pub(crate) fn new(
14100 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14101 ) -> Self {
14102 Self(RequestBuilder::new(stub))
14103 }
14104
14105 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14107 mut self,
14108 v: V,
14109 ) -> Self {
14110 self.0.request = v.into();
14111 self
14112 }
14113
14114 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14116 self.0.options = v.into();
14117 self
14118 }
14119
14120 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14122 (*self.0.stub)
14123 .get_location(self.0.request, self.0.options)
14124 .await
14125 .map(crate::Response::into_body)
14126 }
14127
14128 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14130 self.0.request.name = v.into();
14131 self
14132 }
14133 }
14134
14135 #[doc(hidden)]
14136 impl crate::RequestBuilder for GetLocation {
14137 fn request_options(&mut self) -> &mut crate::RequestOptions {
14138 &mut self.0.options
14139 }
14140 }
14141
14142 #[derive(Clone, Debug)]
14163 pub struct ListOperations(
14164 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14165 );
14166
14167 impl ListOperations {
14168 pub(crate) fn new(
14169 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14170 ) -> Self {
14171 Self(RequestBuilder::new(stub))
14172 }
14173
14174 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14176 mut self,
14177 v: V,
14178 ) -> Self {
14179 self.0.request = v.into();
14180 self
14181 }
14182
14183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14185 self.0.options = v.into();
14186 self
14187 }
14188
14189 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14191 (*self.0.stub)
14192 .list_operations(self.0.request, self.0.options)
14193 .await
14194 .map(crate::Response::into_body)
14195 }
14196
14197 pub fn by_page(
14199 self,
14200 ) -> impl google_cloud_gax::paginator::Paginator<
14201 google_cloud_longrunning::model::ListOperationsResponse,
14202 crate::Error,
14203 > {
14204 use std::clone::Clone;
14205 let token = self.0.request.page_token.clone();
14206 let execute = move |token: String| {
14207 let mut builder = self.clone();
14208 builder.0.request = builder.0.request.set_page_token(token);
14209 builder.send()
14210 };
14211 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14212 }
14213
14214 pub fn by_item(
14216 self,
14217 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14218 google_cloud_longrunning::model::ListOperationsResponse,
14219 crate::Error,
14220 > {
14221 use google_cloud_gax::paginator::Paginator;
14222 self.by_page().items()
14223 }
14224
14225 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14227 self.0.request.name = v.into();
14228 self
14229 }
14230
14231 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14233 self.0.request.filter = v.into();
14234 self
14235 }
14236
14237 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14239 self.0.request.page_size = v.into();
14240 self
14241 }
14242
14243 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14245 self.0.request.page_token = v.into();
14246 self
14247 }
14248
14249 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14251 self.0.request.return_partial_success = v.into();
14252 self
14253 }
14254 }
14255
14256 #[doc(hidden)]
14257 impl crate::RequestBuilder for ListOperations {
14258 fn request_options(&mut self) -> &mut crate::RequestOptions {
14259 &mut self.0.options
14260 }
14261 }
14262
14263 #[derive(Clone, Debug)]
14280 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14281
14282 impl GetOperation {
14283 pub(crate) fn new(
14284 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14285 ) -> Self {
14286 Self(RequestBuilder::new(stub))
14287 }
14288
14289 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14291 mut self,
14292 v: V,
14293 ) -> Self {
14294 self.0.request = v.into();
14295 self
14296 }
14297
14298 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14300 self.0.options = v.into();
14301 self
14302 }
14303
14304 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14306 (*self.0.stub)
14307 .get_operation(self.0.request, self.0.options)
14308 .await
14309 .map(crate::Response::into_body)
14310 }
14311
14312 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14314 self.0.request.name = v.into();
14315 self
14316 }
14317 }
14318
14319 #[doc(hidden)]
14320 impl crate::RequestBuilder for GetOperation {
14321 fn request_options(&mut self) -> &mut crate::RequestOptions {
14322 &mut self.0.options
14323 }
14324 }
14325
14326 #[derive(Clone, Debug)]
14343 pub struct CancelOperation(
14344 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14345 );
14346
14347 impl CancelOperation {
14348 pub(crate) fn new(
14349 stub: std::sync::Arc<dyn super::super::stub::dynamic::SecuritySettingsService>,
14350 ) -> Self {
14351 Self(RequestBuilder::new(stub))
14352 }
14353
14354 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14356 mut self,
14357 v: V,
14358 ) -> Self {
14359 self.0.request = v.into();
14360 self
14361 }
14362
14363 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14365 self.0.options = v.into();
14366 self
14367 }
14368
14369 pub async fn send(self) -> Result<()> {
14371 (*self.0.stub)
14372 .cancel_operation(self.0.request, self.0.options)
14373 .await
14374 .map(crate::Response::into_body)
14375 }
14376
14377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14379 self.0.request.name = v.into();
14380 self
14381 }
14382 }
14383
14384 #[doc(hidden)]
14385 impl crate::RequestBuilder for CancelOperation {
14386 fn request_options(&mut self) -> &mut crate::RequestOptions {
14387 &mut self.0.options
14388 }
14389 }
14390}
14391
14392#[cfg(feature = "sessions")]
14394#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
14395pub mod sessions {
14396 use crate::Result;
14397
14398 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14412
14413 pub(crate) mod client {
14414 use super::super::super::client::Sessions;
14415 pub struct Factory;
14416 impl crate::ClientFactory for Factory {
14417 type Client = Sessions;
14418 type Credentials = gaxi::options::Credentials;
14419 async fn build(
14420 self,
14421 config: gaxi::options::ClientConfig,
14422 ) -> crate::ClientBuilderResult<Self::Client> {
14423 Self::Client::new(config).await
14424 }
14425 }
14426 }
14427
14428 #[derive(Clone, Debug)]
14430 pub(crate) struct RequestBuilder<R: std::default::Default> {
14431 stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
14432 request: R,
14433 options: crate::RequestOptions,
14434 }
14435
14436 impl<R> RequestBuilder<R>
14437 where
14438 R: std::default::Default,
14439 {
14440 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14441 Self {
14442 stub,
14443 request: R::default(),
14444 options: crate::RequestOptions::default(),
14445 }
14446 }
14447 }
14448
14449 #[derive(Clone, Debug)]
14466 pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
14467
14468 impl DetectIntent {
14469 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14470 Self(RequestBuilder::new(stub))
14471 }
14472
14473 pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
14475 self.0.request = v.into();
14476 self
14477 }
14478
14479 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14481 self.0.options = v.into();
14482 self
14483 }
14484
14485 pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
14487 (*self.0.stub)
14488 .detect_intent(self.0.request, self.0.options)
14489 .await
14490 .map(crate::Response::into_body)
14491 }
14492
14493 pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
14497 self.0.request.session = v.into();
14498 self
14499 }
14500
14501 pub fn set_query_params<T>(mut self, v: T) -> Self
14503 where
14504 T: std::convert::Into<crate::model::QueryParameters>,
14505 {
14506 self.0.request.query_params = std::option::Option::Some(v.into());
14507 self
14508 }
14509
14510 pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
14512 where
14513 T: std::convert::Into<crate::model::QueryParameters>,
14514 {
14515 self.0.request.query_params = v.map(|x| x.into());
14516 self
14517 }
14518
14519 pub fn set_query_input<T>(mut self, v: T) -> Self
14523 where
14524 T: std::convert::Into<crate::model::QueryInput>,
14525 {
14526 self.0.request.query_input = std::option::Option::Some(v.into());
14527 self
14528 }
14529
14530 pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
14534 where
14535 T: std::convert::Into<crate::model::QueryInput>,
14536 {
14537 self.0.request.query_input = v.map(|x| x.into());
14538 self
14539 }
14540
14541 pub fn set_output_audio_config<T>(mut self, v: T) -> Self
14543 where
14544 T: std::convert::Into<crate::model::OutputAudioConfig>,
14545 {
14546 self.0.request.output_audio_config = std::option::Option::Some(v.into());
14547 self
14548 }
14549
14550 pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
14552 where
14553 T: std::convert::Into<crate::model::OutputAudioConfig>,
14554 {
14555 self.0.request.output_audio_config = v.map(|x| x.into());
14556 self
14557 }
14558
14559 pub fn set_response_view<T: Into<crate::model::DetectIntentResponseView>>(
14561 mut self,
14562 v: T,
14563 ) -> Self {
14564 self.0.request.response_view = v.into();
14565 self
14566 }
14567 }
14568
14569 #[doc(hidden)]
14570 impl crate::RequestBuilder for DetectIntent {
14571 fn request_options(&mut self) -> &mut crate::RequestOptions {
14572 &mut self.0.options
14573 }
14574 }
14575
14576 #[derive(Clone, Debug)]
14593 pub struct MatchIntent(RequestBuilder<crate::model::MatchIntentRequest>);
14594
14595 impl MatchIntent {
14596 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14597 Self(RequestBuilder::new(stub))
14598 }
14599
14600 pub fn with_request<V: Into<crate::model::MatchIntentRequest>>(mut self, v: V) -> Self {
14602 self.0.request = v.into();
14603 self
14604 }
14605
14606 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14608 self.0.options = v.into();
14609 self
14610 }
14611
14612 pub async fn send(self) -> Result<crate::model::MatchIntentResponse> {
14614 (*self.0.stub)
14615 .match_intent(self.0.request, self.0.options)
14616 .await
14617 .map(crate::Response::into_body)
14618 }
14619
14620 pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
14624 self.0.request.session = v.into();
14625 self
14626 }
14627
14628 pub fn set_query_params<T>(mut self, v: T) -> Self
14630 where
14631 T: std::convert::Into<crate::model::QueryParameters>,
14632 {
14633 self.0.request.query_params = std::option::Option::Some(v.into());
14634 self
14635 }
14636
14637 pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
14639 where
14640 T: std::convert::Into<crate::model::QueryParameters>,
14641 {
14642 self.0.request.query_params = v.map(|x| x.into());
14643 self
14644 }
14645
14646 pub fn set_query_input<T>(mut self, v: T) -> Self
14650 where
14651 T: std::convert::Into<crate::model::QueryInput>,
14652 {
14653 self.0.request.query_input = std::option::Option::Some(v.into());
14654 self
14655 }
14656
14657 pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
14661 where
14662 T: std::convert::Into<crate::model::QueryInput>,
14663 {
14664 self.0.request.query_input = v.map(|x| x.into());
14665 self
14666 }
14667
14668 pub fn set_persist_parameter_changes<T: Into<bool>>(mut self, v: T) -> Self {
14670 self.0.request.persist_parameter_changes = v.into();
14671 self
14672 }
14673 }
14674
14675 #[doc(hidden)]
14676 impl crate::RequestBuilder for MatchIntent {
14677 fn request_options(&mut self) -> &mut crate::RequestOptions {
14678 &mut self.0.options
14679 }
14680 }
14681
14682 #[derive(Clone, Debug)]
14699 pub struct FulfillIntent(RequestBuilder<crate::model::FulfillIntentRequest>);
14700
14701 impl FulfillIntent {
14702 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14703 Self(RequestBuilder::new(stub))
14704 }
14705
14706 pub fn with_request<V: Into<crate::model::FulfillIntentRequest>>(mut self, v: V) -> Self {
14708 self.0.request = v.into();
14709 self
14710 }
14711
14712 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14714 self.0.options = v.into();
14715 self
14716 }
14717
14718 pub async fn send(self) -> Result<crate::model::FulfillIntentResponse> {
14720 (*self.0.stub)
14721 .fulfill_intent(self.0.request, self.0.options)
14722 .await
14723 .map(crate::Response::into_body)
14724 }
14725
14726 pub fn set_match_intent_request<T>(mut self, v: T) -> Self
14728 where
14729 T: std::convert::Into<crate::model::MatchIntentRequest>,
14730 {
14731 self.0.request.match_intent_request = std::option::Option::Some(v.into());
14732 self
14733 }
14734
14735 pub fn set_or_clear_match_intent_request<T>(mut self, v: std::option::Option<T>) -> Self
14737 where
14738 T: std::convert::Into<crate::model::MatchIntentRequest>,
14739 {
14740 self.0.request.match_intent_request = v.map(|x| x.into());
14741 self
14742 }
14743
14744 pub fn set_match<T>(mut self, v: T) -> Self
14746 where
14747 T: std::convert::Into<crate::model::Match>,
14748 {
14749 self.0.request.r#match = std::option::Option::Some(v.into());
14750 self
14751 }
14752
14753 pub fn set_or_clear_match<T>(mut self, v: std::option::Option<T>) -> Self
14755 where
14756 T: std::convert::Into<crate::model::Match>,
14757 {
14758 self.0.request.r#match = v.map(|x| x.into());
14759 self
14760 }
14761
14762 pub fn set_output_audio_config<T>(mut self, v: T) -> Self
14764 where
14765 T: std::convert::Into<crate::model::OutputAudioConfig>,
14766 {
14767 self.0.request.output_audio_config = std::option::Option::Some(v.into());
14768 self
14769 }
14770
14771 pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
14773 where
14774 T: std::convert::Into<crate::model::OutputAudioConfig>,
14775 {
14776 self.0.request.output_audio_config = v.map(|x| x.into());
14777 self
14778 }
14779 }
14780
14781 #[doc(hidden)]
14782 impl crate::RequestBuilder for FulfillIntent {
14783 fn request_options(&mut self) -> &mut crate::RequestOptions {
14784 &mut self.0.options
14785 }
14786 }
14787
14788 #[derive(Clone, Debug)]
14805 pub struct SubmitAnswerFeedback(RequestBuilder<crate::model::SubmitAnswerFeedbackRequest>);
14806
14807 impl SubmitAnswerFeedback {
14808 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14809 Self(RequestBuilder::new(stub))
14810 }
14811
14812 pub fn with_request<V: Into<crate::model::SubmitAnswerFeedbackRequest>>(
14814 mut self,
14815 v: V,
14816 ) -> Self {
14817 self.0.request = v.into();
14818 self
14819 }
14820
14821 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14823 self.0.options = v.into();
14824 self
14825 }
14826
14827 pub async fn send(self) -> Result<crate::model::AnswerFeedback> {
14829 (*self.0.stub)
14830 .submit_answer_feedback(self.0.request, self.0.options)
14831 .await
14832 .map(crate::Response::into_body)
14833 }
14834
14835 pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
14839 self.0.request.session = v.into();
14840 self
14841 }
14842
14843 pub fn set_response_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14847 self.0.request.response_id = v.into();
14848 self
14849 }
14850
14851 pub fn set_answer_feedback<T>(mut self, v: T) -> Self
14855 where
14856 T: std::convert::Into<crate::model::AnswerFeedback>,
14857 {
14858 self.0.request.answer_feedback = std::option::Option::Some(v.into());
14859 self
14860 }
14861
14862 pub fn set_or_clear_answer_feedback<T>(mut self, v: std::option::Option<T>) -> Self
14866 where
14867 T: std::convert::Into<crate::model::AnswerFeedback>,
14868 {
14869 self.0.request.answer_feedback = v.map(|x| x.into());
14870 self
14871 }
14872
14873 pub fn set_update_mask<T>(mut self, v: T) -> Self
14875 where
14876 T: std::convert::Into<wkt::FieldMask>,
14877 {
14878 self.0.request.update_mask = std::option::Option::Some(v.into());
14879 self
14880 }
14881
14882 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14884 where
14885 T: std::convert::Into<wkt::FieldMask>,
14886 {
14887 self.0.request.update_mask = v.map(|x| x.into());
14888 self
14889 }
14890 }
14891
14892 #[doc(hidden)]
14893 impl crate::RequestBuilder for SubmitAnswerFeedback {
14894 fn request_options(&mut self) -> &mut crate::RequestOptions {
14895 &mut self.0.options
14896 }
14897 }
14898
14899 #[derive(Clone, Debug)]
14920 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14921
14922 impl ListLocations {
14923 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
14924 Self(RequestBuilder::new(stub))
14925 }
14926
14927 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14929 mut self,
14930 v: V,
14931 ) -> Self {
14932 self.0.request = v.into();
14933 self
14934 }
14935
14936 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14938 self.0.options = v.into();
14939 self
14940 }
14941
14942 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14944 (*self.0.stub)
14945 .list_locations(self.0.request, self.0.options)
14946 .await
14947 .map(crate::Response::into_body)
14948 }
14949
14950 pub fn by_page(
14952 self,
14953 ) -> impl google_cloud_gax::paginator::Paginator<
14954 google_cloud_location::model::ListLocationsResponse,
14955 crate::Error,
14956 > {
14957 use std::clone::Clone;
14958 let token = self.0.request.page_token.clone();
14959 let execute = move |token: String| {
14960 let mut builder = self.clone();
14961 builder.0.request = builder.0.request.set_page_token(token);
14962 builder.send()
14963 };
14964 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14965 }
14966
14967 pub fn by_item(
14969 self,
14970 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14971 google_cloud_location::model::ListLocationsResponse,
14972 crate::Error,
14973 > {
14974 use google_cloud_gax::paginator::Paginator;
14975 self.by_page().items()
14976 }
14977
14978 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14980 self.0.request.name = v.into();
14981 self
14982 }
14983
14984 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14986 self.0.request.filter = v.into();
14987 self
14988 }
14989
14990 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14992 self.0.request.page_size = v.into();
14993 self
14994 }
14995
14996 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14998 self.0.request.page_token = v.into();
14999 self
15000 }
15001 }
15002
15003 #[doc(hidden)]
15004 impl crate::RequestBuilder for ListLocations {
15005 fn request_options(&mut self) -> &mut crate::RequestOptions {
15006 &mut self.0.options
15007 }
15008 }
15009
15010 #[derive(Clone, Debug)]
15027 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15028
15029 impl GetLocation {
15030 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15031 Self(RequestBuilder::new(stub))
15032 }
15033
15034 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15036 mut self,
15037 v: V,
15038 ) -> Self {
15039 self.0.request = v.into();
15040 self
15041 }
15042
15043 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15045 self.0.options = v.into();
15046 self
15047 }
15048
15049 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15051 (*self.0.stub)
15052 .get_location(self.0.request, self.0.options)
15053 .await
15054 .map(crate::Response::into_body)
15055 }
15056
15057 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15059 self.0.request.name = v.into();
15060 self
15061 }
15062 }
15063
15064 #[doc(hidden)]
15065 impl crate::RequestBuilder for GetLocation {
15066 fn request_options(&mut self) -> &mut crate::RequestOptions {
15067 &mut self.0.options
15068 }
15069 }
15070
15071 #[derive(Clone, Debug)]
15092 pub struct ListOperations(
15093 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15094 );
15095
15096 impl ListOperations {
15097 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15098 Self(RequestBuilder::new(stub))
15099 }
15100
15101 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15103 mut self,
15104 v: V,
15105 ) -> Self {
15106 self.0.request = v.into();
15107 self
15108 }
15109
15110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15112 self.0.options = v.into();
15113 self
15114 }
15115
15116 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15118 (*self.0.stub)
15119 .list_operations(self.0.request, self.0.options)
15120 .await
15121 .map(crate::Response::into_body)
15122 }
15123
15124 pub fn by_page(
15126 self,
15127 ) -> impl google_cloud_gax::paginator::Paginator<
15128 google_cloud_longrunning::model::ListOperationsResponse,
15129 crate::Error,
15130 > {
15131 use std::clone::Clone;
15132 let token = self.0.request.page_token.clone();
15133 let execute = move |token: String| {
15134 let mut builder = self.clone();
15135 builder.0.request = builder.0.request.set_page_token(token);
15136 builder.send()
15137 };
15138 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15139 }
15140
15141 pub fn by_item(
15143 self,
15144 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15145 google_cloud_longrunning::model::ListOperationsResponse,
15146 crate::Error,
15147 > {
15148 use google_cloud_gax::paginator::Paginator;
15149 self.by_page().items()
15150 }
15151
15152 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15154 self.0.request.name = v.into();
15155 self
15156 }
15157
15158 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15160 self.0.request.filter = v.into();
15161 self
15162 }
15163
15164 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15166 self.0.request.page_size = v.into();
15167 self
15168 }
15169
15170 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15172 self.0.request.page_token = v.into();
15173 self
15174 }
15175
15176 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15178 self.0.request.return_partial_success = v.into();
15179 self
15180 }
15181 }
15182
15183 #[doc(hidden)]
15184 impl crate::RequestBuilder for ListOperations {
15185 fn request_options(&mut self) -> &mut crate::RequestOptions {
15186 &mut self.0.options
15187 }
15188 }
15189
15190 #[derive(Clone, Debug)]
15207 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15208
15209 impl GetOperation {
15210 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15211 Self(RequestBuilder::new(stub))
15212 }
15213
15214 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15216 mut self,
15217 v: V,
15218 ) -> Self {
15219 self.0.request = v.into();
15220 self
15221 }
15222
15223 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15225 self.0.options = v.into();
15226 self
15227 }
15228
15229 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15231 (*self.0.stub)
15232 .get_operation(self.0.request, self.0.options)
15233 .await
15234 .map(crate::Response::into_body)
15235 }
15236
15237 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15239 self.0.request.name = v.into();
15240 self
15241 }
15242 }
15243
15244 #[doc(hidden)]
15245 impl crate::RequestBuilder for GetOperation {
15246 fn request_options(&mut self) -> &mut crate::RequestOptions {
15247 &mut self.0.options
15248 }
15249 }
15250
15251 #[derive(Clone, Debug)]
15268 pub struct CancelOperation(
15269 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15270 );
15271
15272 impl CancelOperation {
15273 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
15274 Self(RequestBuilder::new(stub))
15275 }
15276
15277 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15279 mut self,
15280 v: V,
15281 ) -> Self {
15282 self.0.request = v.into();
15283 self
15284 }
15285
15286 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15288 self.0.options = v.into();
15289 self
15290 }
15291
15292 pub async fn send(self) -> Result<()> {
15294 (*self.0.stub)
15295 .cancel_operation(self.0.request, self.0.options)
15296 .await
15297 .map(crate::Response::into_body)
15298 }
15299
15300 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15302 self.0.request.name = v.into();
15303 self
15304 }
15305 }
15306
15307 #[doc(hidden)]
15308 impl crate::RequestBuilder for CancelOperation {
15309 fn request_options(&mut self) -> &mut crate::RequestOptions {
15310 &mut self.0.options
15311 }
15312 }
15313}
15314
15315#[cfg(feature = "session-entity-types")]
15317#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
15318pub mod session_entity_types {
15319 use crate::Result;
15320
15321 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15335
15336 pub(crate) mod client {
15337 use super::super::super::client::SessionEntityTypes;
15338 pub struct Factory;
15339 impl crate::ClientFactory for Factory {
15340 type Client = SessionEntityTypes;
15341 type Credentials = gaxi::options::Credentials;
15342 async fn build(
15343 self,
15344 config: gaxi::options::ClientConfig,
15345 ) -> crate::ClientBuilderResult<Self::Client> {
15346 Self::Client::new(config).await
15347 }
15348 }
15349 }
15350
15351 #[derive(Clone, Debug)]
15353 pub(crate) struct RequestBuilder<R: std::default::Default> {
15354 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15355 request: R,
15356 options: crate::RequestOptions,
15357 }
15358
15359 impl<R> RequestBuilder<R>
15360 where
15361 R: std::default::Default,
15362 {
15363 pub(crate) fn new(
15364 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15365 ) -> Self {
15366 Self {
15367 stub,
15368 request: R::default(),
15369 options: crate::RequestOptions::default(),
15370 }
15371 }
15372 }
15373
15374 #[derive(Clone, Debug)]
15395 pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
15396
15397 impl ListSessionEntityTypes {
15398 pub(crate) fn new(
15399 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15400 ) -> Self {
15401 Self(RequestBuilder::new(stub))
15402 }
15403
15404 pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
15406 mut self,
15407 v: V,
15408 ) -> Self {
15409 self.0.request = v.into();
15410 self
15411 }
15412
15413 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15415 self.0.options = v.into();
15416 self
15417 }
15418
15419 pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
15421 (*self.0.stub)
15422 .list_session_entity_types(self.0.request, self.0.options)
15423 .await
15424 .map(crate::Response::into_body)
15425 }
15426
15427 pub fn by_page(
15429 self,
15430 ) -> impl google_cloud_gax::paginator::Paginator<
15431 crate::model::ListSessionEntityTypesResponse,
15432 crate::Error,
15433 > {
15434 use std::clone::Clone;
15435 let token = self.0.request.page_token.clone();
15436 let execute = move |token: String| {
15437 let mut builder = self.clone();
15438 builder.0.request = builder.0.request.set_page_token(token);
15439 builder.send()
15440 };
15441 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15442 }
15443
15444 pub fn by_item(
15446 self,
15447 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15448 crate::model::ListSessionEntityTypesResponse,
15449 crate::Error,
15450 > {
15451 use google_cloud_gax::paginator::Paginator;
15452 self.by_page().items()
15453 }
15454
15455 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15459 self.0.request.parent = v.into();
15460 self
15461 }
15462
15463 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15465 self.0.request.page_size = v.into();
15466 self
15467 }
15468
15469 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15471 self.0.request.page_token = v.into();
15472 self
15473 }
15474 }
15475
15476 #[doc(hidden)]
15477 impl crate::RequestBuilder for ListSessionEntityTypes {
15478 fn request_options(&mut self) -> &mut crate::RequestOptions {
15479 &mut self.0.options
15480 }
15481 }
15482
15483 #[derive(Clone, Debug)]
15500 pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
15501
15502 impl GetSessionEntityType {
15503 pub(crate) fn new(
15504 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15505 ) -> Self {
15506 Self(RequestBuilder::new(stub))
15507 }
15508
15509 pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
15511 mut self,
15512 v: V,
15513 ) -> Self {
15514 self.0.request = v.into();
15515 self
15516 }
15517
15518 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15520 self.0.options = v.into();
15521 self
15522 }
15523
15524 pub async fn send(self) -> Result<crate::model::SessionEntityType> {
15526 (*self.0.stub)
15527 .get_session_entity_type(self.0.request, self.0.options)
15528 .await
15529 .map(crate::Response::into_body)
15530 }
15531
15532 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15536 self.0.request.name = v.into();
15537 self
15538 }
15539 }
15540
15541 #[doc(hidden)]
15542 impl crate::RequestBuilder for GetSessionEntityType {
15543 fn request_options(&mut self) -> &mut crate::RequestOptions {
15544 &mut self.0.options
15545 }
15546 }
15547
15548 #[derive(Clone, Debug)]
15565 pub struct CreateSessionEntityType(
15566 RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
15567 );
15568
15569 impl CreateSessionEntityType {
15570 pub(crate) fn new(
15571 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15572 ) -> Self {
15573 Self(RequestBuilder::new(stub))
15574 }
15575
15576 pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
15578 mut self,
15579 v: V,
15580 ) -> Self {
15581 self.0.request = v.into();
15582 self
15583 }
15584
15585 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15587 self.0.options = v.into();
15588 self
15589 }
15590
15591 pub async fn send(self) -> Result<crate::model::SessionEntityType> {
15593 (*self.0.stub)
15594 .create_session_entity_type(self.0.request, self.0.options)
15595 .await
15596 .map(crate::Response::into_body)
15597 }
15598
15599 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15603 self.0.request.parent = v.into();
15604 self
15605 }
15606
15607 pub fn set_session_entity_type<T>(mut self, v: T) -> Self
15611 where
15612 T: std::convert::Into<crate::model::SessionEntityType>,
15613 {
15614 self.0.request.session_entity_type = std::option::Option::Some(v.into());
15615 self
15616 }
15617
15618 pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
15622 where
15623 T: std::convert::Into<crate::model::SessionEntityType>,
15624 {
15625 self.0.request.session_entity_type = v.map(|x| x.into());
15626 self
15627 }
15628 }
15629
15630 #[doc(hidden)]
15631 impl crate::RequestBuilder for CreateSessionEntityType {
15632 fn request_options(&mut self) -> &mut crate::RequestOptions {
15633 &mut self.0.options
15634 }
15635 }
15636
15637 #[derive(Clone, Debug)]
15654 pub struct UpdateSessionEntityType(
15655 RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
15656 );
15657
15658 impl UpdateSessionEntityType {
15659 pub(crate) fn new(
15660 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15661 ) -> Self {
15662 Self(RequestBuilder::new(stub))
15663 }
15664
15665 pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
15667 mut self,
15668 v: V,
15669 ) -> Self {
15670 self.0.request = v.into();
15671 self
15672 }
15673
15674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15676 self.0.options = v.into();
15677 self
15678 }
15679
15680 pub async fn send(self) -> Result<crate::model::SessionEntityType> {
15682 (*self.0.stub)
15683 .update_session_entity_type(self.0.request, self.0.options)
15684 .await
15685 .map(crate::Response::into_body)
15686 }
15687
15688 pub fn set_session_entity_type<T>(mut self, v: T) -> Self
15692 where
15693 T: std::convert::Into<crate::model::SessionEntityType>,
15694 {
15695 self.0.request.session_entity_type = std::option::Option::Some(v.into());
15696 self
15697 }
15698
15699 pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
15703 where
15704 T: std::convert::Into<crate::model::SessionEntityType>,
15705 {
15706 self.0.request.session_entity_type = v.map(|x| x.into());
15707 self
15708 }
15709
15710 pub fn set_update_mask<T>(mut self, v: T) -> Self
15712 where
15713 T: std::convert::Into<wkt::FieldMask>,
15714 {
15715 self.0.request.update_mask = std::option::Option::Some(v.into());
15716 self
15717 }
15718
15719 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
15721 where
15722 T: std::convert::Into<wkt::FieldMask>,
15723 {
15724 self.0.request.update_mask = v.map(|x| x.into());
15725 self
15726 }
15727 }
15728
15729 #[doc(hidden)]
15730 impl crate::RequestBuilder for UpdateSessionEntityType {
15731 fn request_options(&mut self) -> &mut crate::RequestOptions {
15732 &mut self.0.options
15733 }
15734 }
15735
15736 #[derive(Clone, Debug)]
15753 pub struct DeleteSessionEntityType(
15754 RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
15755 );
15756
15757 impl DeleteSessionEntityType {
15758 pub(crate) fn new(
15759 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15760 ) -> Self {
15761 Self(RequestBuilder::new(stub))
15762 }
15763
15764 pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
15766 mut self,
15767 v: V,
15768 ) -> Self {
15769 self.0.request = v.into();
15770 self
15771 }
15772
15773 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15775 self.0.options = v.into();
15776 self
15777 }
15778
15779 pub async fn send(self) -> Result<()> {
15781 (*self.0.stub)
15782 .delete_session_entity_type(self.0.request, self.0.options)
15783 .await
15784 .map(crate::Response::into_body)
15785 }
15786
15787 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15791 self.0.request.name = v.into();
15792 self
15793 }
15794 }
15795
15796 #[doc(hidden)]
15797 impl crate::RequestBuilder for DeleteSessionEntityType {
15798 fn request_options(&mut self) -> &mut crate::RequestOptions {
15799 &mut self.0.options
15800 }
15801 }
15802
15803 #[derive(Clone, Debug)]
15824 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15825
15826 impl ListLocations {
15827 pub(crate) fn new(
15828 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15829 ) -> Self {
15830 Self(RequestBuilder::new(stub))
15831 }
15832
15833 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15835 mut self,
15836 v: V,
15837 ) -> Self {
15838 self.0.request = v.into();
15839 self
15840 }
15841
15842 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15844 self.0.options = v.into();
15845 self
15846 }
15847
15848 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15850 (*self.0.stub)
15851 .list_locations(self.0.request, self.0.options)
15852 .await
15853 .map(crate::Response::into_body)
15854 }
15855
15856 pub fn by_page(
15858 self,
15859 ) -> impl google_cloud_gax::paginator::Paginator<
15860 google_cloud_location::model::ListLocationsResponse,
15861 crate::Error,
15862 > {
15863 use std::clone::Clone;
15864 let token = self.0.request.page_token.clone();
15865 let execute = move |token: String| {
15866 let mut builder = self.clone();
15867 builder.0.request = builder.0.request.set_page_token(token);
15868 builder.send()
15869 };
15870 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15871 }
15872
15873 pub fn by_item(
15875 self,
15876 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15877 google_cloud_location::model::ListLocationsResponse,
15878 crate::Error,
15879 > {
15880 use google_cloud_gax::paginator::Paginator;
15881 self.by_page().items()
15882 }
15883
15884 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15886 self.0.request.name = v.into();
15887 self
15888 }
15889
15890 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15892 self.0.request.filter = v.into();
15893 self
15894 }
15895
15896 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15898 self.0.request.page_size = v.into();
15899 self
15900 }
15901
15902 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15904 self.0.request.page_token = v.into();
15905 self
15906 }
15907 }
15908
15909 #[doc(hidden)]
15910 impl crate::RequestBuilder for ListLocations {
15911 fn request_options(&mut self) -> &mut crate::RequestOptions {
15912 &mut self.0.options
15913 }
15914 }
15915
15916 #[derive(Clone, Debug)]
15933 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15934
15935 impl GetLocation {
15936 pub(crate) fn new(
15937 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
15938 ) -> Self {
15939 Self(RequestBuilder::new(stub))
15940 }
15941
15942 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15944 mut self,
15945 v: V,
15946 ) -> Self {
15947 self.0.request = v.into();
15948 self
15949 }
15950
15951 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15953 self.0.options = v.into();
15954 self
15955 }
15956
15957 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15959 (*self.0.stub)
15960 .get_location(self.0.request, self.0.options)
15961 .await
15962 .map(crate::Response::into_body)
15963 }
15964
15965 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15967 self.0.request.name = v.into();
15968 self
15969 }
15970 }
15971
15972 #[doc(hidden)]
15973 impl crate::RequestBuilder for GetLocation {
15974 fn request_options(&mut self) -> &mut crate::RequestOptions {
15975 &mut self.0.options
15976 }
15977 }
15978
15979 #[derive(Clone, Debug)]
16000 pub struct ListOperations(
16001 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16002 );
16003
16004 impl ListOperations {
16005 pub(crate) fn new(
16006 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
16007 ) -> Self {
16008 Self(RequestBuilder::new(stub))
16009 }
16010
16011 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16013 mut self,
16014 v: V,
16015 ) -> Self {
16016 self.0.request = v.into();
16017 self
16018 }
16019
16020 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16022 self.0.options = v.into();
16023 self
16024 }
16025
16026 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16028 (*self.0.stub)
16029 .list_operations(self.0.request, self.0.options)
16030 .await
16031 .map(crate::Response::into_body)
16032 }
16033
16034 pub fn by_page(
16036 self,
16037 ) -> impl google_cloud_gax::paginator::Paginator<
16038 google_cloud_longrunning::model::ListOperationsResponse,
16039 crate::Error,
16040 > {
16041 use std::clone::Clone;
16042 let token = self.0.request.page_token.clone();
16043 let execute = move |token: String| {
16044 let mut builder = self.clone();
16045 builder.0.request = builder.0.request.set_page_token(token);
16046 builder.send()
16047 };
16048 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16049 }
16050
16051 pub fn by_item(
16053 self,
16054 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16055 google_cloud_longrunning::model::ListOperationsResponse,
16056 crate::Error,
16057 > {
16058 use google_cloud_gax::paginator::Paginator;
16059 self.by_page().items()
16060 }
16061
16062 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16064 self.0.request.name = v.into();
16065 self
16066 }
16067
16068 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16070 self.0.request.filter = v.into();
16071 self
16072 }
16073
16074 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16076 self.0.request.page_size = v.into();
16077 self
16078 }
16079
16080 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16082 self.0.request.page_token = v.into();
16083 self
16084 }
16085
16086 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16088 self.0.request.return_partial_success = v.into();
16089 self
16090 }
16091 }
16092
16093 #[doc(hidden)]
16094 impl crate::RequestBuilder for ListOperations {
16095 fn request_options(&mut self) -> &mut crate::RequestOptions {
16096 &mut self.0.options
16097 }
16098 }
16099
16100 #[derive(Clone, Debug)]
16117 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
16118
16119 impl GetOperation {
16120 pub(crate) fn new(
16121 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
16122 ) -> Self {
16123 Self(RequestBuilder::new(stub))
16124 }
16125
16126 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
16128 mut self,
16129 v: V,
16130 ) -> Self {
16131 self.0.request = v.into();
16132 self
16133 }
16134
16135 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16137 self.0.options = v.into();
16138 self
16139 }
16140
16141 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16143 (*self.0.stub)
16144 .get_operation(self.0.request, self.0.options)
16145 .await
16146 .map(crate::Response::into_body)
16147 }
16148
16149 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16151 self.0.request.name = v.into();
16152 self
16153 }
16154 }
16155
16156 #[doc(hidden)]
16157 impl crate::RequestBuilder for GetOperation {
16158 fn request_options(&mut self) -> &mut crate::RequestOptions {
16159 &mut self.0.options
16160 }
16161 }
16162
16163 #[derive(Clone, Debug)]
16180 pub struct CancelOperation(
16181 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
16182 );
16183
16184 impl CancelOperation {
16185 pub(crate) fn new(
16186 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
16187 ) -> Self {
16188 Self(RequestBuilder::new(stub))
16189 }
16190
16191 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
16193 mut self,
16194 v: V,
16195 ) -> Self {
16196 self.0.request = v.into();
16197 self
16198 }
16199
16200 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16202 self.0.options = v.into();
16203 self
16204 }
16205
16206 pub async fn send(self) -> Result<()> {
16208 (*self.0.stub)
16209 .cancel_operation(self.0.request, self.0.options)
16210 .await
16211 .map(crate::Response::into_body)
16212 }
16213
16214 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16216 self.0.request.name = v.into();
16217 self
16218 }
16219 }
16220
16221 #[doc(hidden)]
16222 impl crate::RequestBuilder for CancelOperation {
16223 fn request_options(&mut self) -> &mut crate::RequestOptions {
16224 &mut self.0.options
16225 }
16226 }
16227}
16228
16229#[cfg(feature = "test-cases")]
16231#[cfg_attr(docsrs, doc(cfg(feature = "test-cases")))]
16232pub mod test_cases {
16233 use crate::Result;
16234
16235 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
16249
16250 pub(crate) mod client {
16251 use super::super::super::client::TestCases;
16252 pub struct Factory;
16253 impl crate::ClientFactory for Factory {
16254 type Client = TestCases;
16255 type Credentials = gaxi::options::Credentials;
16256 async fn build(
16257 self,
16258 config: gaxi::options::ClientConfig,
16259 ) -> crate::ClientBuilderResult<Self::Client> {
16260 Self::Client::new(config).await
16261 }
16262 }
16263 }
16264
16265 #[derive(Clone, Debug)]
16267 pub(crate) struct RequestBuilder<R: std::default::Default> {
16268 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16269 request: R,
16270 options: crate::RequestOptions,
16271 }
16272
16273 impl<R> RequestBuilder<R>
16274 where
16275 R: std::default::Default,
16276 {
16277 pub(crate) fn new(
16278 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16279 ) -> Self {
16280 Self {
16281 stub,
16282 request: R::default(),
16283 options: crate::RequestOptions::default(),
16284 }
16285 }
16286 }
16287
16288 #[derive(Clone, Debug)]
16309 pub struct ListTestCases(RequestBuilder<crate::model::ListTestCasesRequest>);
16310
16311 impl ListTestCases {
16312 pub(crate) fn new(
16313 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16314 ) -> Self {
16315 Self(RequestBuilder::new(stub))
16316 }
16317
16318 pub fn with_request<V: Into<crate::model::ListTestCasesRequest>>(mut self, v: V) -> Self {
16320 self.0.request = v.into();
16321 self
16322 }
16323
16324 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16326 self.0.options = v.into();
16327 self
16328 }
16329
16330 pub async fn send(self) -> Result<crate::model::ListTestCasesResponse> {
16332 (*self.0.stub)
16333 .list_test_cases(self.0.request, self.0.options)
16334 .await
16335 .map(crate::Response::into_body)
16336 }
16337
16338 pub fn by_page(
16340 self,
16341 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListTestCasesResponse, crate::Error>
16342 {
16343 use std::clone::Clone;
16344 let token = self.0.request.page_token.clone();
16345 let execute = move |token: String| {
16346 let mut builder = self.clone();
16347 builder.0.request = builder.0.request.set_page_token(token);
16348 builder.send()
16349 };
16350 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16351 }
16352
16353 pub fn by_item(
16355 self,
16356 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16357 crate::model::ListTestCasesResponse,
16358 crate::Error,
16359 > {
16360 use google_cloud_gax::paginator::Paginator;
16361 self.by_page().items()
16362 }
16363
16364 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16368 self.0.request.parent = v.into();
16369 self
16370 }
16371
16372 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16374 self.0.request.page_size = v.into();
16375 self
16376 }
16377
16378 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16380 self.0.request.page_token = v.into();
16381 self
16382 }
16383
16384 pub fn set_view<T: Into<crate::model::list_test_cases_request::TestCaseView>>(
16386 mut self,
16387 v: T,
16388 ) -> Self {
16389 self.0.request.view = v.into();
16390 self
16391 }
16392 }
16393
16394 #[doc(hidden)]
16395 impl crate::RequestBuilder for ListTestCases {
16396 fn request_options(&mut self) -> &mut crate::RequestOptions {
16397 &mut self.0.options
16398 }
16399 }
16400
16401 #[derive(Clone, Debug)]
16418 pub struct BatchDeleteTestCases(RequestBuilder<crate::model::BatchDeleteTestCasesRequest>);
16419
16420 impl BatchDeleteTestCases {
16421 pub(crate) fn new(
16422 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16423 ) -> Self {
16424 Self(RequestBuilder::new(stub))
16425 }
16426
16427 pub fn with_request<V: Into<crate::model::BatchDeleteTestCasesRequest>>(
16429 mut self,
16430 v: V,
16431 ) -> Self {
16432 self.0.request = v.into();
16433 self
16434 }
16435
16436 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16438 self.0.options = v.into();
16439 self
16440 }
16441
16442 pub async fn send(self) -> Result<()> {
16444 (*self.0.stub)
16445 .batch_delete_test_cases(self.0.request, self.0.options)
16446 .await
16447 .map(crate::Response::into_body)
16448 }
16449
16450 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16454 self.0.request.parent = v.into();
16455 self
16456 }
16457
16458 pub fn set_names<T, V>(mut self, v: T) -> Self
16462 where
16463 T: std::iter::IntoIterator<Item = V>,
16464 V: std::convert::Into<std::string::String>,
16465 {
16466 use std::iter::Iterator;
16467 self.0.request.names = v.into_iter().map(|i| i.into()).collect();
16468 self
16469 }
16470 }
16471
16472 #[doc(hidden)]
16473 impl crate::RequestBuilder for BatchDeleteTestCases {
16474 fn request_options(&mut self) -> &mut crate::RequestOptions {
16475 &mut self.0.options
16476 }
16477 }
16478
16479 #[derive(Clone, Debug)]
16496 pub struct GetTestCase(RequestBuilder<crate::model::GetTestCaseRequest>);
16497
16498 impl GetTestCase {
16499 pub(crate) fn new(
16500 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16501 ) -> Self {
16502 Self(RequestBuilder::new(stub))
16503 }
16504
16505 pub fn with_request<V: Into<crate::model::GetTestCaseRequest>>(mut self, v: V) -> Self {
16507 self.0.request = v.into();
16508 self
16509 }
16510
16511 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16513 self.0.options = v.into();
16514 self
16515 }
16516
16517 pub async fn send(self) -> Result<crate::model::TestCase> {
16519 (*self.0.stub)
16520 .get_test_case(self.0.request, self.0.options)
16521 .await
16522 .map(crate::Response::into_body)
16523 }
16524
16525 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16529 self.0.request.name = v.into();
16530 self
16531 }
16532 }
16533
16534 #[doc(hidden)]
16535 impl crate::RequestBuilder for GetTestCase {
16536 fn request_options(&mut self) -> &mut crate::RequestOptions {
16537 &mut self.0.options
16538 }
16539 }
16540
16541 #[derive(Clone, Debug)]
16558 pub struct CreateTestCase(RequestBuilder<crate::model::CreateTestCaseRequest>);
16559
16560 impl CreateTestCase {
16561 pub(crate) fn new(
16562 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16563 ) -> Self {
16564 Self(RequestBuilder::new(stub))
16565 }
16566
16567 pub fn with_request<V: Into<crate::model::CreateTestCaseRequest>>(mut self, v: V) -> Self {
16569 self.0.request = v.into();
16570 self
16571 }
16572
16573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16575 self.0.options = v.into();
16576 self
16577 }
16578
16579 pub async fn send(self) -> Result<crate::model::TestCase> {
16581 (*self.0.stub)
16582 .create_test_case(self.0.request, self.0.options)
16583 .await
16584 .map(crate::Response::into_body)
16585 }
16586
16587 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16591 self.0.request.parent = v.into();
16592 self
16593 }
16594
16595 pub fn set_test_case<T>(mut self, v: T) -> Self
16599 where
16600 T: std::convert::Into<crate::model::TestCase>,
16601 {
16602 self.0.request.test_case = std::option::Option::Some(v.into());
16603 self
16604 }
16605
16606 pub fn set_or_clear_test_case<T>(mut self, v: std::option::Option<T>) -> Self
16610 where
16611 T: std::convert::Into<crate::model::TestCase>,
16612 {
16613 self.0.request.test_case = v.map(|x| x.into());
16614 self
16615 }
16616 }
16617
16618 #[doc(hidden)]
16619 impl crate::RequestBuilder for CreateTestCase {
16620 fn request_options(&mut self) -> &mut crate::RequestOptions {
16621 &mut self.0.options
16622 }
16623 }
16624
16625 #[derive(Clone, Debug)]
16642 pub struct UpdateTestCase(RequestBuilder<crate::model::UpdateTestCaseRequest>);
16643
16644 impl UpdateTestCase {
16645 pub(crate) fn new(
16646 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16647 ) -> Self {
16648 Self(RequestBuilder::new(stub))
16649 }
16650
16651 pub fn with_request<V: Into<crate::model::UpdateTestCaseRequest>>(mut self, v: V) -> Self {
16653 self.0.request = v.into();
16654 self
16655 }
16656
16657 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16659 self.0.options = v.into();
16660 self
16661 }
16662
16663 pub async fn send(self) -> Result<crate::model::TestCase> {
16665 (*self.0.stub)
16666 .update_test_case(self.0.request, self.0.options)
16667 .await
16668 .map(crate::Response::into_body)
16669 }
16670
16671 pub fn set_test_case<T>(mut self, v: T) -> Self
16675 where
16676 T: std::convert::Into<crate::model::TestCase>,
16677 {
16678 self.0.request.test_case = std::option::Option::Some(v.into());
16679 self
16680 }
16681
16682 pub fn set_or_clear_test_case<T>(mut self, v: std::option::Option<T>) -> Self
16686 where
16687 T: std::convert::Into<crate::model::TestCase>,
16688 {
16689 self.0.request.test_case = v.map(|x| x.into());
16690 self
16691 }
16692
16693 pub fn set_update_mask<T>(mut self, v: T) -> Self
16697 where
16698 T: std::convert::Into<wkt::FieldMask>,
16699 {
16700 self.0.request.update_mask = std::option::Option::Some(v.into());
16701 self
16702 }
16703
16704 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16708 where
16709 T: std::convert::Into<wkt::FieldMask>,
16710 {
16711 self.0.request.update_mask = v.map(|x| x.into());
16712 self
16713 }
16714 }
16715
16716 #[doc(hidden)]
16717 impl crate::RequestBuilder for UpdateTestCase {
16718 fn request_options(&mut self) -> &mut crate::RequestOptions {
16719 &mut self.0.options
16720 }
16721 }
16722
16723 #[derive(Clone, Debug)]
16741 pub struct RunTestCase(RequestBuilder<crate::model::RunTestCaseRequest>);
16742
16743 impl RunTestCase {
16744 pub(crate) fn new(
16745 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16746 ) -> Self {
16747 Self(RequestBuilder::new(stub))
16748 }
16749
16750 pub fn with_request<V: Into<crate::model::RunTestCaseRequest>>(mut self, v: V) -> Self {
16752 self.0.request = v.into();
16753 self
16754 }
16755
16756 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16758 self.0.options = v.into();
16759 self
16760 }
16761
16762 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16769 (*self.0.stub)
16770 .run_test_case(self.0.request, self.0.options)
16771 .await
16772 .map(crate::Response::into_body)
16773 }
16774
16775 pub fn poller(
16777 self,
16778 ) -> impl google_cloud_lro::Poller<
16779 crate::model::RunTestCaseResponse,
16780 crate::model::RunTestCaseMetadata,
16781 > {
16782 type Operation = google_cloud_lro::internal::Operation<
16783 crate::model::RunTestCaseResponse,
16784 crate::model::RunTestCaseMetadata,
16785 >;
16786 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16787 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16788
16789 let stub = self.0.stub.clone();
16790 let mut options = self.0.options.clone();
16791 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16792 let query = move |name| {
16793 let stub = stub.clone();
16794 let options = options.clone();
16795 async {
16796 let op = GetOperation::new(stub)
16797 .set_name(name)
16798 .with_options(options)
16799 .send()
16800 .await?;
16801 Ok(Operation::new(op))
16802 }
16803 };
16804
16805 let start = move || async {
16806 let op = self.send().await?;
16807 Ok(Operation::new(op))
16808 };
16809
16810 google_cloud_lro::internal::new_poller(
16811 polling_error_policy,
16812 polling_backoff_policy,
16813 start,
16814 query,
16815 )
16816 }
16817
16818 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16822 self.0.request.name = v.into();
16823 self
16824 }
16825
16826 pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
16828 self.0.request.environment = v.into();
16829 self
16830 }
16831 }
16832
16833 #[doc(hidden)]
16834 impl crate::RequestBuilder for RunTestCase {
16835 fn request_options(&mut self) -> &mut crate::RequestOptions {
16836 &mut self.0.options
16837 }
16838 }
16839
16840 #[derive(Clone, Debug)]
16858 pub struct BatchRunTestCases(RequestBuilder<crate::model::BatchRunTestCasesRequest>);
16859
16860 impl BatchRunTestCases {
16861 pub(crate) fn new(
16862 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16863 ) -> Self {
16864 Self(RequestBuilder::new(stub))
16865 }
16866
16867 pub fn with_request<V: Into<crate::model::BatchRunTestCasesRequest>>(
16869 mut self,
16870 v: V,
16871 ) -> Self {
16872 self.0.request = v.into();
16873 self
16874 }
16875
16876 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16878 self.0.options = v.into();
16879 self
16880 }
16881
16882 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16889 (*self.0.stub)
16890 .batch_run_test_cases(self.0.request, self.0.options)
16891 .await
16892 .map(crate::Response::into_body)
16893 }
16894
16895 pub fn poller(
16897 self,
16898 ) -> impl google_cloud_lro::Poller<
16899 crate::model::BatchRunTestCasesResponse,
16900 crate::model::BatchRunTestCasesMetadata,
16901 > {
16902 type Operation = google_cloud_lro::internal::Operation<
16903 crate::model::BatchRunTestCasesResponse,
16904 crate::model::BatchRunTestCasesMetadata,
16905 >;
16906 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16907 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16908
16909 let stub = self.0.stub.clone();
16910 let mut options = self.0.options.clone();
16911 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16912 let query = move |name| {
16913 let stub = stub.clone();
16914 let options = options.clone();
16915 async {
16916 let op = GetOperation::new(stub)
16917 .set_name(name)
16918 .with_options(options)
16919 .send()
16920 .await?;
16921 Ok(Operation::new(op))
16922 }
16923 };
16924
16925 let start = move || async {
16926 let op = self.send().await?;
16927 Ok(Operation::new(op))
16928 };
16929
16930 google_cloud_lro::internal::new_poller(
16931 polling_error_policy,
16932 polling_backoff_policy,
16933 start,
16934 query,
16935 )
16936 }
16937
16938 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16942 self.0.request.parent = v.into();
16943 self
16944 }
16945
16946 pub fn set_environment<T: Into<std::string::String>>(mut self, v: T) -> Self {
16948 self.0.request.environment = v.into();
16949 self
16950 }
16951
16952 pub fn set_test_cases<T, V>(mut self, v: T) -> Self
16956 where
16957 T: std::iter::IntoIterator<Item = V>,
16958 V: std::convert::Into<std::string::String>,
16959 {
16960 use std::iter::Iterator;
16961 self.0.request.test_cases = v.into_iter().map(|i| i.into()).collect();
16962 self
16963 }
16964 }
16965
16966 #[doc(hidden)]
16967 impl crate::RequestBuilder for BatchRunTestCases {
16968 fn request_options(&mut self) -> &mut crate::RequestOptions {
16969 &mut self.0.options
16970 }
16971 }
16972
16973 #[derive(Clone, Debug)]
16990 pub struct CalculateCoverage(RequestBuilder<crate::model::CalculateCoverageRequest>);
16991
16992 impl CalculateCoverage {
16993 pub(crate) fn new(
16994 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
16995 ) -> Self {
16996 Self(RequestBuilder::new(stub))
16997 }
16998
16999 pub fn with_request<V: Into<crate::model::CalculateCoverageRequest>>(
17001 mut self,
17002 v: V,
17003 ) -> Self {
17004 self.0.request = v.into();
17005 self
17006 }
17007
17008 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17010 self.0.options = v.into();
17011 self
17012 }
17013
17014 pub async fn send(self) -> Result<crate::model::CalculateCoverageResponse> {
17016 (*self.0.stub)
17017 .calculate_coverage(self.0.request, self.0.options)
17018 .await
17019 .map(crate::Response::into_body)
17020 }
17021
17022 pub fn set_agent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17026 self.0.request.agent = v.into();
17027 self
17028 }
17029
17030 pub fn set_type<T: Into<crate::model::calculate_coverage_request::CoverageType>>(
17034 mut self,
17035 v: T,
17036 ) -> Self {
17037 self.0.request.r#type = v.into();
17038 self
17039 }
17040 }
17041
17042 #[doc(hidden)]
17043 impl crate::RequestBuilder for CalculateCoverage {
17044 fn request_options(&mut self) -> &mut crate::RequestOptions {
17045 &mut self.0.options
17046 }
17047 }
17048
17049 #[derive(Clone, Debug)]
17067 pub struct ImportTestCases(RequestBuilder<crate::model::ImportTestCasesRequest>);
17068
17069 impl ImportTestCases {
17070 pub(crate) fn new(
17071 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17072 ) -> Self {
17073 Self(RequestBuilder::new(stub))
17074 }
17075
17076 pub fn with_request<V: Into<crate::model::ImportTestCasesRequest>>(mut self, v: V) -> Self {
17078 self.0.request = v.into();
17079 self
17080 }
17081
17082 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17084 self.0.options = v.into();
17085 self
17086 }
17087
17088 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17095 (*self.0.stub)
17096 .import_test_cases(self.0.request, self.0.options)
17097 .await
17098 .map(crate::Response::into_body)
17099 }
17100
17101 pub fn poller(
17103 self,
17104 ) -> impl google_cloud_lro::Poller<
17105 crate::model::ImportTestCasesResponse,
17106 crate::model::ImportTestCasesMetadata,
17107 > {
17108 type Operation = google_cloud_lro::internal::Operation<
17109 crate::model::ImportTestCasesResponse,
17110 crate::model::ImportTestCasesMetadata,
17111 >;
17112 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17113 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17114
17115 let stub = self.0.stub.clone();
17116 let mut options = self.0.options.clone();
17117 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17118 let query = move |name| {
17119 let stub = stub.clone();
17120 let options = options.clone();
17121 async {
17122 let op = GetOperation::new(stub)
17123 .set_name(name)
17124 .with_options(options)
17125 .send()
17126 .await?;
17127 Ok(Operation::new(op))
17128 }
17129 };
17130
17131 let start = move || async {
17132 let op = self.send().await?;
17133 Ok(Operation::new(op))
17134 };
17135
17136 google_cloud_lro::internal::new_poller(
17137 polling_error_policy,
17138 polling_backoff_policy,
17139 start,
17140 query,
17141 )
17142 }
17143
17144 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17148 self.0.request.parent = v.into();
17149 self
17150 }
17151
17152 pub fn set_source<T: Into<Option<crate::model::import_test_cases_request::Source>>>(
17157 mut self,
17158 v: T,
17159 ) -> Self {
17160 self.0.request.source = v.into();
17161 self
17162 }
17163
17164 pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17170 self.0.request = self.0.request.set_gcs_uri(v);
17171 self
17172 }
17173
17174 pub fn set_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
17180 self.0.request = self.0.request.set_content(v);
17181 self
17182 }
17183 }
17184
17185 #[doc(hidden)]
17186 impl crate::RequestBuilder for ImportTestCases {
17187 fn request_options(&mut self) -> &mut crate::RequestOptions {
17188 &mut self.0.options
17189 }
17190 }
17191
17192 #[derive(Clone, Debug)]
17210 pub struct ExportTestCases(RequestBuilder<crate::model::ExportTestCasesRequest>);
17211
17212 impl ExportTestCases {
17213 pub(crate) fn new(
17214 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17215 ) -> Self {
17216 Self(RequestBuilder::new(stub))
17217 }
17218
17219 pub fn with_request<V: Into<crate::model::ExportTestCasesRequest>>(mut self, v: V) -> Self {
17221 self.0.request = v.into();
17222 self
17223 }
17224
17225 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17227 self.0.options = v.into();
17228 self
17229 }
17230
17231 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17238 (*self.0.stub)
17239 .export_test_cases(self.0.request, self.0.options)
17240 .await
17241 .map(crate::Response::into_body)
17242 }
17243
17244 pub fn poller(
17246 self,
17247 ) -> impl google_cloud_lro::Poller<
17248 crate::model::ExportTestCasesResponse,
17249 crate::model::ExportTestCasesMetadata,
17250 > {
17251 type Operation = google_cloud_lro::internal::Operation<
17252 crate::model::ExportTestCasesResponse,
17253 crate::model::ExportTestCasesMetadata,
17254 >;
17255 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
17256 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
17257
17258 let stub = self.0.stub.clone();
17259 let mut options = self.0.options.clone();
17260 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
17261 let query = move |name| {
17262 let stub = stub.clone();
17263 let options = options.clone();
17264 async {
17265 let op = GetOperation::new(stub)
17266 .set_name(name)
17267 .with_options(options)
17268 .send()
17269 .await?;
17270 Ok(Operation::new(op))
17271 }
17272 };
17273
17274 let start = move || async {
17275 let op = self.send().await?;
17276 Ok(Operation::new(op))
17277 };
17278
17279 google_cloud_lro::internal::new_poller(
17280 polling_error_policy,
17281 polling_backoff_policy,
17282 start,
17283 query,
17284 )
17285 }
17286
17287 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17291 self.0.request.parent = v.into();
17292 self
17293 }
17294
17295 pub fn set_data_format<T: Into<crate::model::export_test_cases_request::DataFormat>>(
17297 mut self,
17298 v: T,
17299 ) -> Self {
17300 self.0.request.data_format = v.into();
17301 self
17302 }
17303
17304 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17306 self.0.request.filter = v.into();
17307 self
17308 }
17309
17310 pub fn set_destination<
17315 T: Into<Option<crate::model::export_test_cases_request::Destination>>,
17316 >(
17317 mut self,
17318 v: T,
17319 ) -> Self {
17320 self.0.request.destination = v.into();
17321 self
17322 }
17323
17324 pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
17330 self.0.request = self.0.request.set_gcs_uri(v);
17331 self
17332 }
17333 }
17334
17335 #[doc(hidden)]
17336 impl crate::RequestBuilder for ExportTestCases {
17337 fn request_options(&mut self) -> &mut crate::RequestOptions {
17338 &mut self.0.options
17339 }
17340 }
17341
17342 #[derive(Clone, Debug)]
17363 pub struct ListTestCaseResults(RequestBuilder<crate::model::ListTestCaseResultsRequest>);
17364
17365 impl ListTestCaseResults {
17366 pub(crate) fn new(
17367 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17368 ) -> Self {
17369 Self(RequestBuilder::new(stub))
17370 }
17371
17372 pub fn with_request<V: Into<crate::model::ListTestCaseResultsRequest>>(
17374 mut self,
17375 v: V,
17376 ) -> Self {
17377 self.0.request = v.into();
17378 self
17379 }
17380
17381 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17383 self.0.options = v.into();
17384 self
17385 }
17386
17387 pub async fn send(self) -> Result<crate::model::ListTestCaseResultsResponse> {
17389 (*self.0.stub)
17390 .list_test_case_results(self.0.request, self.0.options)
17391 .await
17392 .map(crate::Response::into_body)
17393 }
17394
17395 pub fn by_page(
17397 self,
17398 ) -> impl google_cloud_gax::paginator::Paginator<
17399 crate::model::ListTestCaseResultsResponse,
17400 crate::Error,
17401 > {
17402 use std::clone::Clone;
17403 let token = self.0.request.page_token.clone();
17404 let execute = move |token: String| {
17405 let mut builder = self.clone();
17406 builder.0.request = builder.0.request.set_page_token(token);
17407 builder.send()
17408 };
17409 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17410 }
17411
17412 pub fn by_item(
17414 self,
17415 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17416 crate::model::ListTestCaseResultsResponse,
17417 crate::Error,
17418 > {
17419 use google_cloud_gax::paginator::Paginator;
17420 self.by_page().items()
17421 }
17422
17423 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17427 self.0.request.parent = v.into();
17428 self
17429 }
17430
17431 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17433 self.0.request.page_size = v.into();
17434 self
17435 }
17436
17437 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17439 self.0.request.page_token = v.into();
17440 self
17441 }
17442
17443 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17445 self.0.request.filter = v.into();
17446 self
17447 }
17448 }
17449
17450 #[doc(hidden)]
17451 impl crate::RequestBuilder for ListTestCaseResults {
17452 fn request_options(&mut self) -> &mut crate::RequestOptions {
17453 &mut self.0.options
17454 }
17455 }
17456
17457 #[derive(Clone, Debug)]
17474 pub struct GetTestCaseResult(RequestBuilder<crate::model::GetTestCaseResultRequest>);
17475
17476 impl GetTestCaseResult {
17477 pub(crate) fn new(
17478 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17479 ) -> Self {
17480 Self(RequestBuilder::new(stub))
17481 }
17482
17483 pub fn with_request<V: Into<crate::model::GetTestCaseResultRequest>>(
17485 mut self,
17486 v: V,
17487 ) -> Self {
17488 self.0.request = v.into();
17489 self
17490 }
17491
17492 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17494 self.0.options = v.into();
17495 self
17496 }
17497
17498 pub async fn send(self) -> Result<crate::model::TestCaseResult> {
17500 (*self.0.stub)
17501 .get_test_case_result(self.0.request, self.0.options)
17502 .await
17503 .map(crate::Response::into_body)
17504 }
17505
17506 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17510 self.0.request.name = v.into();
17511 self
17512 }
17513 }
17514
17515 #[doc(hidden)]
17516 impl crate::RequestBuilder for GetTestCaseResult {
17517 fn request_options(&mut self) -> &mut crate::RequestOptions {
17518 &mut self.0.options
17519 }
17520 }
17521
17522 #[derive(Clone, Debug)]
17543 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
17544
17545 impl ListLocations {
17546 pub(crate) fn new(
17547 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17548 ) -> Self {
17549 Self(RequestBuilder::new(stub))
17550 }
17551
17552 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
17554 mut self,
17555 v: V,
17556 ) -> Self {
17557 self.0.request = v.into();
17558 self
17559 }
17560
17561 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17563 self.0.options = v.into();
17564 self
17565 }
17566
17567 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
17569 (*self.0.stub)
17570 .list_locations(self.0.request, self.0.options)
17571 .await
17572 .map(crate::Response::into_body)
17573 }
17574
17575 pub fn by_page(
17577 self,
17578 ) -> impl google_cloud_gax::paginator::Paginator<
17579 google_cloud_location::model::ListLocationsResponse,
17580 crate::Error,
17581 > {
17582 use std::clone::Clone;
17583 let token = self.0.request.page_token.clone();
17584 let execute = move |token: String| {
17585 let mut builder = self.clone();
17586 builder.0.request = builder.0.request.set_page_token(token);
17587 builder.send()
17588 };
17589 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17590 }
17591
17592 pub fn by_item(
17594 self,
17595 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17596 google_cloud_location::model::ListLocationsResponse,
17597 crate::Error,
17598 > {
17599 use google_cloud_gax::paginator::Paginator;
17600 self.by_page().items()
17601 }
17602
17603 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17605 self.0.request.name = v.into();
17606 self
17607 }
17608
17609 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17611 self.0.request.filter = v.into();
17612 self
17613 }
17614
17615 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17617 self.0.request.page_size = v.into();
17618 self
17619 }
17620
17621 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17623 self.0.request.page_token = v.into();
17624 self
17625 }
17626 }
17627
17628 #[doc(hidden)]
17629 impl crate::RequestBuilder for ListLocations {
17630 fn request_options(&mut self) -> &mut crate::RequestOptions {
17631 &mut self.0.options
17632 }
17633 }
17634
17635 #[derive(Clone, Debug)]
17652 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
17653
17654 impl GetLocation {
17655 pub(crate) fn new(
17656 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17657 ) -> Self {
17658 Self(RequestBuilder::new(stub))
17659 }
17660
17661 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
17663 mut self,
17664 v: V,
17665 ) -> Self {
17666 self.0.request = v.into();
17667 self
17668 }
17669
17670 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17672 self.0.options = v.into();
17673 self
17674 }
17675
17676 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
17678 (*self.0.stub)
17679 .get_location(self.0.request, self.0.options)
17680 .await
17681 .map(crate::Response::into_body)
17682 }
17683
17684 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17686 self.0.request.name = v.into();
17687 self
17688 }
17689 }
17690
17691 #[doc(hidden)]
17692 impl crate::RequestBuilder for GetLocation {
17693 fn request_options(&mut self) -> &mut crate::RequestOptions {
17694 &mut self.0.options
17695 }
17696 }
17697
17698 #[derive(Clone, Debug)]
17719 pub struct ListOperations(
17720 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17721 );
17722
17723 impl ListOperations {
17724 pub(crate) fn new(
17725 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17726 ) -> Self {
17727 Self(RequestBuilder::new(stub))
17728 }
17729
17730 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17732 mut self,
17733 v: V,
17734 ) -> Self {
17735 self.0.request = v.into();
17736 self
17737 }
17738
17739 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17741 self.0.options = v.into();
17742 self
17743 }
17744
17745 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17747 (*self.0.stub)
17748 .list_operations(self.0.request, self.0.options)
17749 .await
17750 .map(crate::Response::into_body)
17751 }
17752
17753 pub fn by_page(
17755 self,
17756 ) -> impl google_cloud_gax::paginator::Paginator<
17757 google_cloud_longrunning::model::ListOperationsResponse,
17758 crate::Error,
17759 > {
17760 use std::clone::Clone;
17761 let token = self.0.request.page_token.clone();
17762 let execute = move |token: String| {
17763 let mut builder = self.clone();
17764 builder.0.request = builder.0.request.set_page_token(token);
17765 builder.send()
17766 };
17767 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17768 }
17769
17770 pub fn by_item(
17772 self,
17773 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17774 google_cloud_longrunning::model::ListOperationsResponse,
17775 crate::Error,
17776 > {
17777 use google_cloud_gax::paginator::Paginator;
17778 self.by_page().items()
17779 }
17780
17781 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17783 self.0.request.name = v.into();
17784 self
17785 }
17786
17787 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17789 self.0.request.filter = v.into();
17790 self
17791 }
17792
17793 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17795 self.0.request.page_size = v.into();
17796 self
17797 }
17798
17799 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17801 self.0.request.page_token = v.into();
17802 self
17803 }
17804
17805 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17807 self.0.request.return_partial_success = v.into();
17808 self
17809 }
17810 }
17811
17812 #[doc(hidden)]
17813 impl crate::RequestBuilder for ListOperations {
17814 fn request_options(&mut self) -> &mut crate::RequestOptions {
17815 &mut self.0.options
17816 }
17817 }
17818
17819 #[derive(Clone, Debug)]
17836 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17837
17838 impl GetOperation {
17839 pub(crate) fn new(
17840 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17841 ) -> Self {
17842 Self(RequestBuilder::new(stub))
17843 }
17844
17845 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17847 mut self,
17848 v: V,
17849 ) -> Self {
17850 self.0.request = v.into();
17851 self
17852 }
17853
17854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17856 self.0.options = v.into();
17857 self
17858 }
17859
17860 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17862 (*self.0.stub)
17863 .get_operation(self.0.request, self.0.options)
17864 .await
17865 .map(crate::Response::into_body)
17866 }
17867
17868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17870 self.0.request.name = v.into();
17871 self
17872 }
17873 }
17874
17875 #[doc(hidden)]
17876 impl crate::RequestBuilder for GetOperation {
17877 fn request_options(&mut self) -> &mut crate::RequestOptions {
17878 &mut self.0.options
17879 }
17880 }
17881
17882 #[derive(Clone, Debug)]
17899 pub struct CancelOperation(
17900 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17901 );
17902
17903 impl CancelOperation {
17904 pub(crate) fn new(
17905 stub: std::sync::Arc<dyn super::super::stub::dynamic::TestCases>,
17906 ) -> Self {
17907 Self(RequestBuilder::new(stub))
17908 }
17909
17910 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17912 mut self,
17913 v: V,
17914 ) -> Self {
17915 self.0.request = v.into();
17916 self
17917 }
17918
17919 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17921 self.0.options = v.into();
17922 self
17923 }
17924
17925 pub async fn send(self) -> Result<()> {
17927 (*self.0.stub)
17928 .cancel_operation(self.0.request, self.0.options)
17929 .await
17930 .map(crate::Response::into_body)
17931 }
17932
17933 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17935 self.0.request.name = v.into();
17936 self
17937 }
17938 }
17939
17940 #[doc(hidden)]
17941 impl crate::RequestBuilder for CancelOperation {
17942 fn request_options(&mut self) -> &mut crate::RequestOptions {
17943 &mut self.0.options
17944 }
17945 }
17946}
17947
17948#[cfg(feature = "tools")]
17950#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
17951pub mod tools {
17952 use crate::Result;
17953
17954 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17968
17969 pub(crate) mod client {
17970 use super::super::super::client::Tools;
17971 pub struct Factory;
17972 impl crate::ClientFactory for Factory {
17973 type Client = Tools;
17974 type Credentials = gaxi::options::Credentials;
17975 async fn build(
17976 self,
17977 config: gaxi::options::ClientConfig,
17978 ) -> crate::ClientBuilderResult<Self::Client> {
17979 Self::Client::new(config).await
17980 }
17981 }
17982 }
17983
17984 #[derive(Clone, Debug)]
17986 pub(crate) struct RequestBuilder<R: std::default::Default> {
17987 stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
17988 request: R,
17989 options: crate::RequestOptions,
17990 }
17991
17992 impl<R> RequestBuilder<R>
17993 where
17994 R: std::default::Default,
17995 {
17996 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
17997 Self {
17998 stub,
17999 request: R::default(),
18000 options: crate::RequestOptions::default(),
18001 }
18002 }
18003 }
18004
18005 #[derive(Clone, Debug)]
18022 pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
18023
18024 impl CreateTool {
18025 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18026 Self(RequestBuilder::new(stub))
18027 }
18028
18029 pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
18031 self.0.request = v.into();
18032 self
18033 }
18034
18035 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18037 self.0.options = v.into();
18038 self
18039 }
18040
18041 pub async fn send(self) -> Result<crate::model::Tool> {
18043 (*self.0.stub)
18044 .create_tool(self.0.request, self.0.options)
18045 .await
18046 .map(crate::Response::into_body)
18047 }
18048
18049 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18053 self.0.request.parent = v.into();
18054 self
18055 }
18056
18057 pub fn set_tool<T>(mut self, v: T) -> Self
18061 where
18062 T: std::convert::Into<crate::model::Tool>,
18063 {
18064 self.0.request.tool = std::option::Option::Some(v.into());
18065 self
18066 }
18067
18068 pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
18072 where
18073 T: std::convert::Into<crate::model::Tool>,
18074 {
18075 self.0.request.tool = v.map(|x| x.into());
18076 self
18077 }
18078 }
18079
18080 #[doc(hidden)]
18081 impl crate::RequestBuilder for CreateTool {
18082 fn request_options(&mut self) -> &mut crate::RequestOptions {
18083 &mut self.0.options
18084 }
18085 }
18086
18087 #[derive(Clone, Debug)]
18108 pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
18109
18110 impl ListTools {
18111 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18112 Self(RequestBuilder::new(stub))
18113 }
18114
18115 pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
18117 self.0.request = v.into();
18118 self
18119 }
18120
18121 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18123 self.0.options = v.into();
18124 self
18125 }
18126
18127 pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
18129 (*self.0.stub)
18130 .list_tools(self.0.request, self.0.options)
18131 .await
18132 .map(crate::Response::into_body)
18133 }
18134
18135 pub fn by_page(
18137 self,
18138 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
18139 {
18140 use std::clone::Clone;
18141 let token = self.0.request.page_token.clone();
18142 let execute = move |token: String| {
18143 let mut builder = self.clone();
18144 builder.0.request = builder.0.request.set_page_token(token);
18145 builder.send()
18146 };
18147 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18148 }
18149
18150 pub fn by_item(
18152 self,
18153 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
18154 {
18155 use google_cloud_gax::paginator::Paginator;
18156 self.by_page().items()
18157 }
18158
18159 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18163 self.0.request.parent = v.into();
18164 self
18165 }
18166
18167 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18169 self.0.request.page_size = v.into();
18170 self
18171 }
18172
18173 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18175 self.0.request.page_token = v.into();
18176 self
18177 }
18178 }
18179
18180 #[doc(hidden)]
18181 impl crate::RequestBuilder for ListTools {
18182 fn request_options(&mut self) -> &mut crate::RequestOptions {
18183 &mut self.0.options
18184 }
18185 }
18186
18187 #[derive(Clone, Debug)]
18204 pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
18205
18206 impl GetTool {
18207 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18208 Self(RequestBuilder::new(stub))
18209 }
18210
18211 pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
18213 self.0.request = v.into();
18214 self
18215 }
18216
18217 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18219 self.0.options = v.into();
18220 self
18221 }
18222
18223 pub async fn send(self) -> Result<crate::model::Tool> {
18225 (*self.0.stub)
18226 .get_tool(self.0.request, self.0.options)
18227 .await
18228 .map(crate::Response::into_body)
18229 }
18230
18231 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18235 self.0.request.name = v.into();
18236 self
18237 }
18238 }
18239
18240 #[doc(hidden)]
18241 impl crate::RequestBuilder for GetTool {
18242 fn request_options(&mut self) -> &mut crate::RequestOptions {
18243 &mut self.0.options
18244 }
18245 }
18246
18247 #[derive(Clone, Debug)]
18264 pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
18265
18266 impl UpdateTool {
18267 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18268 Self(RequestBuilder::new(stub))
18269 }
18270
18271 pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
18273 self.0.request = v.into();
18274 self
18275 }
18276
18277 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18279 self.0.options = v.into();
18280 self
18281 }
18282
18283 pub async fn send(self) -> Result<crate::model::Tool> {
18285 (*self.0.stub)
18286 .update_tool(self.0.request, self.0.options)
18287 .await
18288 .map(crate::Response::into_body)
18289 }
18290
18291 pub fn set_tool<T>(mut self, v: T) -> Self
18295 where
18296 T: std::convert::Into<crate::model::Tool>,
18297 {
18298 self.0.request.tool = std::option::Option::Some(v.into());
18299 self
18300 }
18301
18302 pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
18306 where
18307 T: std::convert::Into<crate::model::Tool>,
18308 {
18309 self.0.request.tool = v.map(|x| x.into());
18310 self
18311 }
18312
18313 pub fn set_update_mask<T>(mut self, v: T) -> Self
18315 where
18316 T: std::convert::Into<wkt::FieldMask>,
18317 {
18318 self.0.request.update_mask = std::option::Option::Some(v.into());
18319 self
18320 }
18321
18322 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18324 where
18325 T: std::convert::Into<wkt::FieldMask>,
18326 {
18327 self.0.request.update_mask = v.map(|x| x.into());
18328 self
18329 }
18330 }
18331
18332 #[doc(hidden)]
18333 impl crate::RequestBuilder for UpdateTool {
18334 fn request_options(&mut self) -> &mut crate::RequestOptions {
18335 &mut self.0.options
18336 }
18337 }
18338
18339 #[derive(Clone, Debug)]
18356 pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
18357
18358 impl DeleteTool {
18359 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18360 Self(RequestBuilder::new(stub))
18361 }
18362
18363 pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
18365 self.0.request = v.into();
18366 self
18367 }
18368
18369 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18371 self.0.options = v.into();
18372 self
18373 }
18374
18375 pub async fn send(self) -> Result<()> {
18377 (*self.0.stub)
18378 .delete_tool(self.0.request, self.0.options)
18379 .await
18380 .map(crate::Response::into_body)
18381 }
18382
18383 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18387 self.0.request.name = v.into();
18388 self
18389 }
18390
18391 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18393 self.0.request.force = v.into();
18394 self
18395 }
18396 }
18397
18398 #[doc(hidden)]
18399 impl crate::RequestBuilder for DeleteTool {
18400 fn request_options(&mut self) -> &mut crate::RequestOptions {
18401 &mut self.0.options
18402 }
18403 }
18404
18405 #[derive(Clone, Debug)]
18426 pub struct ListToolVersions(RequestBuilder<crate::model::ListToolVersionsRequest>);
18427
18428 impl ListToolVersions {
18429 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18430 Self(RequestBuilder::new(stub))
18431 }
18432
18433 pub fn with_request<V: Into<crate::model::ListToolVersionsRequest>>(
18435 mut self,
18436 v: V,
18437 ) -> Self {
18438 self.0.request = v.into();
18439 self
18440 }
18441
18442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18444 self.0.options = v.into();
18445 self
18446 }
18447
18448 pub async fn send(self) -> Result<crate::model::ListToolVersionsResponse> {
18450 (*self.0.stub)
18451 .list_tool_versions(self.0.request, self.0.options)
18452 .await
18453 .map(crate::Response::into_body)
18454 }
18455
18456 pub fn by_page(
18458 self,
18459 ) -> impl google_cloud_gax::paginator::Paginator<
18460 crate::model::ListToolVersionsResponse,
18461 crate::Error,
18462 > {
18463 use std::clone::Clone;
18464 let token = self.0.request.page_token.clone();
18465 let execute = move |token: String| {
18466 let mut builder = self.clone();
18467 builder.0.request = builder.0.request.set_page_token(token);
18468 builder.send()
18469 };
18470 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18471 }
18472
18473 pub fn by_item(
18475 self,
18476 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18477 crate::model::ListToolVersionsResponse,
18478 crate::Error,
18479 > {
18480 use google_cloud_gax::paginator::Paginator;
18481 self.by_page().items()
18482 }
18483
18484 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18488 self.0.request.parent = v.into();
18489 self
18490 }
18491
18492 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18494 self.0.request.page_size = v.into();
18495 self
18496 }
18497
18498 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18500 self.0.request.page_token = v.into();
18501 self
18502 }
18503 }
18504
18505 #[doc(hidden)]
18506 impl crate::RequestBuilder for ListToolVersions {
18507 fn request_options(&mut self) -> &mut crate::RequestOptions {
18508 &mut self.0.options
18509 }
18510 }
18511
18512 #[derive(Clone, Debug)]
18529 pub struct CreateToolVersion(RequestBuilder<crate::model::CreateToolVersionRequest>);
18530
18531 impl CreateToolVersion {
18532 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18533 Self(RequestBuilder::new(stub))
18534 }
18535
18536 pub fn with_request<V: Into<crate::model::CreateToolVersionRequest>>(
18538 mut self,
18539 v: V,
18540 ) -> Self {
18541 self.0.request = v.into();
18542 self
18543 }
18544
18545 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18547 self.0.options = v.into();
18548 self
18549 }
18550
18551 pub async fn send(self) -> Result<crate::model::ToolVersion> {
18553 (*self.0.stub)
18554 .create_tool_version(self.0.request, self.0.options)
18555 .await
18556 .map(crate::Response::into_body)
18557 }
18558
18559 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18563 self.0.request.parent = v.into();
18564 self
18565 }
18566
18567 pub fn set_tool_version<T>(mut self, v: T) -> Self
18571 where
18572 T: std::convert::Into<crate::model::ToolVersion>,
18573 {
18574 self.0.request.tool_version = std::option::Option::Some(v.into());
18575 self
18576 }
18577
18578 pub fn set_or_clear_tool_version<T>(mut self, v: std::option::Option<T>) -> Self
18582 where
18583 T: std::convert::Into<crate::model::ToolVersion>,
18584 {
18585 self.0.request.tool_version = v.map(|x| x.into());
18586 self
18587 }
18588 }
18589
18590 #[doc(hidden)]
18591 impl crate::RequestBuilder for CreateToolVersion {
18592 fn request_options(&mut self) -> &mut crate::RequestOptions {
18593 &mut self.0.options
18594 }
18595 }
18596
18597 #[derive(Clone, Debug)]
18614 pub struct GetToolVersion(RequestBuilder<crate::model::GetToolVersionRequest>);
18615
18616 impl GetToolVersion {
18617 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18618 Self(RequestBuilder::new(stub))
18619 }
18620
18621 pub fn with_request<V: Into<crate::model::GetToolVersionRequest>>(mut self, v: V) -> Self {
18623 self.0.request = v.into();
18624 self
18625 }
18626
18627 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18629 self.0.options = v.into();
18630 self
18631 }
18632
18633 pub async fn send(self) -> Result<crate::model::ToolVersion> {
18635 (*self.0.stub)
18636 .get_tool_version(self.0.request, self.0.options)
18637 .await
18638 .map(crate::Response::into_body)
18639 }
18640
18641 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18645 self.0.request.name = v.into();
18646 self
18647 }
18648 }
18649
18650 #[doc(hidden)]
18651 impl crate::RequestBuilder for GetToolVersion {
18652 fn request_options(&mut self) -> &mut crate::RequestOptions {
18653 &mut self.0.options
18654 }
18655 }
18656
18657 #[derive(Clone, Debug)]
18674 pub struct DeleteToolVersion(RequestBuilder<crate::model::DeleteToolVersionRequest>);
18675
18676 impl DeleteToolVersion {
18677 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18678 Self(RequestBuilder::new(stub))
18679 }
18680
18681 pub fn with_request<V: Into<crate::model::DeleteToolVersionRequest>>(
18683 mut self,
18684 v: V,
18685 ) -> Self {
18686 self.0.request = v.into();
18687 self
18688 }
18689
18690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18692 self.0.options = v.into();
18693 self
18694 }
18695
18696 pub async fn send(self) -> Result<()> {
18698 (*self.0.stub)
18699 .delete_tool_version(self.0.request, self.0.options)
18700 .await
18701 .map(crate::Response::into_body)
18702 }
18703
18704 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18708 self.0.request.name = v.into();
18709 self
18710 }
18711
18712 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
18714 self.0.request.force = v.into();
18715 self
18716 }
18717 }
18718
18719 #[doc(hidden)]
18720 impl crate::RequestBuilder for DeleteToolVersion {
18721 fn request_options(&mut self) -> &mut crate::RequestOptions {
18722 &mut self.0.options
18723 }
18724 }
18725
18726 #[derive(Clone, Debug)]
18743 pub struct RestoreToolVersion(RequestBuilder<crate::model::RestoreToolVersionRequest>);
18744
18745 impl RestoreToolVersion {
18746 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18747 Self(RequestBuilder::new(stub))
18748 }
18749
18750 pub fn with_request<V: Into<crate::model::RestoreToolVersionRequest>>(
18752 mut self,
18753 v: V,
18754 ) -> Self {
18755 self.0.request = v.into();
18756 self
18757 }
18758
18759 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18761 self.0.options = v.into();
18762 self
18763 }
18764
18765 pub async fn send(self) -> Result<crate::model::RestoreToolVersionResponse> {
18767 (*self.0.stub)
18768 .restore_tool_version(self.0.request, self.0.options)
18769 .await
18770 .map(crate::Response::into_body)
18771 }
18772
18773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18777 self.0.request.name = v.into();
18778 self
18779 }
18780 }
18781
18782 #[doc(hidden)]
18783 impl crate::RequestBuilder for RestoreToolVersion {
18784 fn request_options(&mut self) -> &mut crate::RequestOptions {
18785 &mut self.0.options
18786 }
18787 }
18788
18789 #[derive(Clone, Debug)]
18810 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18811
18812 impl ListLocations {
18813 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18814 Self(RequestBuilder::new(stub))
18815 }
18816
18817 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18819 mut self,
18820 v: V,
18821 ) -> Self {
18822 self.0.request = v.into();
18823 self
18824 }
18825
18826 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18828 self.0.options = v.into();
18829 self
18830 }
18831
18832 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18834 (*self.0.stub)
18835 .list_locations(self.0.request, self.0.options)
18836 .await
18837 .map(crate::Response::into_body)
18838 }
18839
18840 pub fn by_page(
18842 self,
18843 ) -> impl google_cloud_gax::paginator::Paginator<
18844 google_cloud_location::model::ListLocationsResponse,
18845 crate::Error,
18846 > {
18847 use std::clone::Clone;
18848 let token = self.0.request.page_token.clone();
18849 let execute = move |token: String| {
18850 let mut builder = self.clone();
18851 builder.0.request = builder.0.request.set_page_token(token);
18852 builder.send()
18853 };
18854 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18855 }
18856
18857 pub fn by_item(
18859 self,
18860 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18861 google_cloud_location::model::ListLocationsResponse,
18862 crate::Error,
18863 > {
18864 use google_cloud_gax::paginator::Paginator;
18865 self.by_page().items()
18866 }
18867
18868 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18870 self.0.request.name = v.into();
18871 self
18872 }
18873
18874 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
18876 self.0.request.filter = v.into();
18877 self
18878 }
18879
18880 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18882 self.0.request.page_size = v.into();
18883 self
18884 }
18885
18886 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18888 self.0.request.page_token = v.into();
18889 self
18890 }
18891 }
18892
18893 #[doc(hidden)]
18894 impl crate::RequestBuilder for ListLocations {
18895 fn request_options(&mut self) -> &mut crate::RequestOptions {
18896 &mut self.0.options
18897 }
18898 }
18899
18900 #[derive(Clone, Debug)]
18917 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
18918
18919 impl GetLocation {
18920 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18921 Self(RequestBuilder::new(stub))
18922 }
18923
18924 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
18926 mut self,
18927 v: V,
18928 ) -> Self {
18929 self.0.request = v.into();
18930 self
18931 }
18932
18933 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18935 self.0.options = v.into();
18936 self
18937 }
18938
18939 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
18941 (*self.0.stub)
18942 .get_location(self.0.request, self.0.options)
18943 .await
18944 .map(crate::Response::into_body)
18945 }
18946
18947 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18949 self.0.request.name = v.into();
18950 self
18951 }
18952 }
18953
18954 #[doc(hidden)]
18955 impl crate::RequestBuilder for GetLocation {
18956 fn request_options(&mut self) -> &mut crate::RequestOptions {
18957 &mut self.0.options
18958 }
18959 }
18960
18961 #[derive(Clone, Debug)]
18982 pub struct ListOperations(
18983 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
18984 );
18985
18986 impl ListOperations {
18987 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
18988 Self(RequestBuilder::new(stub))
18989 }
18990
18991 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
18993 mut self,
18994 v: V,
18995 ) -> Self {
18996 self.0.request = v.into();
18997 self
18998 }
18999
19000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19002 self.0.options = v.into();
19003 self
19004 }
19005
19006 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19008 (*self.0.stub)
19009 .list_operations(self.0.request, self.0.options)
19010 .await
19011 .map(crate::Response::into_body)
19012 }
19013
19014 pub fn by_page(
19016 self,
19017 ) -> impl google_cloud_gax::paginator::Paginator<
19018 google_cloud_longrunning::model::ListOperationsResponse,
19019 crate::Error,
19020 > {
19021 use std::clone::Clone;
19022 let token = self.0.request.page_token.clone();
19023 let execute = move |token: String| {
19024 let mut builder = self.clone();
19025 builder.0.request = builder.0.request.set_page_token(token);
19026 builder.send()
19027 };
19028 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19029 }
19030
19031 pub fn by_item(
19033 self,
19034 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19035 google_cloud_longrunning::model::ListOperationsResponse,
19036 crate::Error,
19037 > {
19038 use google_cloud_gax::paginator::Paginator;
19039 self.by_page().items()
19040 }
19041
19042 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19044 self.0.request.name = v.into();
19045 self
19046 }
19047
19048 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19050 self.0.request.filter = v.into();
19051 self
19052 }
19053
19054 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19056 self.0.request.page_size = v.into();
19057 self
19058 }
19059
19060 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19062 self.0.request.page_token = v.into();
19063 self
19064 }
19065
19066 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19068 self.0.request.return_partial_success = v.into();
19069 self
19070 }
19071 }
19072
19073 #[doc(hidden)]
19074 impl crate::RequestBuilder for ListOperations {
19075 fn request_options(&mut self) -> &mut crate::RequestOptions {
19076 &mut self.0.options
19077 }
19078 }
19079
19080 #[derive(Clone, Debug)]
19097 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19098
19099 impl GetOperation {
19100 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
19101 Self(RequestBuilder::new(stub))
19102 }
19103
19104 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19106 mut self,
19107 v: V,
19108 ) -> Self {
19109 self.0.request = v.into();
19110 self
19111 }
19112
19113 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19115 self.0.options = v.into();
19116 self
19117 }
19118
19119 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19121 (*self.0.stub)
19122 .get_operation(self.0.request, self.0.options)
19123 .await
19124 .map(crate::Response::into_body)
19125 }
19126
19127 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19129 self.0.request.name = v.into();
19130 self
19131 }
19132 }
19133
19134 #[doc(hidden)]
19135 impl crate::RequestBuilder for GetOperation {
19136 fn request_options(&mut self) -> &mut crate::RequestOptions {
19137 &mut self.0.options
19138 }
19139 }
19140
19141 #[derive(Clone, Debug)]
19158 pub struct CancelOperation(
19159 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19160 );
19161
19162 impl CancelOperation {
19163 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
19164 Self(RequestBuilder::new(stub))
19165 }
19166
19167 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19169 mut self,
19170 v: V,
19171 ) -> Self {
19172 self.0.request = v.into();
19173 self
19174 }
19175
19176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19178 self.0.options = v.into();
19179 self
19180 }
19181
19182 pub async fn send(self) -> Result<()> {
19184 (*self.0.stub)
19185 .cancel_operation(self.0.request, self.0.options)
19186 .await
19187 .map(crate::Response::into_body)
19188 }
19189
19190 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19192 self.0.request.name = v.into();
19193 self
19194 }
19195 }
19196
19197 #[doc(hidden)]
19198 impl crate::RequestBuilder for CancelOperation {
19199 fn request_options(&mut self) -> &mut crate::RequestOptions {
19200 &mut self.0.options
19201 }
19202 }
19203}
19204
19205#[cfg(feature = "transition-route-groups")]
19207#[cfg_attr(docsrs, doc(cfg(feature = "transition-route-groups")))]
19208pub mod transition_route_groups {
19209 use crate::Result;
19210
19211 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19225
19226 pub(crate) mod client {
19227 use super::super::super::client::TransitionRouteGroups;
19228 pub struct Factory;
19229 impl crate::ClientFactory for Factory {
19230 type Client = TransitionRouteGroups;
19231 type Credentials = gaxi::options::Credentials;
19232 async fn build(
19233 self,
19234 config: gaxi::options::ClientConfig,
19235 ) -> crate::ClientBuilderResult<Self::Client> {
19236 Self::Client::new(config).await
19237 }
19238 }
19239 }
19240
19241 #[derive(Clone, Debug)]
19243 pub(crate) struct RequestBuilder<R: std::default::Default> {
19244 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19245 request: R,
19246 options: crate::RequestOptions,
19247 }
19248
19249 impl<R> RequestBuilder<R>
19250 where
19251 R: std::default::Default,
19252 {
19253 pub(crate) fn new(
19254 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19255 ) -> Self {
19256 Self {
19257 stub,
19258 request: R::default(),
19259 options: crate::RequestOptions::default(),
19260 }
19261 }
19262 }
19263
19264 #[derive(Clone, Debug)]
19285 pub struct ListTransitionRouteGroups(
19286 RequestBuilder<crate::model::ListTransitionRouteGroupsRequest>,
19287 );
19288
19289 impl ListTransitionRouteGroups {
19290 pub(crate) fn new(
19291 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19292 ) -> Self {
19293 Self(RequestBuilder::new(stub))
19294 }
19295
19296 pub fn with_request<V: Into<crate::model::ListTransitionRouteGroupsRequest>>(
19298 mut self,
19299 v: V,
19300 ) -> Self {
19301 self.0.request = v.into();
19302 self
19303 }
19304
19305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19307 self.0.options = v.into();
19308 self
19309 }
19310
19311 pub async fn send(self) -> Result<crate::model::ListTransitionRouteGroupsResponse> {
19313 (*self.0.stub)
19314 .list_transition_route_groups(self.0.request, self.0.options)
19315 .await
19316 .map(crate::Response::into_body)
19317 }
19318
19319 pub fn by_page(
19321 self,
19322 ) -> impl google_cloud_gax::paginator::Paginator<
19323 crate::model::ListTransitionRouteGroupsResponse,
19324 crate::Error,
19325 > {
19326 use std::clone::Clone;
19327 let token = self.0.request.page_token.clone();
19328 let execute = move |token: String| {
19329 let mut builder = self.clone();
19330 builder.0.request = builder.0.request.set_page_token(token);
19331 builder.send()
19332 };
19333 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19334 }
19335
19336 pub fn by_item(
19338 self,
19339 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19340 crate::model::ListTransitionRouteGroupsResponse,
19341 crate::Error,
19342 > {
19343 use google_cloud_gax::paginator::Paginator;
19344 self.by_page().items()
19345 }
19346
19347 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19351 self.0.request.parent = v.into();
19352 self
19353 }
19354
19355 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19357 self.0.request.page_size = v.into();
19358 self
19359 }
19360
19361 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19363 self.0.request.page_token = v.into();
19364 self
19365 }
19366
19367 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19369 self.0.request.language_code = v.into();
19370 self
19371 }
19372 }
19373
19374 #[doc(hidden)]
19375 impl crate::RequestBuilder for ListTransitionRouteGroups {
19376 fn request_options(&mut self) -> &mut crate::RequestOptions {
19377 &mut self.0.options
19378 }
19379 }
19380
19381 #[derive(Clone, Debug)]
19398 pub struct GetTransitionRouteGroup(
19399 RequestBuilder<crate::model::GetTransitionRouteGroupRequest>,
19400 );
19401
19402 impl GetTransitionRouteGroup {
19403 pub(crate) fn new(
19404 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19405 ) -> Self {
19406 Self(RequestBuilder::new(stub))
19407 }
19408
19409 pub fn with_request<V: Into<crate::model::GetTransitionRouteGroupRequest>>(
19411 mut self,
19412 v: V,
19413 ) -> Self {
19414 self.0.request = v.into();
19415 self
19416 }
19417
19418 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19420 self.0.options = v.into();
19421 self
19422 }
19423
19424 pub async fn send(self) -> Result<crate::model::TransitionRouteGroup> {
19426 (*self.0.stub)
19427 .get_transition_route_group(self.0.request, self.0.options)
19428 .await
19429 .map(crate::Response::into_body)
19430 }
19431
19432 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19436 self.0.request.name = v.into();
19437 self
19438 }
19439
19440 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19442 self.0.request.language_code = v.into();
19443 self
19444 }
19445 }
19446
19447 #[doc(hidden)]
19448 impl crate::RequestBuilder for GetTransitionRouteGroup {
19449 fn request_options(&mut self) -> &mut crate::RequestOptions {
19450 &mut self.0.options
19451 }
19452 }
19453
19454 #[derive(Clone, Debug)]
19471 pub struct CreateTransitionRouteGroup(
19472 RequestBuilder<crate::model::CreateTransitionRouteGroupRequest>,
19473 );
19474
19475 impl CreateTransitionRouteGroup {
19476 pub(crate) fn new(
19477 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19478 ) -> Self {
19479 Self(RequestBuilder::new(stub))
19480 }
19481
19482 pub fn with_request<V: Into<crate::model::CreateTransitionRouteGroupRequest>>(
19484 mut self,
19485 v: V,
19486 ) -> Self {
19487 self.0.request = v.into();
19488 self
19489 }
19490
19491 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19493 self.0.options = v.into();
19494 self
19495 }
19496
19497 pub async fn send(self) -> Result<crate::model::TransitionRouteGroup> {
19499 (*self.0.stub)
19500 .create_transition_route_group(self.0.request, self.0.options)
19501 .await
19502 .map(crate::Response::into_body)
19503 }
19504
19505 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
19509 self.0.request.parent = v.into();
19510 self
19511 }
19512
19513 pub fn set_transition_route_group<T>(mut self, v: T) -> Self
19517 where
19518 T: std::convert::Into<crate::model::TransitionRouteGroup>,
19519 {
19520 self.0.request.transition_route_group = std::option::Option::Some(v.into());
19521 self
19522 }
19523
19524 pub fn set_or_clear_transition_route_group<T>(mut self, v: std::option::Option<T>) -> Self
19528 where
19529 T: std::convert::Into<crate::model::TransitionRouteGroup>,
19530 {
19531 self.0.request.transition_route_group = v.map(|x| x.into());
19532 self
19533 }
19534
19535 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19537 self.0.request.language_code = v.into();
19538 self
19539 }
19540 }
19541
19542 #[doc(hidden)]
19543 impl crate::RequestBuilder for CreateTransitionRouteGroup {
19544 fn request_options(&mut self) -> &mut crate::RequestOptions {
19545 &mut self.0.options
19546 }
19547 }
19548
19549 #[derive(Clone, Debug)]
19566 pub struct UpdateTransitionRouteGroup(
19567 RequestBuilder<crate::model::UpdateTransitionRouteGroupRequest>,
19568 );
19569
19570 impl UpdateTransitionRouteGroup {
19571 pub(crate) fn new(
19572 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19573 ) -> Self {
19574 Self(RequestBuilder::new(stub))
19575 }
19576
19577 pub fn with_request<V: Into<crate::model::UpdateTransitionRouteGroupRequest>>(
19579 mut self,
19580 v: V,
19581 ) -> Self {
19582 self.0.request = v.into();
19583 self
19584 }
19585
19586 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19588 self.0.options = v.into();
19589 self
19590 }
19591
19592 pub async fn send(self) -> Result<crate::model::TransitionRouteGroup> {
19594 (*self.0.stub)
19595 .update_transition_route_group(self.0.request, self.0.options)
19596 .await
19597 .map(crate::Response::into_body)
19598 }
19599
19600 pub fn set_transition_route_group<T>(mut self, v: T) -> Self
19604 where
19605 T: std::convert::Into<crate::model::TransitionRouteGroup>,
19606 {
19607 self.0.request.transition_route_group = std::option::Option::Some(v.into());
19608 self
19609 }
19610
19611 pub fn set_or_clear_transition_route_group<T>(mut self, v: std::option::Option<T>) -> Self
19615 where
19616 T: std::convert::Into<crate::model::TransitionRouteGroup>,
19617 {
19618 self.0.request.transition_route_group = v.map(|x| x.into());
19619 self
19620 }
19621
19622 pub fn set_update_mask<T>(mut self, v: T) -> Self
19624 where
19625 T: std::convert::Into<wkt::FieldMask>,
19626 {
19627 self.0.request.update_mask = std::option::Option::Some(v.into());
19628 self
19629 }
19630
19631 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
19633 where
19634 T: std::convert::Into<wkt::FieldMask>,
19635 {
19636 self.0.request.update_mask = v.map(|x| x.into());
19637 self
19638 }
19639
19640 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
19642 self.0.request.language_code = v.into();
19643 self
19644 }
19645 }
19646
19647 #[doc(hidden)]
19648 impl crate::RequestBuilder for UpdateTransitionRouteGroup {
19649 fn request_options(&mut self) -> &mut crate::RequestOptions {
19650 &mut self.0.options
19651 }
19652 }
19653
19654 #[derive(Clone, Debug)]
19671 pub struct DeleteTransitionRouteGroup(
19672 RequestBuilder<crate::model::DeleteTransitionRouteGroupRequest>,
19673 );
19674
19675 impl DeleteTransitionRouteGroup {
19676 pub(crate) fn new(
19677 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19678 ) -> Self {
19679 Self(RequestBuilder::new(stub))
19680 }
19681
19682 pub fn with_request<V: Into<crate::model::DeleteTransitionRouteGroupRequest>>(
19684 mut self,
19685 v: V,
19686 ) -> Self {
19687 self.0.request = v.into();
19688 self
19689 }
19690
19691 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19693 self.0.options = v.into();
19694 self
19695 }
19696
19697 pub async fn send(self) -> Result<()> {
19699 (*self.0.stub)
19700 .delete_transition_route_group(self.0.request, self.0.options)
19701 .await
19702 .map(crate::Response::into_body)
19703 }
19704
19705 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19709 self.0.request.name = v.into();
19710 self
19711 }
19712
19713 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
19715 self.0.request.force = v.into();
19716 self
19717 }
19718 }
19719
19720 #[doc(hidden)]
19721 impl crate::RequestBuilder for DeleteTransitionRouteGroup {
19722 fn request_options(&mut self) -> &mut crate::RequestOptions {
19723 &mut self.0.options
19724 }
19725 }
19726
19727 #[derive(Clone, Debug)]
19748 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19749
19750 impl ListLocations {
19751 pub(crate) fn new(
19752 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19753 ) -> Self {
19754 Self(RequestBuilder::new(stub))
19755 }
19756
19757 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19759 mut self,
19760 v: V,
19761 ) -> Self {
19762 self.0.request = v.into();
19763 self
19764 }
19765
19766 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19768 self.0.options = v.into();
19769 self
19770 }
19771
19772 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19774 (*self.0.stub)
19775 .list_locations(self.0.request, self.0.options)
19776 .await
19777 .map(crate::Response::into_body)
19778 }
19779
19780 pub fn by_page(
19782 self,
19783 ) -> impl google_cloud_gax::paginator::Paginator<
19784 google_cloud_location::model::ListLocationsResponse,
19785 crate::Error,
19786 > {
19787 use std::clone::Clone;
19788 let token = self.0.request.page_token.clone();
19789 let execute = move |token: String| {
19790 let mut builder = self.clone();
19791 builder.0.request = builder.0.request.set_page_token(token);
19792 builder.send()
19793 };
19794 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19795 }
19796
19797 pub fn by_item(
19799 self,
19800 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19801 google_cloud_location::model::ListLocationsResponse,
19802 crate::Error,
19803 > {
19804 use google_cloud_gax::paginator::Paginator;
19805 self.by_page().items()
19806 }
19807
19808 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19810 self.0.request.name = v.into();
19811 self
19812 }
19813
19814 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19816 self.0.request.filter = v.into();
19817 self
19818 }
19819
19820 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19822 self.0.request.page_size = v.into();
19823 self
19824 }
19825
19826 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19828 self.0.request.page_token = v.into();
19829 self
19830 }
19831 }
19832
19833 #[doc(hidden)]
19834 impl crate::RequestBuilder for ListLocations {
19835 fn request_options(&mut self) -> &mut crate::RequestOptions {
19836 &mut self.0.options
19837 }
19838 }
19839
19840 #[derive(Clone, Debug)]
19857 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19858
19859 impl GetLocation {
19860 pub(crate) fn new(
19861 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19862 ) -> Self {
19863 Self(RequestBuilder::new(stub))
19864 }
19865
19866 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19868 mut self,
19869 v: V,
19870 ) -> Self {
19871 self.0.request = v.into();
19872 self
19873 }
19874
19875 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19877 self.0.options = v.into();
19878 self
19879 }
19880
19881 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19883 (*self.0.stub)
19884 .get_location(self.0.request, self.0.options)
19885 .await
19886 .map(crate::Response::into_body)
19887 }
19888
19889 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19891 self.0.request.name = v.into();
19892 self
19893 }
19894 }
19895
19896 #[doc(hidden)]
19897 impl crate::RequestBuilder for GetLocation {
19898 fn request_options(&mut self) -> &mut crate::RequestOptions {
19899 &mut self.0.options
19900 }
19901 }
19902
19903 #[derive(Clone, Debug)]
19924 pub struct ListOperations(
19925 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19926 );
19927
19928 impl ListOperations {
19929 pub(crate) fn new(
19930 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
19931 ) -> Self {
19932 Self(RequestBuilder::new(stub))
19933 }
19934
19935 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19937 mut self,
19938 v: V,
19939 ) -> Self {
19940 self.0.request = v.into();
19941 self
19942 }
19943
19944 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19946 self.0.options = v.into();
19947 self
19948 }
19949
19950 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19952 (*self.0.stub)
19953 .list_operations(self.0.request, self.0.options)
19954 .await
19955 .map(crate::Response::into_body)
19956 }
19957
19958 pub fn by_page(
19960 self,
19961 ) -> impl google_cloud_gax::paginator::Paginator<
19962 google_cloud_longrunning::model::ListOperationsResponse,
19963 crate::Error,
19964 > {
19965 use std::clone::Clone;
19966 let token = self.0.request.page_token.clone();
19967 let execute = move |token: String| {
19968 let mut builder = self.clone();
19969 builder.0.request = builder.0.request.set_page_token(token);
19970 builder.send()
19971 };
19972 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19973 }
19974
19975 pub fn by_item(
19977 self,
19978 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19979 google_cloud_longrunning::model::ListOperationsResponse,
19980 crate::Error,
19981 > {
19982 use google_cloud_gax::paginator::Paginator;
19983 self.by_page().items()
19984 }
19985
19986 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19988 self.0.request.name = v.into();
19989 self
19990 }
19991
19992 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19994 self.0.request.filter = v.into();
19995 self
19996 }
19997
19998 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20000 self.0.request.page_size = v.into();
20001 self
20002 }
20003
20004 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20006 self.0.request.page_token = v.into();
20007 self
20008 }
20009
20010 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20012 self.0.request.return_partial_success = v.into();
20013 self
20014 }
20015 }
20016
20017 #[doc(hidden)]
20018 impl crate::RequestBuilder for ListOperations {
20019 fn request_options(&mut self) -> &mut crate::RequestOptions {
20020 &mut self.0.options
20021 }
20022 }
20023
20024 #[derive(Clone, Debug)]
20041 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20042
20043 impl GetOperation {
20044 pub(crate) fn new(
20045 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
20046 ) -> Self {
20047 Self(RequestBuilder::new(stub))
20048 }
20049
20050 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20052 mut self,
20053 v: V,
20054 ) -> Self {
20055 self.0.request = v.into();
20056 self
20057 }
20058
20059 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20061 self.0.options = v.into();
20062 self
20063 }
20064
20065 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20067 (*self.0.stub)
20068 .get_operation(self.0.request, self.0.options)
20069 .await
20070 .map(crate::Response::into_body)
20071 }
20072
20073 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20075 self.0.request.name = v.into();
20076 self
20077 }
20078 }
20079
20080 #[doc(hidden)]
20081 impl crate::RequestBuilder for GetOperation {
20082 fn request_options(&mut self) -> &mut crate::RequestOptions {
20083 &mut self.0.options
20084 }
20085 }
20086
20087 #[derive(Clone, Debug)]
20104 pub struct CancelOperation(
20105 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20106 );
20107
20108 impl CancelOperation {
20109 pub(crate) fn new(
20110 stub: std::sync::Arc<dyn super::super::stub::dynamic::TransitionRouteGroups>,
20111 ) -> Self {
20112 Self(RequestBuilder::new(stub))
20113 }
20114
20115 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20117 mut self,
20118 v: V,
20119 ) -> Self {
20120 self.0.request = v.into();
20121 self
20122 }
20123
20124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20126 self.0.options = v.into();
20127 self
20128 }
20129
20130 pub async fn send(self) -> Result<()> {
20132 (*self.0.stub)
20133 .cancel_operation(self.0.request, self.0.options)
20134 .await
20135 .map(crate::Response::into_body)
20136 }
20137
20138 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20140 self.0.request.name = v.into();
20141 self
20142 }
20143 }
20144
20145 #[doc(hidden)]
20146 impl crate::RequestBuilder for CancelOperation {
20147 fn request_options(&mut self) -> &mut crate::RequestOptions {
20148 &mut self.0.options
20149 }
20150 }
20151}
20152
20153#[cfg(feature = "versions")]
20155#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
20156pub mod versions {
20157 use crate::Result;
20158
20159 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20173
20174 pub(crate) mod client {
20175 use super::super::super::client::Versions;
20176 pub struct Factory;
20177 impl crate::ClientFactory for Factory {
20178 type Client = Versions;
20179 type Credentials = gaxi::options::Credentials;
20180 async fn build(
20181 self,
20182 config: gaxi::options::ClientConfig,
20183 ) -> crate::ClientBuilderResult<Self::Client> {
20184 Self::Client::new(config).await
20185 }
20186 }
20187 }
20188
20189 #[derive(Clone, Debug)]
20191 pub(crate) struct RequestBuilder<R: std::default::Default> {
20192 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
20193 request: R,
20194 options: crate::RequestOptions,
20195 }
20196
20197 impl<R> RequestBuilder<R>
20198 where
20199 R: std::default::Default,
20200 {
20201 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20202 Self {
20203 stub,
20204 request: R::default(),
20205 options: crate::RequestOptions::default(),
20206 }
20207 }
20208 }
20209
20210 #[derive(Clone, Debug)]
20231 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
20232
20233 impl ListVersions {
20234 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20235 Self(RequestBuilder::new(stub))
20236 }
20237
20238 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
20240 self.0.request = v.into();
20241 self
20242 }
20243
20244 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20246 self.0.options = v.into();
20247 self
20248 }
20249
20250 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
20252 (*self.0.stub)
20253 .list_versions(self.0.request, self.0.options)
20254 .await
20255 .map(crate::Response::into_body)
20256 }
20257
20258 pub fn by_page(
20260 self,
20261 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
20262 {
20263 use std::clone::Clone;
20264 let token = self.0.request.page_token.clone();
20265 let execute = move |token: String| {
20266 let mut builder = self.clone();
20267 builder.0.request = builder.0.request.set_page_token(token);
20268 builder.send()
20269 };
20270 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20271 }
20272
20273 pub fn by_item(
20275 self,
20276 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20277 crate::model::ListVersionsResponse,
20278 crate::Error,
20279 > {
20280 use google_cloud_gax::paginator::Paginator;
20281 self.by_page().items()
20282 }
20283
20284 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20288 self.0.request.parent = v.into();
20289 self
20290 }
20291
20292 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20294 self.0.request.page_size = v.into();
20295 self
20296 }
20297
20298 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20300 self.0.request.page_token = v.into();
20301 self
20302 }
20303 }
20304
20305 #[doc(hidden)]
20306 impl crate::RequestBuilder for ListVersions {
20307 fn request_options(&mut self) -> &mut crate::RequestOptions {
20308 &mut self.0.options
20309 }
20310 }
20311
20312 #[derive(Clone, Debug)]
20329 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
20330
20331 impl GetVersion {
20332 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20333 Self(RequestBuilder::new(stub))
20334 }
20335
20336 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
20338 self.0.request = v.into();
20339 self
20340 }
20341
20342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20344 self.0.options = v.into();
20345 self
20346 }
20347
20348 pub async fn send(self) -> Result<crate::model::Version> {
20350 (*self.0.stub)
20351 .get_version(self.0.request, self.0.options)
20352 .await
20353 .map(crate::Response::into_body)
20354 }
20355
20356 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20360 self.0.request.name = v.into();
20361 self
20362 }
20363 }
20364
20365 #[doc(hidden)]
20366 impl crate::RequestBuilder for GetVersion {
20367 fn request_options(&mut self) -> &mut crate::RequestOptions {
20368 &mut self.0.options
20369 }
20370 }
20371
20372 #[derive(Clone, Debug)]
20390 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
20391
20392 impl CreateVersion {
20393 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20394 Self(RequestBuilder::new(stub))
20395 }
20396
20397 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
20399 self.0.request = v.into();
20400 self
20401 }
20402
20403 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20405 self.0.options = v.into();
20406 self
20407 }
20408
20409 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20416 (*self.0.stub)
20417 .create_version(self.0.request, self.0.options)
20418 .await
20419 .map(crate::Response::into_body)
20420 }
20421
20422 pub fn poller(
20424 self,
20425 ) -> impl google_cloud_lro::Poller<
20426 crate::model::Version,
20427 crate::model::CreateVersionOperationMetadata,
20428 > {
20429 type Operation = google_cloud_lro::internal::Operation<
20430 crate::model::Version,
20431 crate::model::CreateVersionOperationMetadata,
20432 >;
20433 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20434 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20435
20436 let stub = self.0.stub.clone();
20437 let mut options = self.0.options.clone();
20438 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20439 let query = move |name| {
20440 let stub = stub.clone();
20441 let options = options.clone();
20442 async {
20443 let op = GetOperation::new(stub)
20444 .set_name(name)
20445 .with_options(options)
20446 .send()
20447 .await?;
20448 Ok(Operation::new(op))
20449 }
20450 };
20451
20452 let start = move || async {
20453 let op = self.send().await?;
20454 Ok(Operation::new(op))
20455 };
20456
20457 google_cloud_lro::internal::new_poller(
20458 polling_error_policy,
20459 polling_backoff_policy,
20460 start,
20461 query,
20462 )
20463 }
20464
20465 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20469 self.0.request.parent = v.into();
20470 self
20471 }
20472
20473 pub fn set_version<T>(mut self, v: T) -> Self
20477 where
20478 T: std::convert::Into<crate::model::Version>,
20479 {
20480 self.0.request.version = std::option::Option::Some(v.into());
20481 self
20482 }
20483
20484 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
20488 where
20489 T: std::convert::Into<crate::model::Version>,
20490 {
20491 self.0.request.version = v.map(|x| x.into());
20492 self
20493 }
20494 }
20495
20496 #[doc(hidden)]
20497 impl crate::RequestBuilder for CreateVersion {
20498 fn request_options(&mut self) -> &mut crate::RequestOptions {
20499 &mut self.0.options
20500 }
20501 }
20502
20503 #[derive(Clone, Debug)]
20520 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
20521
20522 impl UpdateVersion {
20523 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20524 Self(RequestBuilder::new(stub))
20525 }
20526
20527 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
20529 self.0.request = v.into();
20530 self
20531 }
20532
20533 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20535 self.0.options = v.into();
20536 self
20537 }
20538
20539 pub async fn send(self) -> Result<crate::model::Version> {
20541 (*self.0.stub)
20542 .update_version(self.0.request, self.0.options)
20543 .await
20544 .map(crate::Response::into_body)
20545 }
20546
20547 pub fn set_version<T>(mut self, v: T) -> Self
20551 where
20552 T: std::convert::Into<crate::model::Version>,
20553 {
20554 self.0.request.version = std::option::Option::Some(v.into());
20555 self
20556 }
20557
20558 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
20562 where
20563 T: std::convert::Into<crate::model::Version>,
20564 {
20565 self.0.request.version = v.map(|x| x.into());
20566 self
20567 }
20568
20569 pub fn set_update_mask<T>(mut self, v: T) -> Self
20573 where
20574 T: std::convert::Into<wkt::FieldMask>,
20575 {
20576 self.0.request.update_mask = std::option::Option::Some(v.into());
20577 self
20578 }
20579
20580 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20584 where
20585 T: std::convert::Into<wkt::FieldMask>,
20586 {
20587 self.0.request.update_mask = v.map(|x| x.into());
20588 self
20589 }
20590 }
20591
20592 #[doc(hidden)]
20593 impl crate::RequestBuilder for UpdateVersion {
20594 fn request_options(&mut self) -> &mut crate::RequestOptions {
20595 &mut self.0.options
20596 }
20597 }
20598
20599 #[derive(Clone, Debug)]
20616 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
20617
20618 impl DeleteVersion {
20619 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20620 Self(RequestBuilder::new(stub))
20621 }
20622
20623 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
20625 self.0.request = v.into();
20626 self
20627 }
20628
20629 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20631 self.0.options = v.into();
20632 self
20633 }
20634
20635 pub async fn send(self) -> Result<()> {
20637 (*self.0.stub)
20638 .delete_version(self.0.request, self.0.options)
20639 .await
20640 .map(crate::Response::into_body)
20641 }
20642
20643 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20647 self.0.request.name = v.into();
20648 self
20649 }
20650 }
20651
20652 #[doc(hidden)]
20653 impl crate::RequestBuilder for DeleteVersion {
20654 fn request_options(&mut self) -> &mut crate::RequestOptions {
20655 &mut self.0.options
20656 }
20657 }
20658
20659 #[derive(Clone, Debug)]
20677 pub struct LoadVersion(RequestBuilder<crate::model::LoadVersionRequest>);
20678
20679 impl LoadVersion {
20680 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20681 Self(RequestBuilder::new(stub))
20682 }
20683
20684 pub fn with_request<V: Into<crate::model::LoadVersionRequest>>(mut self, v: V) -> Self {
20686 self.0.request = v.into();
20687 self
20688 }
20689
20690 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20692 self.0.options = v.into();
20693 self
20694 }
20695
20696 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20703 (*self.0.stub)
20704 .load_version(self.0.request, self.0.options)
20705 .await
20706 .map(crate::Response::into_body)
20707 }
20708
20709 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
20711 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
20712 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
20713 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
20714
20715 let stub = self.0.stub.clone();
20716 let mut options = self.0.options.clone();
20717 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
20718 let query = move |name| {
20719 let stub = stub.clone();
20720 let options = options.clone();
20721 async {
20722 let op = GetOperation::new(stub)
20723 .set_name(name)
20724 .with_options(options)
20725 .send()
20726 .await?;
20727 Ok(Operation::new(op))
20728 }
20729 };
20730
20731 let start = move || async {
20732 let op = self.send().await?;
20733 Ok(Operation::new(op))
20734 };
20735
20736 google_cloud_lro::internal::new_unit_response_poller(
20737 polling_error_policy,
20738 polling_backoff_policy,
20739 start,
20740 query,
20741 )
20742 }
20743
20744 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20748 self.0.request.name = v.into();
20749 self
20750 }
20751
20752 pub fn set_allow_override_agent_resources<T: Into<bool>>(mut self, v: T) -> Self {
20754 self.0.request.allow_override_agent_resources = v.into();
20755 self
20756 }
20757 }
20758
20759 #[doc(hidden)]
20760 impl crate::RequestBuilder for LoadVersion {
20761 fn request_options(&mut self) -> &mut crate::RequestOptions {
20762 &mut self.0.options
20763 }
20764 }
20765
20766 #[derive(Clone, Debug)]
20783 pub struct CompareVersions(RequestBuilder<crate::model::CompareVersionsRequest>);
20784
20785 impl CompareVersions {
20786 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20787 Self(RequestBuilder::new(stub))
20788 }
20789
20790 pub fn with_request<V: Into<crate::model::CompareVersionsRequest>>(mut self, v: V) -> Self {
20792 self.0.request = v.into();
20793 self
20794 }
20795
20796 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20798 self.0.options = v.into();
20799 self
20800 }
20801
20802 pub async fn send(self) -> Result<crate::model::CompareVersionsResponse> {
20804 (*self.0.stub)
20805 .compare_versions(self.0.request, self.0.options)
20806 .await
20807 .map(crate::Response::into_body)
20808 }
20809
20810 pub fn set_base_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
20814 self.0.request.base_version = v.into();
20815 self
20816 }
20817
20818 pub fn set_target_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
20822 self.0.request.target_version = v.into();
20823 self
20824 }
20825
20826 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
20828 self.0.request.language_code = v.into();
20829 self
20830 }
20831 }
20832
20833 #[doc(hidden)]
20834 impl crate::RequestBuilder for CompareVersions {
20835 fn request_options(&mut self) -> &mut crate::RequestOptions {
20836 &mut self.0.options
20837 }
20838 }
20839
20840 #[derive(Clone, Debug)]
20861 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20862
20863 impl ListLocations {
20864 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20865 Self(RequestBuilder::new(stub))
20866 }
20867
20868 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20870 mut self,
20871 v: V,
20872 ) -> Self {
20873 self.0.request = v.into();
20874 self
20875 }
20876
20877 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20879 self.0.options = v.into();
20880 self
20881 }
20882
20883 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20885 (*self.0.stub)
20886 .list_locations(self.0.request, self.0.options)
20887 .await
20888 .map(crate::Response::into_body)
20889 }
20890
20891 pub fn by_page(
20893 self,
20894 ) -> impl google_cloud_gax::paginator::Paginator<
20895 google_cloud_location::model::ListLocationsResponse,
20896 crate::Error,
20897 > {
20898 use std::clone::Clone;
20899 let token = self.0.request.page_token.clone();
20900 let execute = move |token: String| {
20901 let mut builder = self.clone();
20902 builder.0.request = builder.0.request.set_page_token(token);
20903 builder.send()
20904 };
20905 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20906 }
20907
20908 pub fn by_item(
20910 self,
20911 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20912 google_cloud_location::model::ListLocationsResponse,
20913 crate::Error,
20914 > {
20915 use google_cloud_gax::paginator::Paginator;
20916 self.by_page().items()
20917 }
20918
20919 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20921 self.0.request.name = v.into();
20922 self
20923 }
20924
20925 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20927 self.0.request.filter = v.into();
20928 self
20929 }
20930
20931 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20933 self.0.request.page_size = v.into();
20934 self
20935 }
20936
20937 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20939 self.0.request.page_token = v.into();
20940 self
20941 }
20942 }
20943
20944 #[doc(hidden)]
20945 impl crate::RequestBuilder for ListLocations {
20946 fn request_options(&mut self) -> &mut crate::RequestOptions {
20947 &mut self.0.options
20948 }
20949 }
20950
20951 #[derive(Clone, Debug)]
20968 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20969
20970 impl GetLocation {
20971 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
20972 Self(RequestBuilder::new(stub))
20973 }
20974
20975 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20977 mut self,
20978 v: V,
20979 ) -> Self {
20980 self.0.request = v.into();
20981 self
20982 }
20983
20984 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20986 self.0.options = v.into();
20987 self
20988 }
20989
20990 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20992 (*self.0.stub)
20993 .get_location(self.0.request, self.0.options)
20994 .await
20995 .map(crate::Response::into_body)
20996 }
20997
20998 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21000 self.0.request.name = v.into();
21001 self
21002 }
21003 }
21004
21005 #[doc(hidden)]
21006 impl crate::RequestBuilder for GetLocation {
21007 fn request_options(&mut self) -> &mut crate::RequestOptions {
21008 &mut self.0.options
21009 }
21010 }
21011
21012 #[derive(Clone, Debug)]
21033 pub struct ListOperations(
21034 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21035 );
21036
21037 impl ListOperations {
21038 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
21039 Self(RequestBuilder::new(stub))
21040 }
21041
21042 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21044 mut self,
21045 v: V,
21046 ) -> Self {
21047 self.0.request = v.into();
21048 self
21049 }
21050
21051 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21053 self.0.options = v.into();
21054 self
21055 }
21056
21057 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21059 (*self.0.stub)
21060 .list_operations(self.0.request, self.0.options)
21061 .await
21062 .map(crate::Response::into_body)
21063 }
21064
21065 pub fn by_page(
21067 self,
21068 ) -> impl google_cloud_gax::paginator::Paginator<
21069 google_cloud_longrunning::model::ListOperationsResponse,
21070 crate::Error,
21071 > {
21072 use std::clone::Clone;
21073 let token = self.0.request.page_token.clone();
21074 let execute = move |token: String| {
21075 let mut builder = self.clone();
21076 builder.0.request = builder.0.request.set_page_token(token);
21077 builder.send()
21078 };
21079 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21080 }
21081
21082 pub fn by_item(
21084 self,
21085 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21086 google_cloud_longrunning::model::ListOperationsResponse,
21087 crate::Error,
21088 > {
21089 use google_cloud_gax::paginator::Paginator;
21090 self.by_page().items()
21091 }
21092
21093 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21095 self.0.request.name = v.into();
21096 self
21097 }
21098
21099 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21101 self.0.request.filter = v.into();
21102 self
21103 }
21104
21105 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21107 self.0.request.page_size = v.into();
21108 self
21109 }
21110
21111 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21113 self.0.request.page_token = v.into();
21114 self
21115 }
21116
21117 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21119 self.0.request.return_partial_success = v.into();
21120 self
21121 }
21122 }
21123
21124 #[doc(hidden)]
21125 impl crate::RequestBuilder for ListOperations {
21126 fn request_options(&mut self) -> &mut crate::RequestOptions {
21127 &mut self.0.options
21128 }
21129 }
21130
21131 #[derive(Clone, Debug)]
21148 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21149
21150 impl GetOperation {
21151 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
21152 Self(RequestBuilder::new(stub))
21153 }
21154
21155 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21157 mut self,
21158 v: V,
21159 ) -> Self {
21160 self.0.request = v.into();
21161 self
21162 }
21163
21164 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21166 self.0.options = v.into();
21167 self
21168 }
21169
21170 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21172 (*self.0.stub)
21173 .get_operation(self.0.request, self.0.options)
21174 .await
21175 .map(crate::Response::into_body)
21176 }
21177
21178 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21180 self.0.request.name = v.into();
21181 self
21182 }
21183 }
21184
21185 #[doc(hidden)]
21186 impl crate::RequestBuilder for GetOperation {
21187 fn request_options(&mut self) -> &mut crate::RequestOptions {
21188 &mut self.0.options
21189 }
21190 }
21191
21192 #[derive(Clone, Debug)]
21209 pub struct CancelOperation(
21210 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21211 );
21212
21213 impl CancelOperation {
21214 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
21215 Self(RequestBuilder::new(stub))
21216 }
21217
21218 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21220 mut self,
21221 v: V,
21222 ) -> Self {
21223 self.0.request = v.into();
21224 self
21225 }
21226
21227 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21229 self.0.options = v.into();
21230 self
21231 }
21232
21233 pub async fn send(self) -> Result<()> {
21235 (*self.0.stub)
21236 .cancel_operation(self.0.request, self.0.options)
21237 .await
21238 .map(crate::Response::into_body)
21239 }
21240
21241 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21243 self.0.request.name = v.into();
21244 self
21245 }
21246 }
21247
21248 #[doc(hidden)]
21249 impl crate::RequestBuilder for CancelOperation {
21250 fn request_options(&mut self) -> &mut crate::RequestOptions {
21251 &mut self.0.options
21252 }
21253 }
21254}
21255
21256#[cfg(feature = "webhooks")]
21258#[cfg_attr(docsrs, doc(cfg(feature = "webhooks")))]
21259pub mod webhooks {
21260 use crate::Result;
21261
21262 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21276
21277 pub(crate) mod client {
21278 use super::super::super::client::Webhooks;
21279 pub struct Factory;
21280 impl crate::ClientFactory for Factory {
21281 type Client = Webhooks;
21282 type Credentials = gaxi::options::Credentials;
21283 async fn build(
21284 self,
21285 config: gaxi::options::ClientConfig,
21286 ) -> crate::ClientBuilderResult<Self::Client> {
21287 Self::Client::new(config).await
21288 }
21289 }
21290 }
21291
21292 #[derive(Clone, Debug)]
21294 pub(crate) struct RequestBuilder<R: std::default::Default> {
21295 stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>,
21296 request: R,
21297 options: crate::RequestOptions,
21298 }
21299
21300 impl<R> RequestBuilder<R>
21301 where
21302 R: std::default::Default,
21303 {
21304 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21305 Self {
21306 stub,
21307 request: R::default(),
21308 options: crate::RequestOptions::default(),
21309 }
21310 }
21311 }
21312
21313 #[derive(Clone, Debug)]
21334 pub struct ListWebhooks(RequestBuilder<crate::model::ListWebhooksRequest>);
21335
21336 impl ListWebhooks {
21337 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21338 Self(RequestBuilder::new(stub))
21339 }
21340
21341 pub fn with_request<V: Into<crate::model::ListWebhooksRequest>>(mut self, v: V) -> Self {
21343 self.0.request = v.into();
21344 self
21345 }
21346
21347 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21349 self.0.options = v.into();
21350 self
21351 }
21352
21353 pub async fn send(self) -> Result<crate::model::ListWebhooksResponse> {
21355 (*self.0.stub)
21356 .list_webhooks(self.0.request, self.0.options)
21357 .await
21358 .map(crate::Response::into_body)
21359 }
21360
21361 pub fn by_page(
21363 self,
21364 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListWebhooksResponse, crate::Error>
21365 {
21366 use std::clone::Clone;
21367 let token = self.0.request.page_token.clone();
21368 let execute = move |token: String| {
21369 let mut builder = self.clone();
21370 builder.0.request = builder.0.request.set_page_token(token);
21371 builder.send()
21372 };
21373 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21374 }
21375
21376 pub fn by_item(
21378 self,
21379 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21380 crate::model::ListWebhooksResponse,
21381 crate::Error,
21382 > {
21383 use google_cloud_gax::paginator::Paginator;
21384 self.by_page().items()
21385 }
21386
21387 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21391 self.0.request.parent = v.into();
21392 self
21393 }
21394
21395 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21397 self.0.request.page_size = v.into();
21398 self
21399 }
21400
21401 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21403 self.0.request.page_token = v.into();
21404 self
21405 }
21406 }
21407
21408 #[doc(hidden)]
21409 impl crate::RequestBuilder for ListWebhooks {
21410 fn request_options(&mut self) -> &mut crate::RequestOptions {
21411 &mut self.0.options
21412 }
21413 }
21414
21415 #[derive(Clone, Debug)]
21432 pub struct GetWebhook(RequestBuilder<crate::model::GetWebhookRequest>);
21433
21434 impl GetWebhook {
21435 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21436 Self(RequestBuilder::new(stub))
21437 }
21438
21439 pub fn with_request<V: Into<crate::model::GetWebhookRequest>>(mut self, v: V) -> Self {
21441 self.0.request = v.into();
21442 self
21443 }
21444
21445 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21447 self.0.options = v.into();
21448 self
21449 }
21450
21451 pub async fn send(self) -> Result<crate::model::Webhook> {
21453 (*self.0.stub)
21454 .get_webhook(self.0.request, self.0.options)
21455 .await
21456 .map(crate::Response::into_body)
21457 }
21458
21459 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21463 self.0.request.name = v.into();
21464 self
21465 }
21466 }
21467
21468 #[doc(hidden)]
21469 impl crate::RequestBuilder for GetWebhook {
21470 fn request_options(&mut self) -> &mut crate::RequestOptions {
21471 &mut self.0.options
21472 }
21473 }
21474
21475 #[derive(Clone, Debug)]
21492 pub struct CreateWebhook(RequestBuilder<crate::model::CreateWebhookRequest>);
21493
21494 impl CreateWebhook {
21495 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21496 Self(RequestBuilder::new(stub))
21497 }
21498
21499 pub fn with_request<V: Into<crate::model::CreateWebhookRequest>>(mut self, v: V) -> Self {
21501 self.0.request = v.into();
21502 self
21503 }
21504
21505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21507 self.0.options = v.into();
21508 self
21509 }
21510
21511 pub async fn send(self) -> Result<crate::model::Webhook> {
21513 (*self.0.stub)
21514 .create_webhook(self.0.request, self.0.options)
21515 .await
21516 .map(crate::Response::into_body)
21517 }
21518
21519 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21523 self.0.request.parent = v.into();
21524 self
21525 }
21526
21527 pub fn set_webhook<T>(mut self, v: T) -> Self
21531 where
21532 T: std::convert::Into<crate::model::Webhook>,
21533 {
21534 self.0.request.webhook = std::option::Option::Some(v.into());
21535 self
21536 }
21537
21538 pub fn set_or_clear_webhook<T>(mut self, v: std::option::Option<T>) -> Self
21542 where
21543 T: std::convert::Into<crate::model::Webhook>,
21544 {
21545 self.0.request.webhook = v.map(|x| x.into());
21546 self
21547 }
21548 }
21549
21550 #[doc(hidden)]
21551 impl crate::RequestBuilder for CreateWebhook {
21552 fn request_options(&mut self) -> &mut crate::RequestOptions {
21553 &mut self.0.options
21554 }
21555 }
21556
21557 #[derive(Clone, Debug)]
21574 pub struct UpdateWebhook(RequestBuilder<crate::model::UpdateWebhookRequest>);
21575
21576 impl UpdateWebhook {
21577 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21578 Self(RequestBuilder::new(stub))
21579 }
21580
21581 pub fn with_request<V: Into<crate::model::UpdateWebhookRequest>>(mut self, v: V) -> Self {
21583 self.0.request = v.into();
21584 self
21585 }
21586
21587 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21589 self.0.options = v.into();
21590 self
21591 }
21592
21593 pub async fn send(self) -> Result<crate::model::Webhook> {
21595 (*self.0.stub)
21596 .update_webhook(self.0.request, self.0.options)
21597 .await
21598 .map(crate::Response::into_body)
21599 }
21600
21601 pub fn set_webhook<T>(mut self, v: T) -> Self
21605 where
21606 T: std::convert::Into<crate::model::Webhook>,
21607 {
21608 self.0.request.webhook = std::option::Option::Some(v.into());
21609 self
21610 }
21611
21612 pub fn set_or_clear_webhook<T>(mut self, v: std::option::Option<T>) -> Self
21616 where
21617 T: std::convert::Into<crate::model::Webhook>,
21618 {
21619 self.0.request.webhook = v.map(|x| x.into());
21620 self
21621 }
21622
21623 pub fn set_update_mask<T>(mut self, v: T) -> Self
21625 where
21626 T: std::convert::Into<wkt::FieldMask>,
21627 {
21628 self.0.request.update_mask = std::option::Option::Some(v.into());
21629 self
21630 }
21631
21632 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21634 where
21635 T: std::convert::Into<wkt::FieldMask>,
21636 {
21637 self.0.request.update_mask = v.map(|x| x.into());
21638 self
21639 }
21640 }
21641
21642 #[doc(hidden)]
21643 impl crate::RequestBuilder for UpdateWebhook {
21644 fn request_options(&mut self) -> &mut crate::RequestOptions {
21645 &mut self.0.options
21646 }
21647 }
21648
21649 #[derive(Clone, Debug)]
21666 pub struct DeleteWebhook(RequestBuilder<crate::model::DeleteWebhookRequest>);
21667
21668 impl DeleteWebhook {
21669 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21670 Self(RequestBuilder::new(stub))
21671 }
21672
21673 pub fn with_request<V: Into<crate::model::DeleteWebhookRequest>>(mut self, v: V) -> Self {
21675 self.0.request = v.into();
21676 self
21677 }
21678
21679 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21681 self.0.options = v.into();
21682 self
21683 }
21684
21685 pub async fn send(self) -> Result<()> {
21687 (*self.0.stub)
21688 .delete_webhook(self.0.request, self.0.options)
21689 .await
21690 .map(crate::Response::into_body)
21691 }
21692
21693 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21697 self.0.request.name = v.into();
21698 self
21699 }
21700
21701 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
21703 self.0.request.force = v.into();
21704 self
21705 }
21706 }
21707
21708 #[doc(hidden)]
21709 impl crate::RequestBuilder for DeleteWebhook {
21710 fn request_options(&mut self) -> &mut crate::RequestOptions {
21711 &mut self.0.options
21712 }
21713 }
21714
21715 #[derive(Clone, Debug)]
21736 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21737
21738 impl ListLocations {
21739 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21740 Self(RequestBuilder::new(stub))
21741 }
21742
21743 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21745 mut self,
21746 v: V,
21747 ) -> Self {
21748 self.0.request = v.into();
21749 self
21750 }
21751
21752 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21754 self.0.options = v.into();
21755 self
21756 }
21757
21758 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21760 (*self.0.stub)
21761 .list_locations(self.0.request, self.0.options)
21762 .await
21763 .map(crate::Response::into_body)
21764 }
21765
21766 pub fn by_page(
21768 self,
21769 ) -> impl google_cloud_gax::paginator::Paginator<
21770 google_cloud_location::model::ListLocationsResponse,
21771 crate::Error,
21772 > {
21773 use std::clone::Clone;
21774 let token = self.0.request.page_token.clone();
21775 let execute = move |token: String| {
21776 let mut builder = self.clone();
21777 builder.0.request = builder.0.request.set_page_token(token);
21778 builder.send()
21779 };
21780 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21781 }
21782
21783 pub fn by_item(
21785 self,
21786 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21787 google_cloud_location::model::ListLocationsResponse,
21788 crate::Error,
21789 > {
21790 use google_cloud_gax::paginator::Paginator;
21791 self.by_page().items()
21792 }
21793
21794 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21796 self.0.request.name = v.into();
21797 self
21798 }
21799
21800 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21802 self.0.request.filter = v.into();
21803 self
21804 }
21805
21806 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21808 self.0.request.page_size = v.into();
21809 self
21810 }
21811
21812 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21814 self.0.request.page_token = v.into();
21815 self
21816 }
21817 }
21818
21819 #[doc(hidden)]
21820 impl crate::RequestBuilder for ListLocations {
21821 fn request_options(&mut self) -> &mut crate::RequestOptions {
21822 &mut self.0.options
21823 }
21824 }
21825
21826 #[derive(Clone, Debug)]
21843 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21844
21845 impl GetLocation {
21846 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21847 Self(RequestBuilder::new(stub))
21848 }
21849
21850 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21852 mut self,
21853 v: V,
21854 ) -> Self {
21855 self.0.request = v.into();
21856 self
21857 }
21858
21859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21861 self.0.options = v.into();
21862 self
21863 }
21864
21865 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21867 (*self.0.stub)
21868 .get_location(self.0.request, self.0.options)
21869 .await
21870 .map(crate::Response::into_body)
21871 }
21872
21873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21875 self.0.request.name = v.into();
21876 self
21877 }
21878 }
21879
21880 #[doc(hidden)]
21881 impl crate::RequestBuilder for GetLocation {
21882 fn request_options(&mut self) -> &mut crate::RequestOptions {
21883 &mut self.0.options
21884 }
21885 }
21886
21887 #[derive(Clone, Debug)]
21908 pub struct ListOperations(
21909 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21910 );
21911
21912 impl ListOperations {
21913 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
21914 Self(RequestBuilder::new(stub))
21915 }
21916
21917 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21919 mut self,
21920 v: V,
21921 ) -> Self {
21922 self.0.request = v.into();
21923 self
21924 }
21925
21926 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21928 self.0.options = v.into();
21929 self
21930 }
21931
21932 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21934 (*self.0.stub)
21935 .list_operations(self.0.request, self.0.options)
21936 .await
21937 .map(crate::Response::into_body)
21938 }
21939
21940 pub fn by_page(
21942 self,
21943 ) -> impl google_cloud_gax::paginator::Paginator<
21944 google_cloud_longrunning::model::ListOperationsResponse,
21945 crate::Error,
21946 > {
21947 use std::clone::Clone;
21948 let token = self.0.request.page_token.clone();
21949 let execute = move |token: String| {
21950 let mut builder = self.clone();
21951 builder.0.request = builder.0.request.set_page_token(token);
21952 builder.send()
21953 };
21954 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21955 }
21956
21957 pub fn by_item(
21959 self,
21960 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21961 google_cloud_longrunning::model::ListOperationsResponse,
21962 crate::Error,
21963 > {
21964 use google_cloud_gax::paginator::Paginator;
21965 self.by_page().items()
21966 }
21967
21968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21970 self.0.request.name = v.into();
21971 self
21972 }
21973
21974 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21976 self.0.request.filter = v.into();
21977 self
21978 }
21979
21980 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21982 self.0.request.page_size = v.into();
21983 self
21984 }
21985
21986 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21988 self.0.request.page_token = v.into();
21989 self
21990 }
21991
21992 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21994 self.0.request.return_partial_success = v.into();
21995 self
21996 }
21997 }
21998
21999 #[doc(hidden)]
22000 impl crate::RequestBuilder for ListOperations {
22001 fn request_options(&mut self) -> &mut crate::RequestOptions {
22002 &mut self.0.options
22003 }
22004 }
22005
22006 #[derive(Clone, Debug)]
22023 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22024
22025 impl GetOperation {
22026 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
22027 Self(RequestBuilder::new(stub))
22028 }
22029
22030 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22032 mut self,
22033 v: V,
22034 ) -> Self {
22035 self.0.request = v.into();
22036 self
22037 }
22038
22039 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22041 self.0.options = v.into();
22042 self
22043 }
22044
22045 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22047 (*self.0.stub)
22048 .get_operation(self.0.request, self.0.options)
22049 .await
22050 .map(crate::Response::into_body)
22051 }
22052
22053 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22055 self.0.request.name = v.into();
22056 self
22057 }
22058 }
22059
22060 #[doc(hidden)]
22061 impl crate::RequestBuilder for GetOperation {
22062 fn request_options(&mut self) -> &mut crate::RequestOptions {
22063 &mut self.0.options
22064 }
22065 }
22066
22067 #[derive(Clone, Debug)]
22084 pub struct CancelOperation(
22085 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22086 );
22087
22088 impl CancelOperation {
22089 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Webhooks>) -> Self {
22090 Self(RequestBuilder::new(stub))
22091 }
22092
22093 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22095 mut self,
22096 v: V,
22097 ) -> Self {
22098 self.0.request = v.into();
22099 self
22100 }
22101
22102 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22104 self.0.options = v.into();
22105 self
22106 }
22107
22108 pub async fn send(self) -> Result<()> {
22110 (*self.0.stub)
22111 .cancel_operation(self.0.request, self.0.options)
22112 .await
22113 .map(crate::Response::into_body)
22114 }
22115
22116 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22118 self.0.request.name = v.into();
22119 self
22120 }
22121 }
22122
22123 #[doc(hidden)]
22124 impl crate::RequestBuilder for CancelOperation {
22125 fn request_options(&mut self) -> &mut crate::RequestOptions {
22126 &mut self.0.options
22127 }
22128 }
22129}