1pub mod agent_service {
19 use crate::Result;
20
21 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::AgentService;
38 pub struct Factory;
39 impl crate::ClientFactory for Factory {
40 type Client = AgentService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> crate::ClientBuilderResult<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
55 request: R,
56 options: crate::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
65 ) -> 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 ListApps(RequestBuilder<crate::model::ListAppsRequest>);
96
97 impl ListApps {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAppsRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListAppsResponse> {
118 (*self.0.stub)
119 .list_apps(self.0.request, self.0.options)
120 .await
121 .map(crate::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAppsResponse, crate::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 google_cloud_gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListAppsResponse, 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 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
170 self.0.request.filter = v.into();
171 self
172 }
173
174 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
176 self.0.request.order_by = v.into();
177 self
178 }
179 }
180
181 #[doc(hidden)]
182 impl crate::RequestBuilder for ListApps {
183 fn request_options(&mut self) -> &mut crate::RequestOptions {
184 &mut self.0.options
185 }
186 }
187
188 #[derive(Clone, Debug)]
205 pub struct GetApp(RequestBuilder<crate::model::GetAppRequest>);
206
207 impl GetApp {
208 pub(crate) fn new(
209 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
210 ) -> Self {
211 Self(RequestBuilder::new(stub))
212 }
213
214 pub fn with_request<V: Into<crate::model::GetAppRequest>>(mut self, v: V) -> Self {
216 self.0.request = v.into();
217 self
218 }
219
220 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
222 self.0.options = v.into();
223 self
224 }
225
226 pub async fn send(self) -> Result<crate::model::App> {
228 (*self.0.stub)
229 .get_app(self.0.request, self.0.options)
230 .await
231 .map(crate::Response::into_body)
232 }
233
234 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
238 self.0.request.name = v.into();
239 self
240 }
241 }
242
243 #[doc(hidden)]
244 impl crate::RequestBuilder for GetApp {
245 fn request_options(&mut self) -> &mut crate::RequestOptions {
246 &mut self.0.options
247 }
248 }
249
250 #[derive(Clone, Debug)]
268 pub struct CreateApp(RequestBuilder<crate::model::CreateAppRequest>);
269
270 impl CreateApp {
271 pub(crate) fn new(
272 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
273 ) -> Self {
274 Self(RequestBuilder::new(stub))
275 }
276
277 pub fn with_request<V: Into<crate::model::CreateAppRequest>>(mut self, v: V) -> Self {
279 self.0.request = v.into();
280 self
281 }
282
283 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
285 self.0.options = v.into();
286 self
287 }
288
289 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
296 (*self.0.stub)
297 .create_app(self.0.request, self.0.options)
298 .await
299 .map(crate::Response::into_body)
300 }
301
302 pub fn poller(
304 self,
305 ) -> impl google_cloud_lro::Poller<crate::model::App, crate::model::OperationMetadata>
306 {
307 type Operation = google_cloud_lro::internal::Operation<
308 crate::model::App,
309 crate::model::OperationMetadata,
310 >;
311 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
312 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
313 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
314 if let Some(ref mut details) = poller_options.tracing {
315 details.method_name =
316 "google_cloud_ces_v1::client::AgentService::create_app::until_done";
317 }
318
319 let stub = self.0.stub.clone();
320 let mut options = self.0.options.clone();
321 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
322 let query = move |name| {
323 let stub = stub.clone();
324 let options = options.clone();
325 async {
326 let op = GetOperation::new(stub)
327 .set_name(name)
328 .with_options(options)
329 .send()
330 .await?;
331 Ok(Operation::new(op))
332 }
333 };
334
335 let start = move || async {
336 let op = self.send().await?;
337 Ok(Operation::new(op))
338 };
339
340 use google_cloud_lro::internal::PollerExt;
341 {
342 google_cloud_lro::internal::new_poller(
343 polling_error_policy,
344 polling_backoff_policy,
345 start,
346 query,
347 )
348 }
349 .with_options(poller_options)
350 }
351
352 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
356 self.0.request.parent = v.into();
357 self
358 }
359
360 pub fn set_app_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
362 self.0.request.app_id = v.into();
363 self
364 }
365
366 pub fn set_app<T>(mut self, v: T) -> Self
370 where
371 T: std::convert::Into<crate::model::App>,
372 {
373 self.0.request.app = std::option::Option::Some(v.into());
374 self
375 }
376
377 pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
381 where
382 T: std::convert::Into<crate::model::App>,
383 {
384 self.0.request.app = v.map(|x| x.into());
385 self
386 }
387 }
388
389 #[doc(hidden)]
390 impl crate::RequestBuilder for CreateApp {
391 fn request_options(&mut self) -> &mut crate::RequestOptions {
392 &mut self.0.options
393 }
394 }
395
396 #[derive(Clone, Debug)]
413 pub struct UpdateApp(RequestBuilder<crate::model::UpdateAppRequest>);
414
415 impl UpdateApp {
416 pub(crate) fn new(
417 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
418 ) -> Self {
419 Self(RequestBuilder::new(stub))
420 }
421
422 pub fn with_request<V: Into<crate::model::UpdateAppRequest>>(mut self, v: V) -> Self {
424 self.0.request = v.into();
425 self
426 }
427
428 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
430 self.0.options = v.into();
431 self
432 }
433
434 pub async fn send(self) -> Result<crate::model::App> {
436 (*self.0.stub)
437 .update_app(self.0.request, self.0.options)
438 .await
439 .map(crate::Response::into_body)
440 }
441
442 pub fn set_app<T>(mut self, v: T) -> Self
446 where
447 T: std::convert::Into<crate::model::App>,
448 {
449 self.0.request.app = std::option::Option::Some(v.into());
450 self
451 }
452
453 pub fn set_or_clear_app<T>(mut self, v: std::option::Option<T>) -> Self
457 where
458 T: std::convert::Into<crate::model::App>,
459 {
460 self.0.request.app = v.map(|x| x.into());
461 self
462 }
463
464 pub fn set_update_mask<T>(mut self, v: T) -> Self
466 where
467 T: std::convert::Into<wkt::FieldMask>,
468 {
469 self.0.request.update_mask = std::option::Option::Some(v.into());
470 self
471 }
472
473 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
475 where
476 T: std::convert::Into<wkt::FieldMask>,
477 {
478 self.0.request.update_mask = v.map(|x| x.into());
479 self
480 }
481 }
482
483 #[doc(hidden)]
484 impl crate::RequestBuilder for UpdateApp {
485 fn request_options(&mut self) -> &mut crate::RequestOptions {
486 &mut self.0.options
487 }
488 }
489
490 #[derive(Clone, Debug)]
508 pub struct DeleteApp(RequestBuilder<crate::model::DeleteAppRequest>);
509
510 impl DeleteApp {
511 pub(crate) fn new(
512 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
513 ) -> Self {
514 Self(RequestBuilder::new(stub))
515 }
516
517 pub fn with_request<V: Into<crate::model::DeleteAppRequest>>(mut self, v: V) -> Self {
519 self.0.request = v.into();
520 self
521 }
522
523 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
525 self.0.options = v.into();
526 self
527 }
528
529 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
536 (*self.0.stub)
537 .delete_app(self.0.request, self.0.options)
538 .await
539 .map(crate::Response::into_body)
540 }
541
542 pub fn poller(self) -> impl google_cloud_lro::Poller<(), crate::model::OperationMetadata> {
544 type Operation =
545 google_cloud_lro::internal::Operation<wkt::Empty, crate::model::OperationMetadata>;
546 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
547 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
548 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
549 if let Some(ref mut details) = poller_options.tracing {
550 details.method_name =
551 "google_cloud_ces_v1::client::AgentService::delete_app::until_done";
552 }
553
554 let stub = self.0.stub.clone();
555 let mut options = self.0.options.clone();
556 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
557 let query = move |name| {
558 let stub = stub.clone();
559 let options = options.clone();
560 async {
561 let op = GetOperation::new(stub)
562 .set_name(name)
563 .with_options(options)
564 .send()
565 .await?;
566 Ok(Operation::new(op))
567 }
568 };
569
570 let start = move || async {
571 let op = self.send().await?;
572 Ok(Operation::new(op))
573 };
574
575 use google_cloud_lro::internal::PollerExt;
576 {
577 google_cloud_lro::internal::new_unit_response_poller(
578 polling_error_policy,
579 polling_backoff_policy,
580 start,
581 query,
582 )
583 }
584 .with_options(poller_options)
585 }
586
587 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
591 self.0.request.name = v.into();
592 self
593 }
594
595 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
597 self.0.request.etag = v.into();
598 self
599 }
600 }
601
602 #[doc(hidden)]
603 impl crate::RequestBuilder for DeleteApp {
604 fn request_options(&mut self) -> &mut crate::RequestOptions {
605 &mut self.0.options
606 }
607 }
608
609 #[derive(Clone, Debug)]
627 pub struct ExportApp(RequestBuilder<crate::model::ExportAppRequest>);
628
629 impl ExportApp {
630 pub(crate) fn new(
631 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
632 ) -> Self {
633 Self(RequestBuilder::new(stub))
634 }
635
636 pub fn with_request<V: Into<crate::model::ExportAppRequest>>(mut self, v: V) -> Self {
638 self.0.request = v.into();
639 self
640 }
641
642 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
644 self.0.options = v.into();
645 self
646 }
647
648 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
655 (*self.0.stub)
656 .export_app(self.0.request, self.0.options)
657 .await
658 .map(crate::Response::into_body)
659 }
660
661 pub fn poller(
663 self,
664 ) -> impl google_cloud_lro::Poller<
665 crate::model::ExportAppResponse,
666 crate::model::OperationMetadata,
667 > {
668 type Operation = google_cloud_lro::internal::Operation<
669 crate::model::ExportAppResponse,
670 crate::model::OperationMetadata,
671 >;
672 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
673 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
674 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
675 if let Some(ref mut details) = poller_options.tracing {
676 details.method_name =
677 "google_cloud_ces_v1::client::AgentService::export_app::until_done";
678 }
679
680 let stub = self.0.stub.clone();
681 let mut options = self.0.options.clone();
682 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
683 let query = move |name| {
684 let stub = stub.clone();
685 let options = options.clone();
686 async {
687 let op = GetOperation::new(stub)
688 .set_name(name)
689 .with_options(options)
690 .send()
691 .await?;
692 Ok(Operation::new(op))
693 }
694 };
695
696 let start = move || async {
697 let op = self.send().await?;
698 Ok(Operation::new(op))
699 };
700
701 use google_cloud_lro::internal::PollerExt;
702 {
703 google_cloud_lro::internal::new_poller(
704 polling_error_policy,
705 polling_backoff_policy,
706 start,
707 query,
708 )
709 }
710 .with_options(poller_options)
711 }
712
713 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
717 self.0.request.name = v.into();
718 self
719 }
720
721 pub fn set_export_format<T: Into<crate::model::export_app_request::ExportFormat>>(
725 mut self,
726 v: T,
727 ) -> Self {
728 self.0.request.export_format = v.into();
729 self
730 }
731
732 pub fn set_gcs_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
734 self.0.request.gcs_uri = v.into();
735 self
736 }
737
738 pub fn set_app_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
740 self.0.request.app_version = v.into();
741 self
742 }
743 }
744
745 #[doc(hidden)]
746 impl crate::RequestBuilder for ExportApp {
747 fn request_options(&mut self) -> &mut crate::RequestOptions {
748 &mut self.0.options
749 }
750 }
751
752 #[derive(Clone, Debug)]
770 pub struct ImportApp(RequestBuilder<crate::model::ImportAppRequest>);
771
772 impl ImportApp {
773 pub(crate) fn new(
774 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
775 ) -> Self {
776 Self(RequestBuilder::new(stub))
777 }
778
779 pub fn with_request<V: Into<crate::model::ImportAppRequest>>(mut self, v: V) -> Self {
781 self.0.request = v.into();
782 self
783 }
784
785 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
787 self.0.options = v.into();
788 self
789 }
790
791 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
798 (*self.0.stub)
799 .import_app(self.0.request, self.0.options)
800 .await
801 .map(crate::Response::into_body)
802 }
803
804 pub fn poller(
806 self,
807 ) -> impl google_cloud_lro::Poller<
808 crate::model::ImportAppResponse,
809 crate::model::OperationMetadata,
810 > {
811 type Operation = google_cloud_lro::internal::Operation<
812 crate::model::ImportAppResponse,
813 crate::model::OperationMetadata,
814 >;
815 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
816 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
817 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
818 if let Some(ref mut details) = poller_options.tracing {
819 details.method_name =
820 "google_cloud_ces_v1::client::AgentService::import_app::until_done";
821 }
822
823 let stub = self.0.stub.clone();
824 let mut options = self.0.options.clone();
825 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
826 let query = move |name| {
827 let stub = stub.clone();
828 let options = options.clone();
829 async {
830 let op = GetOperation::new(stub)
831 .set_name(name)
832 .with_options(options)
833 .send()
834 .await?;
835 Ok(Operation::new(op))
836 }
837 };
838
839 let start = move || async {
840 let op = self.send().await?;
841 Ok(Operation::new(op))
842 };
843
844 use google_cloud_lro::internal::PollerExt;
845 {
846 google_cloud_lro::internal::new_poller(
847 polling_error_policy,
848 polling_backoff_policy,
849 start,
850 query,
851 )
852 }
853 .with_options(poller_options)
854 }
855
856 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
860 self.0.request.parent = v.into();
861 self
862 }
863
864 pub fn set_display_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
866 self.0.request.display_name = v.into();
867 self
868 }
869
870 pub fn set_app_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
872 self.0.request.app_id = v.into();
873 self
874 }
875
876 pub fn set_import_options<T>(mut self, v: T) -> Self
878 where
879 T: std::convert::Into<crate::model::import_app_request::ImportOptions>,
880 {
881 self.0.request.import_options = std::option::Option::Some(v.into());
882 self
883 }
884
885 pub fn set_or_clear_import_options<T>(mut self, v: std::option::Option<T>) -> Self
887 where
888 T: std::convert::Into<crate::model::import_app_request::ImportOptions>,
889 {
890 self.0.request.import_options = v.map(|x| x.into());
891 self
892 }
893
894 pub fn set_ignore_app_lock<T: Into<bool>>(mut self, v: T) -> Self {
896 self.0.request.ignore_app_lock = v.into();
897 self
898 }
899
900 pub fn set_app<T: Into<Option<crate::model::import_app_request::App>>>(
905 mut self,
906 v: T,
907 ) -> Self {
908 self.0.request.app = v.into();
909 self
910 }
911
912 pub fn set_gcs_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
918 self.0.request = self.0.request.set_gcs_uri(v);
919 self
920 }
921
922 pub fn set_app_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
928 self.0.request = self.0.request.set_app_content(v);
929 self
930 }
931 }
932
933 #[doc(hidden)]
934 impl crate::RequestBuilder for ImportApp {
935 fn request_options(&mut self) -> &mut crate::RequestOptions {
936 &mut self.0.options
937 }
938 }
939
940 #[derive(Clone, Debug)]
961 pub struct ListAgents(RequestBuilder<crate::model::ListAgentsRequest>);
962
963 impl ListAgents {
964 pub(crate) fn new(
965 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
966 ) -> Self {
967 Self(RequestBuilder::new(stub))
968 }
969
970 pub fn with_request<V: Into<crate::model::ListAgentsRequest>>(mut self, v: V) -> Self {
972 self.0.request = v.into();
973 self
974 }
975
976 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
978 self.0.options = v.into();
979 self
980 }
981
982 pub async fn send(self) -> Result<crate::model::ListAgentsResponse> {
984 (*self.0.stub)
985 .list_agents(self.0.request, self.0.options)
986 .await
987 .map(crate::Response::into_body)
988 }
989
990 pub fn by_page(
992 self,
993 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListAgentsResponse, crate::Error>
994 {
995 use std::clone::Clone;
996 let token = self.0.request.page_token.clone();
997 let execute = move |token: String| {
998 let mut builder = self.clone();
999 builder.0.request = builder.0.request.set_page_token(token);
1000 builder.send()
1001 };
1002 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1003 }
1004
1005 pub fn by_item(
1007 self,
1008 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1009 crate::model::ListAgentsResponse,
1010 crate::Error,
1011 > {
1012 use google_cloud_gax::paginator::Paginator;
1013 self.by_page().items()
1014 }
1015
1016 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1020 self.0.request.parent = v.into();
1021 self
1022 }
1023
1024 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1026 self.0.request.page_size = v.into();
1027 self
1028 }
1029
1030 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1032 self.0.request.page_token = v.into();
1033 self
1034 }
1035
1036 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1038 self.0.request.filter = v.into();
1039 self
1040 }
1041
1042 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1044 self.0.request.order_by = v.into();
1045 self
1046 }
1047 }
1048
1049 #[doc(hidden)]
1050 impl crate::RequestBuilder for ListAgents {
1051 fn request_options(&mut self) -> &mut crate::RequestOptions {
1052 &mut self.0.options
1053 }
1054 }
1055
1056 #[derive(Clone, Debug)]
1073 pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
1074
1075 impl GetAgent {
1076 pub(crate) fn new(
1077 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1078 ) -> Self {
1079 Self(RequestBuilder::new(stub))
1080 }
1081
1082 pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
1084 self.0.request = v.into();
1085 self
1086 }
1087
1088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1090 self.0.options = v.into();
1091 self
1092 }
1093
1094 pub async fn send(self) -> Result<crate::model::Agent> {
1096 (*self.0.stub)
1097 .get_agent(self.0.request, self.0.options)
1098 .await
1099 .map(crate::Response::into_body)
1100 }
1101
1102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1106 self.0.request.name = v.into();
1107 self
1108 }
1109 }
1110
1111 #[doc(hidden)]
1112 impl crate::RequestBuilder for GetAgent {
1113 fn request_options(&mut self) -> &mut crate::RequestOptions {
1114 &mut self.0.options
1115 }
1116 }
1117
1118 #[derive(Clone, Debug)]
1135 pub struct CreateAgent(RequestBuilder<crate::model::CreateAgentRequest>);
1136
1137 impl CreateAgent {
1138 pub(crate) fn new(
1139 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1140 ) -> Self {
1141 Self(RequestBuilder::new(stub))
1142 }
1143
1144 pub fn with_request<V: Into<crate::model::CreateAgentRequest>>(mut self, v: V) -> Self {
1146 self.0.request = v.into();
1147 self
1148 }
1149
1150 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1152 self.0.options = v.into();
1153 self
1154 }
1155
1156 pub async fn send(self) -> Result<crate::model::Agent> {
1158 (*self.0.stub)
1159 .create_agent(self.0.request, self.0.options)
1160 .await
1161 .map(crate::Response::into_body)
1162 }
1163
1164 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1168 self.0.request.parent = v.into();
1169 self
1170 }
1171
1172 pub fn set_agent_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1174 self.0.request.agent_id = v.into();
1175 self
1176 }
1177
1178 pub fn set_agent<T>(mut self, v: T) -> Self
1182 where
1183 T: std::convert::Into<crate::model::Agent>,
1184 {
1185 self.0.request.agent = std::option::Option::Some(v.into());
1186 self
1187 }
1188
1189 pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
1193 where
1194 T: std::convert::Into<crate::model::Agent>,
1195 {
1196 self.0.request.agent = v.map(|x| x.into());
1197 self
1198 }
1199 }
1200
1201 #[doc(hidden)]
1202 impl crate::RequestBuilder for CreateAgent {
1203 fn request_options(&mut self) -> &mut crate::RequestOptions {
1204 &mut self.0.options
1205 }
1206 }
1207
1208 #[derive(Clone, Debug)]
1225 pub struct UpdateAgent(RequestBuilder<crate::model::UpdateAgentRequest>);
1226
1227 impl UpdateAgent {
1228 pub(crate) fn new(
1229 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1230 ) -> Self {
1231 Self(RequestBuilder::new(stub))
1232 }
1233
1234 pub fn with_request<V: Into<crate::model::UpdateAgentRequest>>(mut self, v: V) -> Self {
1236 self.0.request = v.into();
1237 self
1238 }
1239
1240 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1242 self.0.options = v.into();
1243 self
1244 }
1245
1246 pub async fn send(self) -> Result<crate::model::Agent> {
1248 (*self.0.stub)
1249 .update_agent(self.0.request, self.0.options)
1250 .await
1251 .map(crate::Response::into_body)
1252 }
1253
1254 pub fn set_agent<T>(mut self, v: T) -> Self
1258 where
1259 T: std::convert::Into<crate::model::Agent>,
1260 {
1261 self.0.request.agent = std::option::Option::Some(v.into());
1262 self
1263 }
1264
1265 pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
1269 where
1270 T: std::convert::Into<crate::model::Agent>,
1271 {
1272 self.0.request.agent = v.map(|x| x.into());
1273 self
1274 }
1275
1276 pub fn set_update_mask<T>(mut self, v: T) -> Self
1278 where
1279 T: std::convert::Into<wkt::FieldMask>,
1280 {
1281 self.0.request.update_mask = std::option::Option::Some(v.into());
1282 self
1283 }
1284
1285 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1287 where
1288 T: std::convert::Into<wkt::FieldMask>,
1289 {
1290 self.0.request.update_mask = v.map(|x| x.into());
1291 self
1292 }
1293 }
1294
1295 #[doc(hidden)]
1296 impl crate::RequestBuilder for UpdateAgent {
1297 fn request_options(&mut self) -> &mut crate::RequestOptions {
1298 &mut self.0.options
1299 }
1300 }
1301
1302 #[derive(Clone, Debug)]
1319 pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
1320
1321 impl DeleteAgent {
1322 pub(crate) fn new(
1323 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1324 ) -> Self {
1325 Self(RequestBuilder::new(stub))
1326 }
1327
1328 pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
1330 self.0.request = v.into();
1331 self
1332 }
1333
1334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1336 self.0.options = v.into();
1337 self
1338 }
1339
1340 pub async fn send(self) -> Result<()> {
1342 (*self.0.stub)
1343 .delete_agent(self.0.request, self.0.options)
1344 .await
1345 .map(crate::Response::into_body)
1346 }
1347
1348 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1352 self.0.request.name = v.into();
1353 self
1354 }
1355
1356 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
1358 self.0.request.force = v.into();
1359 self
1360 }
1361
1362 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1364 self.0.request.etag = v.into();
1365 self
1366 }
1367 }
1368
1369 #[doc(hidden)]
1370 impl crate::RequestBuilder for DeleteAgent {
1371 fn request_options(&mut self) -> &mut crate::RequestOptions {
1372 &mut self.0.options
1373 }
1374 }
1375
1376 #[derive(Clone, Debug)]
1397 pub struct ListExamples(RequestBuilder<crate::model::ListExamplesRequest>);
1398
1399 impl ListExamples {
1400 pub(crate) fn new(
1401 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1402 ) -> Self {
1403 Self(RequestBuilder::new(stub))
1404 }
1405
1406 pub fn with_request<V: Into<crate::model::ListExamplesRequest>>(mut self, v: V) -> Self {
1408 self.0.request = v.into();
1409 self
1410 }
1411
1412 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1414 self.0.options = v.into();
1415 self
1416 }
1417
1418 pub async fn send(self) -> Result<crate::model::ListExamplesResponse> {
1420 (*self.0.stub)
1421 .list_examples(self.0.request, self.0.options)
1422 .await
1423 .map(crate::Response::into_body)
1424 }
1425
1426 pub fn by_page(
1428 self,
1429 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListExamplesResponse, crate::Error>
1430 {
1431 use std::clone::Clone;
1432 let token = self.0.request.page_token.clone();
1433 let execute = move |token: String| {
1434 let mut builder = self.clone();
1435 builder.0.request = builder.0.request.set_page_token(token);
1436 builder.send()
1437 };
1438 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1439 }
1440
1441 pub fn by_item(
1443 self,
1444 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1445 crate::model::ListExamplesResponse,
1446 crate::Error,
1447 > {
1448 use google_cloud_gax::paginator::Paginator;
1449 self.by_page().items()
1450 }
1451
1452 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1456 self.0.request.parent = v.into();
1457 self
1458 }
1459
1460 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1462 self.0.request.page_size = v.into();
1463 self
1464 }
1465
1466 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1468 self.0.request.page_token = v.into();
1469 self
1470 }
1471
1472 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1474 self.0.request.filter = v.into();
1475 self
1476 }
1477
1478 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1480 self.0.request.order_by = v.into();
1481 self
1482 }
1483 }
1484
1485 #[doc(hidden)]
1486 impl crate::RequestBuilder for ListExamples {
1487 fn request_options(&mut self) -> &mut crate::RequestOptions {
1488 &mut self.0.options
1489 }
1490 }
1491
1492 #[derive(Clone, Debug)]
1509 pub struct GetExample(RequestBuilder<crate::model::GetExampleRequest>);
1510
1511 impl GetExample {
1512 pub(crate) fn new(
1513 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1514 ) -> Self {
1515 Self(RequestBuilder::new(stub))
1516 }
1517
1518 pub fn with_request<V: Into<crate::model::GetExampleRequest>>(mut self, v: V) -> Self {
1520 self.0.request = v.into();
1521 self
1522 }
1523
1524 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1526 self.0.options = v.into();
1527 self
1528 }
1529
1530 pub async fn send(self) -> Result<crate::model::Example> {
1532 (*self.0.stub)
1533 .get_example(self.0.request, self.0.options)
1534 .await
1535 .map(crate::Response::into_body)
1536 }
1537
1538 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1542 self.0.request.name = v.into();
1543 self
1544 }
1545 }
1546
1547 #[doc(hidden)]
1548 impl crate::RequestBuilder for GetExample {
1549 fn request_options(&mut self) -> &mut crate::RequestOptions {
1550 &mut self.0.options
1551 }
1552 }
1553
1554 #[derive(Clone, Debug)]
1571 pub struct CreateExample(RequestBuilder<crate::model::CreateExampleRequest>);
1572
1573 impl CreateExample {
1574 pub(crate) fn new(
1575 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1576 ) -> Self {
1577 Self(RequestBuilder::new(stub))
1578 }
1579
1580 pub fn with_request<V: Into<crate::model::CreateExampleRequest>>(mut self, v: V) -> Self {
1582 self.0.request = v.into();
1583 self
1584 }
1585
1586 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1588 self.0.options = v.into();
1589 self
1590 }
1591
1592 pub async fn send(self) -> Result<crate::model::Example> {
1594 (*self.0.stub)
1595 .create_example(self.0.request, self.0.options)
1596 .await
1597 .map(crate::Response::into_body)
1598 }
1599
1600 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1604 self.0.request.parent = v.into();
1605 self
1606 }
1607
1608 pub fn set_example_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
1610 self.0.request.example_id = v.into();
1611 self
1612 }
1613
1614 pub fn set_example<T>(mut self, v: T) -> Self
1618 where
1619 T: std::convert::Into<crate::model::Example>,
1620 {
1621 self.0.request.example = std::option::Option::Some(v.into());
1622 self
1623 }
1624
1625 pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
1629 where
1630 T: std::convert::Into<crate::model::Example>,
1631 {
1632 self.0.request.example = v.map(|x| x.into());
1633 self
1634 }
1635 }
1636
1637 #[doc(hidden)]
1638 impl crate::RequestBuilder for CreateExample {
1639 fn request_options(&mut self) -> &mut crate::RequestOptions {
1640 &mut self.0.options
1641 }
1642 }
1643
1644 #[derive(Clone, Debug)]
1661 pub struct UpdateExample(RequestBuilder<crate::model::UpdateExampleRequest>);
1662
1663 impl UpdateExample {
1664 pub(crate) fn new(
1665 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1666 ) -> Self {
1667 Self(RequestBuilder::new(stub))
1668 }
1669
1670 pub fn with_request<V: Into<crate::model::UpdateExampleRequest>>(mut self, v: V) -> Self {
1672 self.0.request = v.into();
1673 self
1674 }
1675
1676 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1678 self.0.options = v.into();
1679 self
1680 }
1681
1682 pub async fn send(self) -> Result<crate::model::Example> {
1684 (*self.0.stub)
1685 .update_example(self.0.request, self.0.options)
1686 .await
1687 .map(crate::Response::into_body)
1688 }
1689
1690 pub fn set_example<T>(mut self, v: T) -> Self
1694 where
1695 T: std::convert::Into<crate::model::Example>,
1696 {
1697 self.0.request.example = std::option::Option::Some(v.into());
1698 self
1699 }
1700
1701 pub fn set_or_clear_example<T>(mut self, v: std::option::Option<T>) -> Self
1705 where
1706 T: std::convert::Into<crate::model::Example>,
1707 {
1708 self.0.request.example = v.map(|x| x.into());
1709 self
1710 }
1711
1712 pub fn set_update_mask<T>(mut self, v: T) -> Self
1714 where
1715 T: std::convert::Into<wkt::FieldMask>,
1716 {
1717 self.0.request.update_mask = std::option::Option::Some(v.into());
1718 self
1719 }
1720
1721 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1723 where
1724 T: std::convert::Into<wkt::FieldMask>,
1725 {
1726 self.0.request.update_mask = v.map(|x| x.into());
1727 self
1728 }
1729 }
1730
1731 #[doc(hidden)]
1732 impl crate::RequestBuilder for UpdateExample {
1733 fn request_options(&mut self) -> &mut crate::RequestOptions {
1734 &mut self.0.options
1735 }
1736 }
1737
1738 #[derive(Clone, Debug)]
1755 pub struct DeleteExample(RequestBuilder<crate::model::DeleteExampleRequest>);
1756
1757 impl DeleteExample {
1758 pub(crate) fn new(
1759 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1760 ) -> Self {
1761 Self(RequestBuilder::new(stub))
1762 }
1763
1764 pub fn with_request<V: Into<crate::model::DeleteExampleRequest>>(mut self, v: V) -> Self {
1766 self.0.request = v.into();
1767 self
1768 }
1769
1770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1772 self.0.options = v.into();
1773 self
1774 }
1775
1776 pub async fn send(self) -> Result<()> {
1778 (*self.0.stub)
1779 .delete_example(self.0.request, self.0.options)
1780 .await
1781 .map(crate::Response::into_body)
1782 }
1783
1784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1788 self.0.request.name = v.into();
1789 self
1790 }
1791
1792 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
1794 self.0.request.etag = v.into();
1795 self
1796 }
1797 }
1798
1799 #[doc(hidden)]
1800 impl crate::RequestBuilder for DeleteExample {
1801 fn request_options(&mut self) -> &mut crate::RequestOptions {
1802 &mut self.0.options
1803 }
1804 }
1805
1806 #[derive(Clone, Debug)]
1827 pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
1828
1829 impl ListTools {
1830 pub(crate) fn new(
1831 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1832 ) -> Self {
1833 Self(RequestBuilder::new(stub))
1834 }
1835
1836 pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
1838 self.0.request = v.into();
1839 self
1840 }
1841
1842 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1844 self.0.options = v.into();
1845 self
1846 }
1847
1848 pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
1850 (*self.0.stub)
1851 .list_tools(self.0.request, self.0.options)
1852 .await
1853 .map(crate::Response::into_body)
1854 }
1855
1856 pub fn by_page(
1858 self,
1859 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
1860 {
1861 use std::clone::Clone;
1862 let token = self.0.request.page_token.clone();
1863 let execute = move |token: String| {
1864 let mut builder = self.clone();
1865 builder.0.request = builder.0.request.set_page_token(token);
1866 builder.send()
1867 };
1868 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1869 }
1870
1871 pub fn by_item(
1873 self,
1874 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
1875 {
1876 use google_cloud_gax::paginator::Paginator;
1877 self.by_page().items()
1878 }
1879
1880 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1884 self.0.request.parent = v.into();
1885 self
1886 }
1887
1888 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1890 self.0.request.page_size = v.into();
1891 self
1892 }
1893
1894 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1896 self.0.request.page_token = v.into();
1897 self
1898 }
1899
1900 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1902 self.0.request.filter = v.into();
1903 self
1904 }
1905
1906 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
1908 self.0.request.order_by = v.into();
1909 self
1910 }
1911 }
1912
1913 #[doc(hidden)]
1914 impl crate::RequestBuilder for ListTools {
1915 fn request_options(&mut self) -> &mut crate::RequestOptions {
1916 &mut self.0.options
1917 }
1918 }
1919
1920 #[derive(Clone, Debug)]
1937 pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
1938
1939 impl GetTool {
1940 pub(crate) fn new(
1941 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
1942 ) -> Self {
1943 Self(RequestBuilder::new(stub))
1944 }
1945
1946 pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
1948 self.0.request = v.into();
1949 self
1950 }
1951
1952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1954 self.0.options = v.into();
1955 self
1956 }
1957
1958 pub async fn send(self) -> Result<crate::model::Tool> {
1960 (*self.0.stub)
1961 .get_tool(self.0.request, self.0.options)
1962 .await
1963 .map(crate::Response::into_body)
1964 }
1965
1966 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1970 self.0.request.name = v.into();
1971 self
1972 }
1973 }
1974
1975 #[doc(hidden)]
1976 impl crate::RequestBuilder for GetTool {
1977 fn request_options(&mut self) -> &mut crate::RequestOptions {
1978 &mut self.0.options
1979 }
1980 }
1981
1982 #[derive(Clone, Debug)]
2003 pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
2004
2005 impl ListConversations {
2006 pub(crate) fn new(
2007 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2008 ) -> Self {
2009 Self(RequestBuilder::new(stub))
2010 }
2011
2012 pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
2014 mut self,
2015 v: V,
2016 ) -> Self {
2017 self.0.request = v.into();
2018 self
2019 }
2020
2021 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2023 self.0.options = v.into();
2024 self
2025 }
2026
2027 pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
2029 (*self.0.stub)
2030 .list_conversations(self.0.request, self.0.options)
2031 .await
2032 .map(crate::Response::into_body)
2033 }
2034
2035 pub fn by_page(
2037 self,
2038 ) -> impl google_cloud_gax::paginator::Paginator<
2039 crate::model::ListConversationsResponse,
2040 crate::Error,
2041 > {
2042 use std::clone::Clone;
2043 let token = self.0.request.page_token.clone();
2044 let execute = move |token: String| {
2045 let mut builder = self.clone();
2046 builder.0.request = builder.0.request.set_page_token(token);
2047 builder.send()
2048 };
2049 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2050 }
2051
2052 pub fn by_item(
2054 self,
2055 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2056 crate::model::ListConversationsResponse,
2057 crate::Error,
2058 > {
2059 use google_cloud_gax::paginator::Paginator;
2060 self.by_page().items()
2061 }
2062
2063 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2067 self.0.request.parent = v.into();
2068 self
2069 }
2070
2071 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2073 self.0.request.page_size = v.into();
2074 self
2075 }
2076
2077 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2079 self.0.request.page_token = v.into();
2080 self
2081 }
2082
2083 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2085 self.0.request.filter = v.into();
2086 self
2087 }
2088
2089 pub fn set_source<T: Into<crate::model::conversation::Source>>(mut self, v: T) -> Self {
2091 self.0.request.source = v.into();
2092 self
2093 }
2094
2095 pub fn set_sources<T, V>(mut self, v: T) -> Self
2097 where
2098 T: std::iter::IntoIterator<Item = V>,
2099 V: std::convert::Into<crate::model::conversation::Source>,
2100 {
2101 use std::iter::Iterator;
2102 self.0.request.sources = v.into_iter().map(|i| i.into()).collect();
2103 self
2104 }
2105 }
2106
2107 #[doc(hidden)]
2108 impl crate::RequestBuilder for ListConversations {
2109 fn request_options(&mut self) -> &mut crate::RequestOptions {
2110 &mut self.0.options
2111 }
2112 }
2113
2114 #[derive(Clone, Debug)]
2131 pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
2132
2133 impl GetConversation {
2134 pub(crate) fn new(
2135 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2136 ) -> Self {
2137 Self(RequestBuilder::new(stub))
2138 }
2139
2140 pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
2142 self.0.request = v.into();
2143 self
2144 }
2145
2146 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2148 self.0.options = v.into();
2149 self
2150 }
2151
2152 pub async fn send(self) -> Result<crate::model::Conversation> {
2154 (*self.0.stub)
2155 .get_conversation(self.0.request, self.0.options)
2156 .await
2157 .map(crate::Response::into_body)
2158 }
2159
2160 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2164 self.0.request.name = v.into();
2165 self
2166 }
2167
2168 #[deprecated]
2170 pub fn set_source<T: Into<crate::model::conversation::Source>>(mut self, v: T) -> Self {
2171 self.0.request.source = v.into();
2172 self
2173 }
2174 }
2175
2176 #[doc(hidden)]
2177 impl crate::RequestBuilder for GetConversation {
2178 fn request_options(&mut self) -> &mut crate::RequestOptions {
2179 &mut self.0.options
2180 }
2181 }
2182
2183 #[derive(Clone, Debug)]
2200 pub struct DeleteConversation(RequestBuilder<crate::model::DeleteConversationRequest>);
2201
2202 impl DeleteConversation {
2203 pub(crate) fn new(
2204 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2205 ) -> Self {
2206 Self(RequestBuilder::new(stub))
2207 }
2208
2209 pub fn with_request<V: Into<crate::model::DeleteConversationRequest>>(
2211 mut self,
2212 v: V,
2213 ) -> Self {
2214 self.0.request = v.into();
2215 self
2216 }
2217
2218 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2220 self.0.options = v.into();
2221 self
2222 }
2223
2224 pub async fn send(self) -> Result<()> {
2226 (*self.0.stub)
2227 .delete_conversation(self.0.request, self.0.options)
2228 .await
2229 .map(crate::Response::into_body)
2230 }
2231
2232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2236 self.0.request.name = v.into();
2237 self
2238 }
2239
2240 #[deprecated]
2242 pub fn set_source<T: Into<crate::model::conversation::Source>>(mut self, v: T) -> Self {
2243 self.0.request.source = v.into();
2244 self
2245 }
2246 }
2247
2248 #[doc(hidden)]
2249 impl crate::RequestBuilder for DeleteConversation {
2250 fn request_options(&mut self) -> &mut crate::RequestOptions {
2251 &mut self.0.options
2252 }
2253 }
2254
2255 #[derive(Clone, Debug)]
2273 pub struct BatchDeleteConversations(
2274 RequestBuilder<crate::model::BatchDeleteConversationsRequest>,
2275 );
2276
2277 impl BatchDeleteConversations {
2278 pub(crate) fn new(
2279 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2280 ) -> Self {
2281 Self(RequestBuilder::new(stub))
2282 }
2283
2284 pub fn with_request<V: Into<crate::model::BatchDeleteConversationsRequest>>(
2286 mut self,
2287 v: V,
2288 ) -> Self {
2289 self.0.request = v.into();
2290 self
2291 }
2292
2293 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2295 self.0.options = v.into();
2296 self
2297 }
2298
2299 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2306 (*self.0.stub)
2307 .batch_delete_conversations(self.0.request, self.0.options)
2308 .await
2309 .map(crate::Response::into_body)
2310 }
2311
2312 pub fn poller(
2314 self,
2315 ) -> impl google_cloud_lro::Poller<
2316 crate::model::BatchDeleteConversationsResponse,
2317 crate::model::OperationMetadata,
2318 > {
2319 type Operation = google_cloud_lro::internal::Operation<
2320 crate::model::BatchDeleteConversationsResponse,
2321 crate::model::OperationMetadata,
2322 >;
2323 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
2324 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
2325 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
2326 if let Some(ref mut details) = poller_options.tracing {
2327 details.method_name = "google_cloud_ces_v1::client::AgentService::batch_delete_conversations::until_done";
2328 }
2329
2330 let stub = self.0.stub.clone();
2331 let mut options = self.0.options.clone();
2332 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
2333 let query = move |name| {
2334 let stub = stub.clone();
2335 let options = options.clone();
2336 async {
2337 let op = GetOperation::new(stub)
2338 .set_name(name)
2339 .with_options(options)
2340 .send()
2341 .await?;
2342 Ok(Operation::new(op))
2343 }
2344 };
2345
2346 let start = move || async {
2347 let op = self.send().await?;
2348 Ok(Operation::new(op))
2349 };
2350
2351 use google_cloud_lro::internal::PollerExt;
2352 {
2353 google_cloud_lro::internal::new_poller(
2354 polling_error_policy,
2355 polling_backoff_policy,
2356 start,
2357 query,
2358 )
2359 }
2360 .with_options(poller_options)
2361 }
2362
2363 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2367 self.0.request.parent = v.into();
2368 self
2369 }
2370
2371 pub fn set_conversations<T, V>(mut self, v: T) -> Self
2375 where
2376 T: std::iter::IntoIterator<Item = V>,
2377 V: std::convert::Into<std::string::String>,
2378 {
2379 use std::iter::Iterator;
2380 self.0.request.conversations = v.into_iter().map(|i| i.into()).collect();
2381 self
2382 }
2383 }
2384
2385 #[doc(hidden)]
2386 impl crate::RequestBuilder for BatchDeleteConversations {
2387 fn request_options(&mut self) -> &mut crate::RequestOptions {
2388 &mut self.0.options
2389 }
2390 }
2391
2392 #[derive(Clone, Debug)]
2409 pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
2410
2411 impl CreateTool {
2412 pub(crate) fn new(
2413 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2414 ) -> Self {
2415 Self(RequestBuilder::new(stub))
2416 }
2417
2418 pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> 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<crate::model::Tool> {
2432 (*self.0.stub)
2433 .create_tool(self.0.request, self.0.options)
2434 .await
2435 .map(crate::Response::into_body)
2436 }
2437
2438 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2442 self.0.request.parent = v.into();
2443 self
2444 }
2445
2446 pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2448 self.0.request.tool_id = v.into();
2449 self
2450 }
2451
2452 pub fn set_tool<T>(mut self, v: T) -> Self
2456 where
2457 T: std::convert::Into<crate::model::Tool>,
2458 {
2459 self.0.request.tool = std::option::Option::Some(v.into());
2460 self
2461 }
2462
2463 pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
2467 where
2468 T: std::convert::Into<crate::model::Tool>,
2469 {
2470 self.0.request.tool = v.map(|x| x.into());
2471 self
2472 }
2473 }
2474
2475 #[doc(hidden)]
2476 impl crate::RequestBuilder for CreateTool {
2477 fn request_options(&mut self) -> &mut crate::RequestOptions {
2478 &mut self.0.options
2479 }
2480 }
2481
2482 #[derive(Clone, Debug)]
2499 pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
2500
2501 impl UpdateTool {
2502 pub(crate) fn new(
2503 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2504 ) -> Self {
2505 Self(RequestBuilder::new(stub))
2506 }
2507
2508 pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
2510 self.0.request = v.into();
2511 self
2512 }
2513
2514 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2516 self.0.options = v.into();
2517 self
2518 }
2519
2520 pub async fn send(self) -> Result<crate::model::Tool> {
2522 (*self.0.stub)
2523 .update_tool(self.0.request, self.0.options)
2524 .await
2525 .map(crate::Response::into_body)
2526 }
2527
2528 pub fn set_tool<T>(mut self, v: T) -> Self
2532 where
2533 T: std::convert::Into<crate::model::Tool>,
2534 {
2535 self.0.request.tool = std::option::Option::Some(v.into());
2536 self
2537 }
2538
2539 pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
2543 where
2544 T: std::convert::Into<crate::model::Tool>,
2545 {
2546 self.0.request.tool = v.map(|x| x.into());
2547 self
2548 }
2549
2550 pub fn set_update_mask<T>(mut self, v: T) -> Self
2552 where
2553 T: std::convert::Into<wkt::FieldMask>,
2554 {
2555 self.0.request.update_mask = std::option::Option::Some(v.into());
2556 self
2557 }
2558
2559 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2561 where
2562 T: std::convert::Into<wkt::FieldMask>,
2563 {
2564 self.0.request.update_mask = v.map(|x| x.into());
2565 self
2566 }
2567 }
2568
2569 #[doc(hidden)]
2570 impl crate::RequestBuilder for UpdateTool {
2571 fn request_options(&mut self) -> &mut crate::RequestOptions {
2572 &mut self.0.options
2573 }
2574 }
2575
2576 #[derive(Clone, Debug)]
2593 pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
2594
2595 impl DeleteTool {
2596 pub(crate) fn new(
2597 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2598 ) -> Self {
2599 Self(RequestBuilder::new(stub))
2600 }
2601
2602 pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
2604 self.0.request = v.into();
2605 self
2606 }
2607
2608 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2610 self.0.options = v.into();
2611 self
2612 }
2613
2614 pub async fn send(self) -> Result<()> {
2616 (*self.0.stub)
2617 .delete_tool(self.0.request, self.0.options)
2618 .await
2619 .map(crate::Response::into_body)
2620 }
2621
2622 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2626 self.0.request.name = v.into();
2627 self
2628 }
2629
2630 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
2632 self.0.request.force = v.into();
2633 self
2634 }
2635
2636 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
2638 self.0.request.etag = v.into();
2639 self
2640 }
2641 }
2642
2643 #[doc(hidden)]
2644 impl crate::RequestBuilder for DeleteTool {
2645 fn request_options(&mut self) -> &mut crate::RequestOptions {
2646 &mut self.0.options
2647 }
2648 }
2649
2650 #[derive(Clone, Debug)]
2671 pub struct ListGuardrails(RequestBuilder<crate::model::ListGuardrailsRequest>);
2672
2673 impl ListGuardrails {
2674 pub(crate) fn new(
2675 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2676 ) -> Self {
2677 Self(RequestBuilder::new(stub))
2678 }
2679
2680 pub fn with_request<V: Into<crate::model::ListGuardrailsRequest>>(mut self, v: V) -> Self {
2682 self.0.request = v.into();
2683 self
2684 }
2685
2686 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2688 self.0.options = v.into();
2689 self
2690 }
2691
2692 pub async fn send(self) -> Result<crate::model::ListGuardrailsResponse> {
2694 (*self.0.stub)
2695 .list_guardrails(self.0.request, self.0.options)
2696 .await
2697 .map(crate::Response::into_body)
2698 }
2699
2700 pub fn by_page(
2702 self,
2703 ) -> impl google_cloud_gax::paginator::Paginator<
2704 crate::model::ListGuardrailsResponse,
2705 crate::Error,
2706 > {
2707 use std::clone::Clone;
2708 let token = self.0.request.page_token.clone();
2709 let execute = move |token: String| {
2710 let mut builder = self.clone();
2711 builder.0.request = builder.0.request.set_page_token(token);
2712 builder.send()
2713 };
2714 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2715 }
2716
2717 pub fn by_item(
2719 self,
2720 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2721 crate::model::ListGuardrailsResponse,
2722 crate::Error,
2723 > {
2724 use google_cloud_gax::paginator::Paginator;
2725 self.by_page().items()
2726 }
2727
2728 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2732 self.0.request.parent = v.into();
2733 self
2734 }
2735
2736 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2738 self.0.request.page_size = v.into();
2739 self
2740 }
2741
2742 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2744 self.0.request.page_token = v.into();
2745 self
2746 }
2747
2748 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2750 self.0.request.filter = v.into();
2751 self
2752 }
2753
2754 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
2756 self.0.request.order_by = v.into();
2757 self
2758 }
2759 }
2760
2761 #[doc(hidden)]
2762 impl crate::RequestBuilder for ListGuardrails {
2763 fn request_options(&mut self) -> &mut crate::RequestOptions {
2764 &mut self.0.options
2765 }
2766 }
2767
2768 #[derive(Clone, Debug)]
2785 pub struct GetGuardrail(RequestBuilder<crate::model::GetGuardrailRequest>);
2786
2787 impl GetGuardrail {
2788 pub(crate) fn new(
2789 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2790 ) -> Self {
2791 Self(RequestBuilder::new(stub))
2792 }
2793
2794 pub fn with_request<V: Into<crate::model::GetGuardrailRequest>>(mut self, v: V) -> Self {
2796 self.0.request = v.into();
2797 self
2798 }
2799
2800 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2802 self.0.options = v.into();
2803 self
2804 }
2805
2806 pub async fn send(self) -> Result<crate::model::Guardrail> {
2808 (*self.0.stub)
2809 .get_guardrail(self.0.request, self.0.options)
2810 .await
2811 .map(crate::Response::into_body)
2812 }
2813
2814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2818 self.0.request.name = v.into();
2819 self
2820 }
2821 }
2822
2823 #[doc(hidden)]
2824 impl crate::RequestBuilder for GetGuardrail {
2825 fn request_options(&mut self) -> &mut crate::RequestOptions {
2826 &mut self.0.options
2827 }
2828 }
2829
2830 #[derive(Clone, Debug)]
2847 pub struct CreateGuardrail(RequestBuilder<crate::model::CreateGuardrailRequest>);
2848
2849 impl CreateGuardrail {
2850 pub(crate) fn new(
2851 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2852 ) -> Self {
2853 Self(RequestBuilder::new(stub))
2854 }
2855
2856 pub fn with_request<V: Into<crate::model::CreateGuardrailRequest>>(mut self, v: V) -> Self {
2858 self.0.request = v.into();
2859 self
2860 }
2861
2862 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2864 self.0.options = v.into();
2865 self
2866 }
2867
2868 pub async fn send(self) -> Result<crate::model::Guardrail> {
2870 (*self.0.stub)
2871 .create_guardrail(self.0.request, self.0.options)
2872 .await
2873 .map(crate::Response::into_body)
2874 }
2875
2876 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880 self.0.request.parent = v.into();
2881 self
2882 }
2883
2884 pub fn set_guardrail_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
2886 self.0.request.guardrail_id = v.into();
2887 self
2888 }
2889
2890 pub fn set_guardrail<T>(mut self, v: T) -> Self
2894 where
2895 T: std::convert::Into<crate::model::Guardrail>,
2896 {
2897 self.0.request.guardrail = std::option::Option::Some(v.into());
2898 self
2899 }
2900
2901 pub fn set_or_clear_guardrail<T>(mut self, v: std::option::Option<T>) -> Self
2905 where
2906 T: std::convert::Into<crate::model::Guardrail>,
2907 {
2908 self.0.request.guardrail = v.map(|x| x.into());
2909 self
2910 }
2911 }
2912
2913 #[doc(hidden)]
2914 impl crate::RequestBuilder for CreateGuardrail {
2915 fn request_options(&mut self) -> &mut crate::RequestOptions {
2916 &mut self.0.options
2917 }
2918 }
2919
2920 #[derive(Clone, Debug)]
2937 pub struct UpdateGuardrail(RequestBuilder<crate::model::UpdateGuardrailRequest>);
2938
2939 impl UpdateGuardrail {
2940 pub(crate) fn new(
2941 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
2942 ) -> Self {
2943 Self(RequestBuilder::new(stub))
2944 }
2945
2946 pub fn with_request<V: Into<crate::model::UpdateGuardrailRequest>>(mut self, v: V) -> Self {
2948 self.0.request = v.into();
2949 self
2950 }
2951
2952 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2954 self.0.options = v.into();
2955 self
2956 }
2957
2958 pub async fn send(self) -> Result<crate::model::Guardrail> {
2960 (*self.0.stub)
2961 .update_guardrail(self.0.request, self.0.options)
2962 .await
2963 .map(crate::Response::into_body)
2964 }
2965
2966 pub fn set_guardrail<T>(mut self, v: T) -> Self
2970 where
2971 T: std::convert::Into<crate::model::Guardrail>,
2972 {
2973 self.0.request.guardrail = std::option::Option::Some(v.into());
2974 self
2975 }
2976
2977 pub fn set_or_clear_guardrail<T>(mut self, v: std::option::Option<T>) -> Self
2981 where
2982 T: std::convert::Into<crate::model::Guardrail>,
2983 {
2984 self.0.request.guardrail = v.map(|x| x.into());
2985 self
2986 }
2987
2988 pub fn set_update_mask<T>(mut self, v: T) -> Self
2990 where
2991 T: std::convert::Into<wkt::FieldMask>,
2992 {
2993 self.0.request.update_mask = std::option::Option::Some(v.into());
2994 self
2995 }
2996
2997 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2999 where
3000 T: std::convert::Into<wkt::FieldMask>,
3001 {
3002 self.0.request.update_mask = v.map(|x| x.into());
3003 self
3004 }
3005 }
3006
3007 #[doc(hidden)]
3008 impl crate::RequestBuilder for UpdateGuardrail {
3009 fn request_options(&mut self) -> &mut crate::RequestOptions {
3010 &mut self.0.options
3011 }
3012 }
3013
3014 #[derive(Clone, Debug)]
3031 pub struct DeleteGuardrail(RequestBuilder<crate::model::DeleteGuardrailRequest>);
3032
3033 impl DeleteGuardrail {
3034 pub(crate) fn new(
3035 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3036 ) -> Self {
3037 Self(RequestBuilder::new(stub))
3038 }
3039
3040 pub fn with_request<V: Into<crate::model::DeleteGuardrailRequest>>(mut self, v: V) -> Self {
3042 self.0.request = v.into();
3043 self
3044 }
3045
3046 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3048 self.0.options = v.into();
3049 self
3050 }
3051
3052 pub async fn send(self) -> Result<()> {
3054 (*self.0.stub)
3055 .delete_guardrail(self.0.request, self.0.options)
3056 .await
3057 .map(crate::Response::into_body)
3058 }
3059
3060 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3064 self.0.request.name = v.into();
3065 self
3066 }
3067
3068 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3070 self.0.request.force = v.into();
3071 self
3072 }
3073
3074 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3076 self.0.request.etag = v.into();
3077 self
3078 }
3079 }
3080
3081 #[doc(hidden)]
3082 impl crate::RequestBuilder for DeleteGuardrail {
3083 fn request_options(&mut self) -> &mut crate::RequestOptions {
3084 &mut self.0.options
3085 }
3086 }
3087
3088 #[derive(Clone, Debug)]
3109 pub struct ListDeployments(RequestBuilder<crate::model::ListDeploymentsRequest>);
3110
3111 impl ListDeployments {
3112 pub(crate) fn new(
3113 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3114 ) -> Self {
3115 Self(RequestBuilder::new(stub))
3116 }
3117
3118 pub fn with_request<V: Into<crate::model::ListDeploymentsRequest>>(mut self, v: V) -> Self {
3120 self.0.request = v.into();
3121 self
3122 }
3123
3124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3126 self.0.options = v.into();
3127 self
3128 }
3129
3130 pub async fn send(self) -> Result<crate::model::ListDeploymentsResponse> {
3132 (*self.0.stub)
3133 .list_deployments(self.0.request, self.0.options)
3134 .await
3135 .map(crate::Response::into_body)
3136 }
3137
3138 pub fn by_page(
3140 self,
3141 ) -> impl google_cloud_gax::paginator::Paginator<
3142 crate::model::ListDeploymentsResponse,
3143 crate::Error,
3144 > {
3145 use std::clone::Clone;
3146 let token = self.0.request.page_token.clone();
3147 let execute = move |token: String| {
3148 let mut builder = self.clone();
3149 builder.0.request = builder.0.request.set_page_token(token);
3150 builder.send()
3151 };
3152 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3153 }
3154
3155 pub fn by_item(
3157 self,
3158 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3159 crate::model::ListDeploymentsResponse,
3160 crate::Error,
3161 > {
3162 use google_cloud_gax::paginator::Paginator;
3163 self.by_page().items()
3164 }
3165
3166 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3170 self.0.request.parent = v.into();
3171 self
3172 }
3173
3174 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3176 self.0.request.page_size = v.into();
3177 self
3178 }
3179
3180 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3182 self.0.request.page_token = v.into();
3183 self
3184 }
3185
3186 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3188 self.0.request.order_by = v.into();
3189 self
3190 }
3191 }
3192
3193 #[doc(hidden)]
3194 impl crate::RequestBuilder for ListDeployments {
3195 fn request_options(&mut self) -> &mut crate::RequestOptions {
3196 &mut self.0.options
3197 }
3198 }
3199
3200 #[derive(Clone, Debug)]
3217 pub struct GetDeployment(RequestBuilder<crate::model::GetDeploymentRequest>);
3218
3219 impl GetDeployment {
3220 pub(crate) fn new(
3221 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3222 ) -> Self {
3223 Self(RequestBuilder::new(stub))
3224 }
3225
3226 pub fn with_request<V: Into<crate::model::GetDeploymentRequest>>(mut self, v: V) -> Self {
3228 self.0.request = v.into();
3229 self
3230 }
3231
3232 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3234 self.0.options = v.into();
3235 self
3236 }
3237
3238 pub async fn send(self) -> Result<crate::model::Deployment> {
3240 (*self.0.stub)
3241 .get_deployment(self.0.request, self.0.options)
3242 .await
3243 .map(crate::Response::into_body)
3244 }
3245
3246 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3250 self.0.request.name = v.into();
3251 self
3252 }
3253 }
3254
3255 #[doc(hidden)]
3256 impl crate::RequestBuilder for GetDeployment {
3257 fn request_options(&mut self) -> &mut crate::RequestOptions {
3258 &mut self.0.options
3259 }
3260 }
3261
3262 #[derive(Clone, Debug)]
3279 pub struct CreateDeployment(RequestBuilder<crate::model::CreateDeploymentRequest>);
3280
3281 impl CreateDeployment {
3282 pub(crate) fn new(
3283 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3284 ) -> Self {
3285 Self(RequestBuilder::new(stub))
3286 }
3287
3288 pub fn with_request<V: Into<crate::model::CreateDeploymentRequest>>(
3290 mut self,
3291 v: V,
3292 ) -> Self {
3293 self.0.request = v.into();
3294 self
3295 }
3296
3297 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3299 self.0.options = v.into();
3300 self
3301 }
3302
3303 pub async fn send(self) -> Result<crate::model::Deployment> {
3305 (*self.0.stub)
3306 .create_deployment(self.0.request, self.0.options)
3307 .await
3308 .map(crate::Response::into_body)
3309 }
3310
3311 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3315 self.0.request.parent = v.into();
3316 self
3317 }
3318
3319 pub fn set_deployment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3321 self.0.request.deployment_id = v.into();
3322 self
3323 }
3324
3325 pub fn set_deployment<T>(mut self, v: T) -> Self
3329 where
3330 T: std::convert::Into<crate::model::Deployment>,
3331 {
3332 self.0.request.deployment = std::option::Option::Some(v.into());
3333 self
3334 }
3335
3336 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3340 where
3341 T: std::convert::Into<crate::model::Deployment>,
3342 {
3343 self.0.request.deployment = v.map(|x| x.into());
3344 self
3345 }
3346 }
3347
3348 #[doc(hidden)]
3349 impl crate::RequestBuilder for CreateDeployment {
3350 fn request_options(&mut self) -> &mut crate::RequestOptions {
3351 &mut self.0.options
3352 }
3353 }
3354
3355 #[derive(Clone, Debug)]
3372 pub struct UpdateDeployment(RequestBuilder<crate::model::UpdateDeploymentRequest>);
3373
3374 impl UpdateDeployment {
3375 pub(crate) fn new(
3376 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3377 ) -> Self {
3378 Self(RequestBuilder::new(stub))
3379 }
3380
3381 pub fn with_request<V: Into<crate::model::UpdateDeploymentRequest>>(
3383 mut self,
3384 v: V,
3385 ) -> Self {
3386 self.0.request = v.into();
3387 self
3388 }
3389
3390 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3392 self.0.options = v.into();
3393 self
3394 }
3395
3396 pub async fn send(self) -> Result<crate::model::Deployment> {
3398 (*self.0.stub)
3399 .update_deployment(self.0.request, self.0.options)
3400 .await
3401 .map(crate::Response::into_body)
3402 }
3403
3404 pub fn set_deployment<T>(mut self, v: T) -> Self
3408 where
3409 T: std::convert::Into<crate::model::Deployment>,
3410 {
3411 self.0.request.deployment = std::option::Option::Some(v.into());
3412 self
3413 }
3414
3415 pub fn set_or_clear_deployment<T>(mut self, v: std::option::Option<T>) -> Self
3419 where
3420 T: std::convert::Into<crate::model::Deployment>,
3421 {
3422 self.0.request.deployment = v.map(|x| x.into());
3423 self
3424 }
3425
3426 pub fn set_update_mask<T>(mut self, v: T) -> Self
3428 where
3429 T: std::convert::Into<wkt::FieldMask>,
3430 {
3431 self.0.request.update_mask = std::option::Option::Some(v.into());
3432 self
3433 }
3434
3435 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3437 where
3438 T: std::convert::Into<wkt::FieldMask>,
3439 {
3440 self.0.request.update_mask = v.map(|x| x.into());
3441 self
3442 }
3443 }
3444
3445 #[doc(hidden)]
3446 impl crate::RequestBuilder for UpdateDeployment {
3447 fn request_options(&mut self) -> &mut crate::RequestOptions {
3448 &mut self.0.options
3449 }
3450 }
3451
3452 #[derive(Clone, Debug)]
3469 pub struct DeleteDeployment(RequestBuilder<crate::model::DeleteDeploymentRequest>);
3470
3471 impl DeleteDeployment {
3472 pub(crate) fn new(
3473 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3474 ) -> Self {
3475 Self(RequestBuilder::new(stub))
3476 }
3477
3478 pub fn with_request<V: Into<crate::model::DeleteDeploymentRequest>>(
3480 mut self,
3481 v: V,
3482 ) -> Self {
3483 self.0.request = v.into();
3484 self
3485 }
3486
3487 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3489 self.0.options = v.into();
3490 self
3491 }
3492
3493 pub async fn send(self) -> Result<()> {
3495 (*self.0.stub)
3496 .delete_deployment(self.0.request, self.0.options)
3497 .await
3498 .map(crate::Response::into_body)
3499 }
3500
3501 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3505 self.0.request.name = v.into();
3506 self
3507 }
3508
3509 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3511 self.0.request.etag = v.into();
3512 self
3513 }
3514 }
3515
3516 #[doc(hidden)]
3517 impl crate::RequestBuilder for DeleteDeployment {
3518 fn request_options(&mut self) -> &mut crate::RequestOptions {
3519 &mut self.0.options
3520 }
3521 }
3522
3523 #[derive(Clone, Debug)]
3544 pub struct ListToolsets(RequestBuilder<crate::model::ListToolsetsRequest>);
3545
3546 impl ListToolsets {
3547 pub(crate) fn new(
3548 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3549 ) -> Self {
3550 Self(RequestBuilder::new(stub))
3551 }
3552
3553 pub fn with_request<V: Into<crate::model::ListToolsetsRequest>>(mut self, v: V) -> Self {
3555 self.0.request = v.into();
3556 self
3557 }
3558
3559 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3561 self.0.options = v.into();
3562 self
3563 }
3564
3565 pub async fn send(self) -> Result<crate::model::ListToolsetsResponse> {
3567 (*self.0.stub)
3568 .list_toolsets(self.0.request, self.0.options)
3569 .await
3570 .map(crate::Response::into_body)
3571 }
3572
3573 pub fn by_page(
3575 self,
3576 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsetsResponse, crate::Error>
3577 {
3578 use std::clone::Clone;
3579 let token = self.0.request.page_token.clone();
3580 let execute = move |token: String| {
3581 let mut builder = self.clone();
3582 builder.0.request = builder.0.request.set_page_token(token);
3583 builder.send()
3584 };
3585 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3586 }
3587
3588 pub fn by_item(
3590 self,
3591 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3592 crate::model::ListToolsetsResponse,
3593 crate::Error,
3594 > {
3595 use google_cloud_gax::paginator::Paginator;
3596 self.by_page().items()
3597 }
3598
3599 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3603 self.0.request.parent = v.into();
3604 self
3605 }
3606
3607 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3609 self.0.request.page_size = v.into();
3610 self
3611 }
3612
3613 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3615 self.0.request.page_token = v.into();
3616 self
3617 }
3618
3619 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3621 self.0.request.filter = v.into();
3622 self
3623 }
3624
3625 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
3627 self.0.request.order_by = v.into();
3628 self
3629 }
3630 }
3631
3632 #[doc(hidden)]
3633 impl crate::RequestBuilder for ListToolsets {
3634 fn request_options(&mut self) -> &mut crate::RequestOptions {
3635 &mut self.0.options
3636 }
3637 }
3638
3639 #[derive(Clone, Debug)]
3656 pub struct GetToolset(RequestBuilder<crate::model::GetToolsetRequest>);
3657
3658 impl GetToolset {
3659 pub(crate) fn new(
3660 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3661 ) -> Self {
3662 Self(RequestBuilder::new(stub))
3663 }
3664
3665 pub fn with_request<V: Into<crate::model::GetToolsetRequest>>(mut self, v: V) -> Self {
3667 self.0.request = v.into();
3668 self
3669 }
3670
3671 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3673 self.0.options = v.into();
3674 self
3675 }
3676
3677 pub async fn send(self) -> Result<crate::model::Toolset> {
3679 (*self.0.stub)
3680 .get_toolset(self.0.request, self.0.options)
3681 .await
3682 .map(crate::Response::into_body)
3683 }
3684
3685 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3689 self.0.request.name = v.into();
3690 self
3691 }
3692 }
3693
3694 #[doc(hidden)]
3695 impl crate::RequestBuilder for GetToolset {
3696 fn request_options(&mut self) -> &mut crate::RequestOptions {
3697 &mut self.0.options
3698 }
3699 }
3700
3701 #[derive(Clone, Debug)]
3718 pub struct CreateToolset(RequestBuilder<crate::model::CreateToolsetRequest>);
3719
3720 impl CreateToolset {
3721 pub(crate) fn new(
3722 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3723 ) -> Self {
3724 Self(RequestBuilder::new(stub))
3725 }
3726
3727 pub fn with_request<V: Into<crate::model::CreateToolsetRequest>>(mut self, v: V) -> Self {
3729 self.0.request = v.into();
3730 self
3731 }
3732
3733 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3735 self.0.options = v.into();
3736 self
3737 }
3738
3739 pub async fn send(self) -> Result<crate::model::Toolset> {
3741 (*self.0.stub)
3742 .create_toolset(self.0.request, self.0.options)
3743 .await
3744 .map(crate::Response::into_body)
3745 }
3746
3747 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3751 self.0.request.parent = v.into();
3752 self
3753 }
3754
3755 pub fn set_toolset_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3757 self.0.request.toolset_id = v.into();
3758 self
3759 }
3760
3761 pub fn set_toolset<T>(mut self, v: T) -> Self
3765 where
3766 T: std::convert::Into<crate::model::Toolset>,
3767 {
3768 self.0.request.toolset = std::option::Option::Some(v.into());
3769 self
3770 }
3771
3772 pub fn set_or_clear_toolset<T>(mut self, v: std::option::Option<T>) -> Self
3776 where
3777 T: std::convert::Into<crate::model::Toolset>,
3778 {
3779 self.0.request.toolset = v.map(|x| x.into());
3780 self
3781 }
3782 }
3783
3784 #[doc(hidden)]
3785 impl crate::RequestBuilder for CreateToolset {
3786 fn request_options(&mut self) -> &mut crate::RequestOptions {
3787 &mut self.0.options
3788 }
3789 }
3790
3791 #[derive(Clone, Debug)]
3808 pub struct UpdateToolset(RequestBuilder<crate::model::UpdateToolsetRequest>);
3809
3810 impl UpdateToolset {
3811 pub(crate) fn new(
3812 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3813 ) -> Self {
3814 Self(RequestBuilder::new(stub))
3815 }
3816
3817 pub fn with_request<V: Into<crate::model::UpdateToolsetRequest>>(mut self, v: V) -> Self {
3819 self.0.request = v.into();
3820 self
3821 }
3822
3823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3825 self.0.options = v.into();
3826 self
3827 }
3828
3829 pub async fn send(self) -> Result<crate::model::Toolset> {
3831 (*self.0.stub)
3832 .update_toolset(self.0.request, self.0.options)
3833 .await
3834 .map(crate::Response::into_body)
3835 }
3836
3837 pub fn set_toolset<T>(mut self, v: T) -> Self
3841 where
3842 T: std::convert::Into<crate::model::Toolset>,
3843 {
3844 self.0.request.toolset = std::option::Option::Some(v.into());
3845 self
3846 }
3847
3848 pub fn set_or_clear_toolset<T>(mut self, v: std::option::Option<T>) -> Self
3852 where
3853 T: std::convert::Into<crate::model::Toolset>,
3854 {
3855 self.0.request.toolset = v.map(|x| x.into());
3856 self
3857 }
3858
3859 pub fn set_update_mask<T>(mut self, v: T) -> Self
3861 where
3862 T: std::convert::Into<wkt::FieldMask>,
3863 {
3864 self.0.request.update_mask = std::option::Option::Some(v.into());
3865 self
3866 }
3867
3868 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
3870 where
3871 T: std::convert::Into<wkt::FieldMask>,
3872 {
3873 self.0.request.update_mask = v.map(|x| x.into());
3874 self
3875 }
3876 }
3877
3878 #[doc(hidden)]
3879 impl crate::RequestBuilder for UpdateToolset {
3880 fn request_options(&mut self) -> &mut crate::RequestOptions {
3881 &mut self.0.options
3882 }
3883 }
3884
3885 #[derive(Clone, Debug)]
3902 pub struct DeleteToolset(RequestBuilder<crate::model::DeleteToolsetRequest>);
3903
3904 impl DeleteToolset {
3905 pub(crate) fn new(
3906 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3907 ) -> Self {
3908 Self(RequestBuilder::new(stub))
3909 }
3910
3911 pub fn with_request<V: Into<crate::model::DeleteToolsetRequest>>(mut self, v: V) -> Self {
3913 self.0.request = v.into();
3914 self
3915 }
3916
3917 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3919 self.0.options = v.into();
3920 self
3921 }
3922
3923 pub async fn send(self) -> Result<()> {
3925 (*self.0.stub)
3926 .delete_toolset(self.0.request, self.0.options)
3927 .await
3928 .map(crate::Response::into_body)
3929 }
3930
3931 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3935 self.0.request.name = v.into();
3936 self
3937 }
3938
3939 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
3941 self.0.request.force = v.into();
3942 self
3943 }
3944
3945 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
3947 self.0.request.etag = v.into();
3948 self
3949 }
3950 }
3951
3952 #[doc(hidden)]
3953 impl crate::RequestBuilder for DeleteToolset {
3954 fn request_options(&mut self) -> &mut crate::RequestOptions {
3955 &mut self.0.options
3956 }
3957 }
3958
3959 #[derive(Clone, Debug)]
3980 pub struct ListAppVersions(RequestBuilder<crate::model::ListAppVersionsRequest>);
3981
3982 impl ListAppVersions {
3983 pub(crate) fn new(
3984 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
3985 ) -> Self {
3986 Self(RequestBuilder::new(stub))
3987 }
3988
3989 pub fn with_request<V: Into<crate::model::ListAppVersionsRequest>>(mut self, v: V) -> Self {
3991 self.0.request = v.into();
3992 self
3993 }
3994
3995 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3997 self.0.options = v.into();
3998 self
3999 }
4000
4001 pub async fn send(self) -> Result<crate::model::ListAppVersionsResponse> {
4003 (*self.0.stub)
4004 .list_app_versions(self.0.request, self.0.options)
4005 .await
4006 .map(crate::Response::into_body)
4007 }
4008
4009 pub fn by_page(
4011 self,
4012 ) -> impl google_cloud_gax::paginator::Paginator<
4013 crate::model::ListAppVersionsResponse,
4014 crate::Error,
4015 > {
4016 use std::clone::Clone;
4017 let token = self.0.request.page_token.clone();
4018 let execute = move |token: String| {
4019 let mut builder = self.clone();
4020 builder.0.request = builder.0.request.set_page_token(token);
4021 builder.send()
4022 };
4023 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4024 }
4025
4026 pub fn by_item(
4028 self,
4029 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4030 crate::model::ListAppVersionsResponse,
4031 crate::Error,
4032 > {
4033 use google_cloud_gax::paginator::Paginator;
4034 self.by_page().items()
4035 }
4036
4037 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4041 self.0.request.parent = v.into();
4042 self
4043 }
4044
4045 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4047 self.0.request.page_size = v.into();
4048 self
4049 }
4050
4051 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4053 self.0.request.page_token = v.into();
4054 self
4055 }
4056
4057 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4059 self.0.request.filter = v.into();
4060 self
4061 }
4062
4063 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4065 self.0.request.order_by = v.into();
4066 self
4067 }
4068 }
4069
4070 #[doc(hidden)]
4071 impl crate::RequestBuilder for ListAppVersions {
4072 fn request_options(&mut self) -> &mut crate::RequestOptions {
4073 &mut self.0.options
4074 }
4075 }
4076
4077 #[derive(Clone, Debug)]
4094 pub struct GetAppVersion(RequestBuilder<crate::model::GetAppVersionRequest>);
4095
4096 impl GetAppVersion {
4097 pub(crate) fn new(
4098 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4099 ) -> Self {
4100 Self(RequestBuilder::new(stub))
4101 }
4102
4103 pub fn with_request<V: Into<crate::model::GetAppVersionRequest>>(mut self, v: V) -> Self {
4105 self.0.request = v.into();
4106 self
4107 }
4108
4109 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4111 self.0.options = v.into();
4112 self
4113 }
4114
4115 pub async fn send(self) -> Result<crate::model::AppVersion> {
4117 (*self.0.stub)
4118 .get_app_version(self.0.request, self.0.options)
4119 .await
4120 .map(crate::Response::into_body)
4121 }
4122
4123 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4127 self.0.request.name = v.into();
4128 self
4129 }
4130 }
4131
4132 #[doc(hidden)]
4133 impl crate::RequestBuilder for GetAppVersion {
4134 fn request_options(&mut self) -> &mut crate::RequestOptions {
4135 &mut self.0.options
4136 }
4137 }
4138
4139 #[derive(Clone, Debug)]
4156 pub struct CreateAppVersion(RequestBuilder<crate::model::CreateAppVersionRequest>);
4157
4158 impl CreateAppVersion {
4159 pub(crate) fn new(
4160 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4161 ) -> Self {
4162 Self(RequestBuilder::new(stub))
4163 }
4164
4165 pub fn with_request<V: Into<crate::model::CreateAppVersionRequest>>(
4167 mut self,
4168 v: V,
4169 ) -> Self {
4170 self.0.request = v.into();
4171 self
4172 }
4173
4174 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4176 self.0.options = v.into();
4177 self
4178 }
4179
4180 pub async fn send(self) -> Result<crate::model::AppVersion> {
4182 (*self.0.stub)
4183 .create_app_version(self.0.request, self.0.options)
4184 .await
4185 .map(crate::Response::into_body)
4186 }
4187
4188 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4192 self.0.request.parent = v.into();
4193 self
4194 }
4195
4196 pub fn set_app_version_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4198 self.0.request.app_version_id = v.into();
4199 self
4200 }
4201
4202 pub fn set_app_version<T>(mut self, v: T) -> Self
4206 where
4207 T: std::convert::Into<crate::model::AppVersion>,
4208 {
4209 self.0.request.app_version = std::option::Option::Some(v.into());
4210 self
4211 }
4212
4213 pub fn set_or_clear_app_version<T>(mut self, v: std::option::Option<T>) -> Self
4217 where
4218 T: std::convert::Into<crate::model::AppVersion>,
4219 {
4220 self.0.request.app_version = v.map(|x| x.into());
4221 self
4222 }
4223 }
4224
4225 #[doc(hidden)]
4226 impl crate::RequestBuilder for CreateAppVersion {
4227 fn request_options(&mut self) -> &mut crate::RequestOptions {
4228 &mut self.0.options
4229 }
4230 }
4231
4232 #[derive(Clone, Debug)]
4249 pub struct DeleteAppVersion(RequestBuilder<crate::model::DeleteAppVersionRequest>);
4250
4251 impl DeleteAppVersion {
4252 pub(crate) fn new(
4253 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4254 ) -> Self {
4255 Self(RequestBuilder::new(stub))
4256 }
4257
4258 pub fn with_request<V: Into<crate::model::DeleteAppVersionRequest>>(
4260 mut self,
4261 v: V,
4262 ) -> Self {
4263 self.0.request = v.into();
4264 self
4265 }
4266
4267 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4269 self.0.options = v.into();
4270 self
4271 }
4272
4273 pub async fn send(self) -> Result<()> {
4275 (*self.0.stub)
4276 .delete_app_version(self.0.request, self.0.options)
4277 .await
4278 .map(crate::Response::into_body)
4279 }
4280
4281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4285 self.0.request.name = v.into();
4286 self
4287 }
4288
4289 pub fn set_etag<T: Into<std::string::String>>(mut self, v: T) -> Self {
4291 self.0.request.etag = v.into();
4292 self
4293 }
4294 }
4295
4296 #[doc(hidden)]
4297 impl crate::RequestBuilder for DeleteAppVersion {
4298 fn request_options(&mut self) -> &mut crate::RequestOptions {
4299 &mut self.0.options
4300 }
4301 }
4302
4303 #[derive(Clone, Debug)]
4321 pub struct RestoreAppVersion(RequestBuilder<crate::model::RestoreAppVersionRequest>);
4322
4323 impl RestoreAppVersion {
4324 pub(crate) fn new(
4325 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4326 ) -> Self {
4327 Self(RequestBuilder::new(stub))
4328 }
4329
4330 pub fn with_request<V: Into<crate::model::RestoreAppVersionRequest>>(
4332 mut self,
4333 v: V,
4334 ) -> Self {
4335 self.0.request = v.into();
4336 self
4337 }
4338
4339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4341 self.0.options = v.into();
4342 self
4343 }
4344
4345 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4352 (*self.0.stub)
4353 .restore_app_version(self.0.request, self.0.options)
4354 .await
4355 .map(crate::Response::into_body)
4356 }
4357
4358 pub fn poller(
4360 self,
4361 ) -> impl google_cloud_lro::Poller<
4362 crate::model::RestoreAppVersionResponse,
4363 crate::model::OperationMetadata,
4364 > {
4365 type Operation = google_cloud_lro::internal::Operation<
4366 crate::model::RestoreAppVersionResponse,
4367 crate::model::OperationMetadata,
4368 >;
4369 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4370 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4371 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4372 if let Some(ref mut details) = poller_options.tracing {
4373 details.method_name =
4374 "google_cloud_ces_v1::client::AgentService::restore_app_version::until_done";
4375 }
4376
4377 let stub = self.0.stub.clone();
4378 let mut options = self.0.options.clone();
4379 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4380 let query = move |name| {
4381 let stub = stub.clone();
4382 let options = options.clone();
4383 async {
4384 let op = GetOperation::new(stub)
4385 .set_name(name)
4386 .with_options(options)
4387 .send()
4388 .await?;
4389 Ok(Operation::new(op))
4390 }
4391 };
4392
4393 let start = move || async {
4394 let op = self.send().await?;
4395 Ok(Operation::new(op))
4396 };
4397
4398 use google_cloud_lro::internal::PollerExt;
4399 {
4400 google_cloud_lro::internal::new_poller(
4401 polling_error_policy,
4402 polling_backoff_policy,
4403 start,
4404 query,
4405 )
4406 }
4407 .with_options(poller_options)
4408 }
4409
4410 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4414 self.0.request.name = v.into();
4415 self
4416 }
4417 }
4418
4419 #[doc(hidden)]
4420 impl crate::RequestBuilder for RestoreAppVersion {
4421 fn request_options(&mut self) -> &mut crate::RequestOptions {
4422 &mut self.0.options
4423 }
4424 }
4425
4426 #[derive(Clone, Debug)]
4447 pub struct ListChangelogs(RequestBuilder<crate::model::ListChangelogsRequest>);
4448
4449 impl ListChangelogs {
4450 pub(crate) fn new(
4451 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4452 ) -> Self {
4453 Self(RequestBuilder::new(stub))
4454 }
4455
4456 pub fn with_request<V: Into<crate::model::ListChangelogsRequest>>(mut self, v: V) -> Self {
4458 self.0.request = v.into();
4459 self
4460 }
4461
4462 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4464 self.0.options = v.into();
4465 self
4466 }
4467
4468 pub async fn send(self) -> Result<crate::model::ListChangelogsResponse> {
4470 (*self.0.stub)
4471 .list_changelogs(self.0.request, self.0.options)
4472 .await
4473 .map(crate::Response::into_body)
4474 }
4475
4476 pub fn by_page(
4478 self,
4479 ) -> impl google_cloud_gax::paginator::Paginator<
4480 crate::model::ListChangelogsResponse,
4481 crate::Error,
4482 > {
4483 use std::clone::Clone;
4484 let token = self.0.request.page_token.clone();
4485 let execute = move |token: String| {
4486 let mut builder = self.clone();
4487 builder.0.request = builder.0.request.set_page_token(token);
4488 builder.send()
4489 };
4490 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4491 }
4492
4493 pub fn by_item(
4495 self,
4496 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4497 crate::model::ListChangelogsResponse,
4498 crate::Error,
4499 > {
4500 use google_cloud_gax::paginator::Paginator;
4501 self.by_page().items()
4502 }
4503
4504 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4508 self.0.request.parent = v.into();
4509 self
4510 }
4511
4512 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4514 self.0.request.page_size = v.into();
4515 self
4516 }
4517
4518 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4520 self.0.request.page_token = v.into();
4521 self
4522 }
4523
4524 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4526 self.0.request.filter = v.into();
4527 self
4528 }
4529
4530 pub fn set_order_by<T: Into<std::string::String>>(mut self, v: T) -> Self {
4532 self.0.request.order_by = v.into();
4533 self
4534 }
4535 }
4536
4537 #[doc(hidden)]
4538 impl crate::RequestBuilder for ListChangelogs {
4539 fn request_options(&mut self) -> &mut crate::RequestOptions {
4540 &mut self.0.options
4541 }
4542 }
4543
4544 #[derive(Clone, Debug)]
4561 pub struct GetChangelog(RequestBuilder<crate::model::GetChangelogRequest>);
4562
4563 impl GetChangelog {
4564 pub(crate) fn new(
4565 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4566 ) -> Self {
4567 Self(RequestBuilder::new(stub))
4568 }
4569
4570 pub fn with_request<V: Into<crate::model::GetChangelogRequest>>(mut self, v: V) -> Self {
4572 self.0.request = v.into();
4573 self
4574 }
4575
4576 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4578 self.0.options = v.into();
4579 self
4580 }
4581
4582 pub async fn send(self) -> Result<crate::model::Changelog> {
4584 (*self.0.stub)
4585 .get_changelog(self.0.request, self.0.options)
4586 .await
4587 .map(crate::Response::into_body)
4588 }
4589
4590 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4594 self.0.request.name = v.into();
4595 self
4596 }
4597 }
4598
4599 #[doc(hidden)]
4600 impl crate::RequestBuilder for GetChangelog {
4601 fn request_options(&mut self) -> &mut crate::RequestOptions {
4602 &mut self.0.options
4603 }
4604 }
4605
4606 #[derive(Clone, Debug)]
4627 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4628
4629 impl ListLocations {
4630 pub(crate) fn new(
4631 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4632 ) -> Self {
4633 Self(RequestBuilder::new(stub))
4634 }
4635
4636 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4638 mut self,
4639 v: V,
4640 ) -> Self {
4641 self.0.request = v.into();
4642 self
4643 }
4644
4645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4647 self.0.options = v.into();
4648 self
4649 }
4650
4651 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4653 (*self.0.stub)
4654 .list_locations(self.0.request, self.0.options)
4655 .await
4656 .map(crate::Response::into_body)
4657 }
4658
4659 pub fn by_page(
4661 self,
4662 ) -> impl google_cloud_gax::paginator::Paginator<
4663 google_cloud_location::model::ListLocationsResponse,
4664 crate::Error,
4665 > {
4666 use std::clone::Clone;
4667 let token = self.0.request.page_token.clone();
4668 let execute = move |token: String| {
4669 let mut builder = self.clone();
4670 builder.0.request = builder.0.request.set_page_token(token);
4671 builder.send()
4672 };
4673 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4674 }
4675
4676 pub fn by_item(
4678 self,
4679 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4680 google_cloud_location::model::ListLocationsResponse,
4681 crate::Error,
4682 > {
4683 use google_cloud_gax::paginator::Paginator;
4684 self.by_page().items()
4685 }
4686
4687 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4689 self.0.request.name = v.into();
4690 self
4691 }
4692
4693 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4695 self.0.request.filter = v.into();
4696 self
4697 }
4698
4699 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4701 self.0.request.page_size = v.into();
4702 self
4703 }
4704
4705 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4707 self.0.request.page_token = v.into();
4708 self
4709 }
4710 }
4711
4712 #[doc(hidden)]
4713 impl crate::RequestBuilder for ListLocations {
4714 fn request_options(&mut self) -> &mut crate::RequestOptions {
4715 &mut self.0.options
4716 }
4717 }
4718
4719 #[derive(Clone, Debug)]
4736 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4737
4738 impl GetLocation {
4739 pub(crate) fn new(
4740 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4741 ) -> Self {
4742 Self(RequestBuilder::new(stub))
4743 }
4744
4745 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4747 mut self,
4748 v: V,
4749 ) -> Self {
4750 self.0.request = v.into();
4751 self
4752 }
4753
4754 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4756 self.0.options = v.into();
4757 self
4758 }
4759
4760 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4762 (*self.0.stub)
4763 .get_location(self.0.request, self.0.options)
4764 .await
4765 .map(crate::Response::into_body)
4766 }
4767
4768 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4770 self.0.request.name = v.into();
4771 self
4772 }
4773 }
4774
4775 #[doc(hidden)]
4776 impl crate::RequestBuilder for GetLocation {
4777 fn request_options(&mut self) -> &mut crate::RequestOptions {
4778 &mut self.0.options
4779 }
4780 }
4781
4782 #[derive(Clone, Debug)]
4803 pub struct ListOperations(
4804 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4805 );
4806
4807 impl ListOperations {
4808 pub(crate) fn new(
4809 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4810 ) -> Self {
4811 Self(RequestBuilder::new(stub))
4812 }
4813
4814 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4816 mut self,
4817 v: V,
4818 ) -> Self {
4819 self.0.request = v.into();
4820 self
4821 }
4822
4823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4825 self.0.options = v.into();
4826 self
4827 }
4828
4829 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4831 (*self.0.stub)
4832 .list_operations(self.0.request, self.0.options)
4833 .await
4834 .map(crate::Response::into_body)
4835 }
4836
4837 pub fn by_page(
4839 self,
4840 ) -> impl google_cloud_gax::paginator::Paginator<
4841 google_cloud_longrunning::model::ListOperationsResponse,
4842 crate::Error,
4843 > {
4844 use std::clone::Clone;
4845 let token = self.0.request.page_token.clone();
4846 let execute = move |token: String| {
4847 let mut builder = self.clone();
4848 builder.0.request = builder.0.request.set_page_token(token);
4849 builder.send()
4850 };
4851 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4852 }
4853
4854 pub fn by_item(
4856 self,
4857 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4858 google_cloud_longrunning::model::ListOperationsResponse,
4859 crate::Error,
4860 > {
4861 use google_cloud_gax::paginator::Paginator;
4862 self.by_page().items()
4863 }
4864
4865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4867 self.0.request.name = v.into();
4868 self
4869 }
4870
4871 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4873 self.0.request.filter = v.into();
4874 self
4875 }
4876
4877 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4879 self.0.request.page_size = v.into();
4880 self
4881 }
4882
4883 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4885 self.0.request.page_token = v.into();
4886 self
4887 }
4888
4889 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4891 self.0.request.return_partial_success = v.into();
4892 self
4893 }
4894 }
4895
4896 #[doc(hidden)]
4897 impl crate::RequestBuilder for ListOperations {
4898 fn request_options(&mut self) -> &mut crate::RequestOptions {
4899 &mut self.0.options
4900 }
4901 }
4902
4903 #[derive(Clone, Debug)]
4920 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4921
4922 impl GetOperation {
4923 pub(crate) fn new(
4924 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4925 ) -> Self {
4926 Self(RequestBuilder::new(stub))
4927 }
4928
4929 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4931 mut self,
4932 v: V,
4933 ) -> Self {
4934 self.0.request = v.into();
4935 self
4936 }
4937
4938 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4940 self.0.options = v.into();
4941 self
4942 }
4943
4944 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4946 (*self.0.stub)
4947 .get_operation(self.0.request, self.0.options)
4948 .await
4949 .map(crate::Response::into_body)
4950 }
4951
4952 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4954 self.0.request.name = v.into();
4955 self
4956 }
4957 }
4958
4959 #[doc(hidden)]
4960 impl crate::RequestBuilder for GetOperation {
4961 fn request_options(&mut self) -> &mut crate::RequestOptions {
4962 &mut self.0.options
4963 }
4964 }
4965
4966 #[derive(Clone, Debug)]
4983 pub struct DeleteOperation(
4984 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
4985 );
4986
4987 impl DeleteOperation {
4988 pub(crate) fn new(
4989 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
4990 ) -> Self {
4991 Self(RequestBuilder::new(stub))
4992 }
4993
4994 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
4996 mut self,
4997 v: V,
4998 ) -> Self {
4999 self.0.request = v.into();
5000 self
5001 }
5002
5003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5005 self.0.options = v.into();
5006 self
5007 }
5008
5009 pub async fn send(self) -> Result<()> {
5011 (*self.0.stub)
5012 .delete_operation(self.0.request, self.0.options)
5013 .await
5014 .map(crate::Response::into_body)
5015 }
5016
5017 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5019 self.0.request.name = v.into();
5020 self
5021 }
5022 }
5023
5024 #[doc(hidden)]
5025 impl crate::RequestBuilder for DeleteOperation {
5026 fn request_options(&mut self) -> &mut crate::RequestOptions {
5027 &mut self.0.options
5028 }
5029 }
5030
5031 #[derive(Clone, Debug)]
5048 pub struct CancelOperation(
5049 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5050 );
5051
5052 impl CancelOperation {
5053 pub(crate) fn new(
5054 stub: std::sync::Arc<dyn super::super::stub::dynamic::AgentService>,
5055 ) -> Self {
5056 Self(RequestBuilder::new(stub))
5057 }
5058
5059 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5061 mut self,
5062 v: V,
5063 ) -> Self {
5064 self.0.request = v.into();
5065 self
5066 }
5067
5068 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5070 self.0.options = v.into();
5071 self
5072 }
5073
5074 pub async fn send(self) -> Result<()> {
5076 (*self.0.stub)
5077 .cancel_operation(self.0.request, self.0.options)
5078 .await
5079 .map(crate::Response::into_body)
5080 }
5081
5082 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5084 self.0.request.name = v.into();
5085 self
5086 }
5087 }
5088
5089 #[doc(hidden)]
5090 impl crate::RequestBuilder for CancelOperation {
5091 fn request_options(&mut self) -> &mut crate::RequestOptions {
5092 &mut self.0.options
5093 }
5094 }
5095}
5096
5097pub mod session_service {
5099 use crate::Result;
5100
5101 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5115
5116 pub(crate) mod client {
5117 use super::super::super::client::SessionService;
5118 pub struct Factory;
5119 impl crate::ClientFactory for Factory {
5120 type Client = SessionService;
5121 type Credentials = gaxi::options::Credentials;
5122 async fn build(
5123 self,
5124 config: gaxi::options::ClientConfig,
5125 ) -> crate::ClientBuilderResult<Self::Client> {
5126 Self::Client::new(config).await
5127 }
5128 }
5129 }
5130
5131 #[derive(Clone, Debug)]
5133 pub(crate) struct RequestBuilder<R: std::default::Default> {
5134 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5135 request: R,
5136 options: crate::RequestOptions,
5137 }
5138
5139 impl<R> RequestBuilder<R>
5140 where
5141 R: std::default::Default,
5142 {
5143 pub(crate) fn new(
5144 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5145 ) -> Self {
5146 Self {
5147 stub,
5148 request: R::default(),
5149 options: crate::RequestOptions::default(),
5150 }
5151 }
5152 }
5153
5154 #[derive(Clone, Debug)]
5171 pub struct RunSession(RequestBuilder<crate::model::RunSessionRequest>);
5172
5173 impl RunSession {
5174 pub(crate) fn new(
5175 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5176 ) -> Self {
5177 Self(RequestBuilder::new(stub))
5178 }
5179
5180 pub fn with_request<V: Into<crate::model::RunSessionRequest>>(mut self, v: V) -> Self {
5182 self.0.request = v.into();
5183 self
5184 }
5185
5186 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5188 self.0.options = v.into();
5189 self
5190 }
5191
5192 pub async fn send(self) -> Result<crate::model::RunSessionResponse> {
5194 (*self.0.stub)
5195 .run_session(self.0.request, self.0.options)
5196 .await
5197 .map(crate::Response::into_body)
5198 }
5199
5200 pub fn set_config<T>(mut self, v: T) -> Self
5204 where
5205 T: std::convert::Into<crate::model::SessionConfig>,
5206 {
5207 self.0.request.config = std::option::Option::Some(v.into());
5208 self
5209 }
5210
5211 pub fn set_or_clear_config<T>(mut self, v: std::option::Option<T>) -> Self
5215 where
5216 T: std::convert::Into<crate::model::SessionConfig>,
5217 {
5218 self.0.request.config = v.map(|x| x.into());
5219 self
5220 }
5221
5222 pub fn set_inputs<T, V>(mut self, v: T) -> Self
5226 where
5227 T: std::iter::IntoIterator<Item = V>,
5228 V: std::convert::Into<crate::model::SessionInput>,
5229 {
5230 use std::iter::Iterator;
5231 self.0.request.inputs = v.into_iter().map(|i| i.into()).collect();
5232 self
5233 }
5234 }
5235
5236 #[doc(hidden)]
5237 impl crate::RequestBuilder for RunSession {
5238 fn request_options(&mut self) -> &mut crate::RequestOptions {
5239 &mut self.0.options
5240 }
5241 }
5242
5243 #[derive(Clone, Debug)]
5264 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5265
5266 impl ListLocations {
5267 pub(crate) fn new(
5268 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5269 ) -> Self {
5270 Self(RequestBuilder::new(stub))
5271 }
5272
5273 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5275 mut self,
5276 v: V,
5277 ) -> Self {
5278 self.0.request = v.into();
5279 self
5280 }
5281
5282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5284 self.0.options = v.into();
5285 self
5286 }
5287
5288 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5290 (*self.0.stub)
5291 .list_locations(self.0.request, self.0.options)
5292 .await
5293 .map(crate::Response::into_body)
5294 }
5295
5296 pub fn by_page(
5298 self,
5299 ) -> impl google_cloud_gax::paginator::Paginator<
5300 google_cloud_location::model::ListLocationsResponse,
5301 crate::Error,
5302 > {
5303 use std::clone::Clone;
5304 let token = self.0.request.page_token.clone();
5305 let execute = move |token: String| {
5306 let mut builder = self.clone();
5307 builder.0.request = builder.0.request.set_page_token(token);
5308 builder.send()
5309 };
5310 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5311 }
5312
5313 pub fn by_item(
5315 self,
5316 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5317 google_cloud_location::model::ListLocationsResponse,
5318 crate::Error,
5319 > {
5320 use google_cloud_gax::paginator::Paginator;
5321 self.by_page().items()
5322 }
5323
5324 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5326 self.0.request.name = v.into();
5327 self
5328 }
5329
5330 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5332 self.0.request.filter = v.into();
5333 self
5334 }
5335
5336 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5338 self.0.request.page_size = v.into();
5339 self
5340 }
5341
5342 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5344 self.0.request.page_token = v.into();
5345 self
5346 }
5347 }
5348
5349 #[doc(hidden)]
5350 impl crate::RequestBuilder for ListLocations {
5351 fn request_options(&mut self) -> &mut crate::RequestOptions {
5352 &mut self.0.options
5353 }
5354 }
5355
5356 #[derive(Clone, Debug)]
5373 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5374
5375 impl GetLocation {
5376 pub(crate) fn new(
5377 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5378 ) -> Self {
5379 Self(RequestBuilder::new(stub))
5380 }
5381
5382 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5384 mut self,
5385 v: V,
5386 ) -> Self {
5387 self.0.request = v.into();
5388 self
5389 }
5390
5391 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5393 self.0.options = v.into();
5394 self
5395 }
5396
5397 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5399 (*self.0.stub)
5400 .get_location(self.0.request, self.0.options)
5401 .await
5402 .map(crate::Response::into_body)
5403 }
5404
5405 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5407 self.0.request.name = v.into();
5408 self
5409 }
5410 }
5411
5412 #[doc(hidden)]
5413 impl crate::RequestBuilder for GetLocation {
5414 fn request_options(&mut self) -> &mut crate::RequestOptions {
5415 &mut self.0.options
5416 }
5417 }
5418
5419 #[derive(Clone, Debug)]
5440 pub struct ListOperations(
5441 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5442 );
5443
5444 impl ListOperations {
5445 pub(crate) fn new(
5446 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5447 ) -> Self {
5448 Self(RequestBuilder::new(stub))
5449 }
5450
5451 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5453 mut self,
5454 v: V,
5455 ) -> Self {
5456 self.0.request = v.into();
5457 self
5458 }
5459
5460 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5462 self.0.options = v.into();
5463 self
5464 }
5465
5466 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5468 (*self.0.stub)
5469 .list_operations(self.0.request, self.0.options)
5470 .await
5471 .map(crate::Response::into_body)
5472 }
5473
5474 pub fn by_page(
5476 self,
5477 ) -> impl google_cloud_gax::paginator::Paginator<
5478 google_cloud_longrunning::model::ListOperationsResponse,
5479 crate::Error,
5480 > {
5481 use std::clone::Clone;
5482 let token = self.0.request.page_token.clone();
5483 let execute = move |token: String| {
5484 let mut builder = self.clone();
5485 builder.0.request = builder.0.request.set_page_token(token);
5486 builder.send()
5487 };
5488 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5489 }
5490
5491 pub fn by_item(
5493 self,
5494 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5495 google_cloud_longrunning::model::ListOperationsResponse,
5496 crate::Error,
5497 > {
5498 use google_cloud_gax::paginator::Paginator;
5499 self.by_page().items()
5500 }
5501
5502 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5504 self.0.request.name = v.into();
5505 self
5506 }
5507
5508 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5510 self.0.request.filter = v.into();
5511 self
5512 }
5513
5514 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5516 self.0.request.page_size = v.into();
5517 self
5518 }
5519
5520 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5522 self.0.request.page_token = v.into();
5523 self
5524 }
5525
5526 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5528 self.0.request.return_partial_success = v.into();
5529 self
5530 }
5531 }
5532
5533 #[doc(hidden)]
5534 impl crate::RequestBuilder for ListOperations {
5535 fn request_options(&mut self) -> &mut crate::RequestOptions {
5536 &mut self.0.options
5537 }
5538 }
5539
5540 #[derive(Clone, Debug)]
5557 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5558
5559 impl GetOperation {
5560 pub(crate) fn new(
5561 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5562 ) -> Self {
5563 Self(RequestBuilder::new(stub))
5564 }
5565
5566 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5568 mut self,
5569 v: V,
5570 ) -> Self {
5571 self.0.request = v.into();
5572 self
5573 }
5574
5575 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5577 self.0.options = v.into();
5578 self
5579 }
5580
5581 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5583 (*self.0.stub)
5584 .get_operation(self.0.request, self.0.options)
5585 .await
5586 .map(crate::Response::into_body)
5587 }
5588
5589 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5591 self.0.request.name = v.into();
5592 self
5593 }
5594 }
5595
5596 #[doc(hidden)]
5597 impl crate::RequestBuilder for GetOperation {
5598 fn request_options(&mut self) -> &mut crate::RequestOptions {
5599 &mut self.0.options
5600 }
5601 }
5602
5603 #[derive(Clone, Debug)]
5620 pub struct DeleteOperation(
5621 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
5622 );
5623
5624 impl DeleteOperation {
5625 pub(crate) fn new(
5626 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5627 ) -> Self {
5628 Self(RequestBuilder::new(stub))
5629 }
5630
5631 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
5633 mut self,
5634 v: V,
5635 ) -> Self {
5636 self.0.request = v.into();
5637 self
5638 }
5639
5640 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5642 self.0.options = v.into();
5643 self
5644 }
5645
5646 pub async fn send(self) -> Result<()> {
5648 (*self.0.stub)
5649 .delete_operation(self.0.request, self.0.options)
5650 .await
5651 .map(crate::Response::into_body)
5652 }
5653
5654 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5656 self.0.request.name = v.into();
5657 self
5658 }
5659 }
5660
5661 #[doc(hidden)]
5662 impl crate::RequestBuilder for DeleteOperation {
5663 fn request_options(&mut self) -> &mut crate::RequestOptions {
5664 &mut self.0.options
5665 }
5666 }
5667
5668 #[derive(Clone, Debug)]
5685 pub struct CancelOperation(
5686 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5687 );
5688
5689 impl CancelOperation {
5690 pub(crate) fn new(
5691 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionService>,
5692 ) -> Self {
5693 Self(RequestBuilder::new(stub))
5694 }
5695
5696 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5698 mut self,
5699 v: V,
5700 ) -> Self {
5701 self.0.request = v.into();
5702 self
5703 }
5704
5705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5707 self.0.options = v.into();
5708 self
5709 }
5710
5711 pub async fn send(self) -> Result<()> {
5713 (*self.0.stub)
5714 .cancel_operation(self.0.request, self.0.options)
5715 .await
5716 .map(crate::Response::into_body)
5717 }
5718
5719 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5721 self.0.request.name = v.into();
5722 self
5723 }
5724 }
5725
5726 #[doc(hidden)]
5727 impl crate::RequestBuilder for CancelOperation {
5728 fn request_options(&mut self) -> &mut crate::RequestOptions {
5729 &mut self.0.options
5730 }
5731 }
5732}
5733
5734pub mod tool_service {
5736 use crate::Result;
5737
5738 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5752
5753 pub(crate) mod client {
5754 use super::super::super::client::ToolService;
5755 pub struct Factory;
5756 impl crate::ClientFactory for Factory {
5757 type Client = ToolService;
5758 type Credentials = gaxi::options::Credentials;
5759 async fn build(
5760 self,
5761 config: gaxi::options::ClientConfig,
5762 ) -> crate::ClientBuilderResult<Self::Client> {
5763 Self::Client::new(config).await
5764 }
5765 }
5766 }
5767
5768 #[derive(Clone, Debug)]
5770 pub(crate) struct RequestBuilder<R: std::default::Default> {
5771 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5772 request: R,
5773 options: crate::RequestOptions,
5774 }
5775
5776 impl<R> RequestBuilder<R>
5777 where
5778 R: std::default::Default,
5779 {
5780 pub(crate) fn new(
5781 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5782 ) -> Self {
5783 Self {
5784 stub,
5785 request: R::default(),
5786 options: crate::RequestOptions::default(),
5787 }
5788 }
5789 }
5790
5791 #[derive(Clone, Debug)]
5808 pub struct ExecuteTool(RequestBuilder<crate::model::ExecuteToolRequest>);
5809
5810 impl ExecuteTool {
5811 pub(crate) fn new(
5812 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5813 ) -> Self {
5814 Self(RequestBuilder::new(stub))
5815 }
5816
5817 pub fn with_request<V: Into<crate::model::ExecuteToolRequest>>(mut self, v: V) -> Self {
5819 self.0.request = v.into();
5820 self
5821 }
5822
5823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5825 self.0.options = v.into();
5826 self
5827 }
5828
5829 pub async fn send(self) -> Result<crate::model::ExecuteToolResponse> {
5831 (*self.0.stub)
5832 .execute_tool(self.0.request, self.0.options)
5833 .await
5834 .map(crate::Response::into_body)
5835 }
5836
5837 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5841 self.0.request.parent = v.into();
5842 self
5843 }
5844
5845 pub fn set_args<T>(mut self, v: T) -> Self
5847 where
5848 T: std::convert::Into<wkt::Struct>,
5849 {
5850 self.0.request.args = std::option::Option::Some(v.into());
5851 self
5852 }
5853
5854 pub fn set_or_clear_args<T>(mut self, v: std::option::Option<T>) -> Self
5856 where
5857 T: std::convert::Into<wkt::Struct>,
5858 {
5859 self.0.request.args = v.map(|x| x.into());
5860 self
5861 }
5862
5863 pub fn set_mock_config<T>(mut self, v: T) -> Self
5865 where
5866 T: std::convert::Into<crate::model::MockConfig>,
5867 {
5868 self.0.request.mock_config = std::option::Option::Some(v.into());
5869 self
5870 }
5871
5872 pub fn set_or_clear_mock_config<T>(mut self, v: std::option::Option<T>) -> Self
5874 where
5875 T: std::convert::Into<crate::model::MockConfig>,
5876 {
5877 self.0.request.mock_config = v.map(|x| x.into());
5878 self
5879 }
5880
5881 pub fn set_tool_identifier<
5886 T: Into<Option<crate::model::execute_tool_request::ToolIdentifier>>,
5887 >(
5888 mut self,
5889 v: T,
5890 ) -> Self {
5891 self.0.request.tool_identifier = v.into();
5892 self
5893 }
5894
5895 pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
5901 self.0.request = self.0.request.set_tool(v);
5902 self
5903 }
5904
5905 pub fn set_toolset_tool<
5911 T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>,
5912 >(
5913 mut self,
5914 v: T,
5915 ) -> Self {
5916 self.0.request = self.0.request.set_toolset_tool(v);
5917 self
5918 }
5919
5920 pub fn set_tool_execution_context<
5925 T: Into<Option<crate::model::execute_tool_request::ToolExecutionContext>>,
5926 >(
5927 mut self,
5928 v: T,
5929 ) -> Self {
5930 self.0.request.tool_execution_context = v.into();
5931 self
5932 }
5933
5934 pub fn set_variables<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
5940 mut self,
5941 v: T,
5942 ) -> Self {
5943 self.0.request = self.0.request.set_variables(v);
5944 self
5945 }
5946
5947 pub fn set_context<T: std::convert::Into<std::boxed::Box<wkt::Struct>>>(
5953 mut self,
5954 v: T,
5955 ) -> Self {
5956 self.0.request = self.0.request.set_context(v);
5957 self
5958 }
5959 }
5960
5961 #[doc(hidden)]
5962 impl crate::RequestBuilder for ExecuteTool {
5963 fn request_options(&mut self) -> &mut crate::RequestOptions {
5964 &mut self.0.options
5965 }
5966 }
5967
5968 #[derive(Clone, Debug)]
5985 pub struct RetrieveToolSchema(RequestBuilder<crate::model::RetrieveToolSchemaRequest>);
5986
5987 impl RetrieveToolSchema {
5988 pub(crate) fn new(
5989 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
5990 ) -> Self {
5991 Self(RequestBuilder::new(stub))
5992 }
5993
5994 pub fn with_request<V: Into<crate::model::RetrieveToolSchemaRequest>>(
5996 mut self,
5997 v: V,
5998 ) -> Self {
5999 self.0.request = v.into();
6000 self
6001 }
6002
6003 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6005 self.0.options = v.into();
6006 self
6007 }
6008
6009 pub async fn send(self) -> Result<crate::model::RetrieveToolSchemaResponse> {
6011 (*self.0.stub)
6012 .retrieve_tool_schema(self.0.request, self.0.options)
6013 .await
6014 .map(crate::Response::into_body)
6015 }
6016
6017 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6021 self.0.request.parent = v.into();
6022 self
6023 }
6024
6025 pub fn set_tool_identifier<
6030 T: Into<Option<crate::model::retrieve_tool_schema_request::ToolIdentifier>>,
6031 >(
6032 mut self,
6033 v: T,
6034 ) -> Self {
6035 self.0.request.tool_identifier = v.into();
6036 self
6037 }
6038
6039 pub fn set_tool<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
6045 self.0.request = self.0.request.set_tool(v);
6046 self
6047 }
6048
6049 pub fn set_toolset_tool<
6055 T: std::convert::Into<std::boxed::Box<crate::model::ToolsetTool>>,
6056 >(
6057 mut self,
6058 v: T,
6059 ) -> Self {
6060 self.0.request = self.0.request.set_toolset_tool(v);
6061 self
6062 }
6063 }
6064
6065 #[doc(hidden)]
6066 impl crate::RequestBuilder for RetrieveToolSchema {
6067 fn request_options(&mut self) -> &mut crate::RequestOptions {
6068 &mut self.0.options
6069 }
6070 }
6071
6072 #[derive(Clone, Debug)]
6089 pub struct RetrieveTools(RequestBuilder<crate::model::RetrieveToolsRequest>);
6090
6091 impl RetrieveTools {
6092 pub(crate) fn new(
6093 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6094 ) -> Self {
6095 Self(RequestBuilder::new(stub))
6096 }
6097
6098 pub fn with_request<V: Into<crate::model::RetrieveToolsRequest>>(mut self, v: V) -> Self {
6100 self.0.request = v.into();
6101 self
6102 }
6103
6104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6106 self.0.options = v.into();
6107 self
6108 }
6109
6110 pub async fn send(self) -> Result<crate::model::RetrieveToolsResponse> {
6112 (*self.0.stub)
6113 .retrieve_tools(self.0.request, self.0.options)
6114 .await
6115 .map(crate::Response::into_body)
6116 }
6117
6118 pub fn set_toolset<T: Into<std::string::String>>(mut self, v: T) -> Self {
6122 self.0.request.toolset = v.into();
6123 self
6124 }
6125
6126 pub fn set_tool_ids<T, V>(mut self, v: T) -> Self
6128 where
6129 T: std::iter::IntoIterator<Item = V>,
6130 V: std::convert::Into<std::string::String>,
6131 {
6132 use std::iter::Iterator;
6133 self.0.request.tool_ids = v.into_iter().map(|i| i.into()).collect();
6134 self
6135 }
6136
6137 pub fn set_bypass_persistence_config<T: Into<bool>>(mut self, v: T) -> Self {
6139 self.0.request.bypass_persistence_config = v.into();
6140 self
6141 }
6142 }
6143
6144 #[doc(hidden)]
6145 impl crate::RequestBuilder for RetrieveTools {
6146 fn request_options(&mut self) -> &mut crate::RequestOptions {
6147 &mut self.0.options
6148 }
6149 }
6150
6151 #[derive(Clone, Debug)]
6172 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6173
6174 impl ListLocations {
6175 pub(crate) fn new(
6176 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6177 ) -> Self {
6178 Self(RequestBuilder::new(stub))
6179 }
6180
6181 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6183 mut self,
6184 v: V,
6185 ) -> Self {
6186 self.0.request = v.into();
6187 self
6188 }
6189
6190 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6192 self.0.options = v.into();
6193 self
6194 }
6195
6196 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6198 (*self.0.stub)
6199 .list_locations(self.0.request, self.0.options)
6200 .await
6201 .map(crate::Response::into_body)
6202 }
6203
6204 pub fn by_page(
6206 self,
6207 ) -> impl google_cloud_gax::paginator::Paginator<
6208 google_cloud_location::model::ListLocationsResponse,
6209 crate::Error,
6210 > {
6211 use std::clone::Clone;
6212 let token = self.0.request.page_token.clone();
6213 let execute = move |token: String| {
6214 let mut builder = self.clone();
6215 builder.0.request = builder.0.request.set_page_token(token);
6216 builder.send()
6217 };
6218 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6219 }
6220
6221 pub fn by_item(
6223 self,
6224 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6225 google_cloud_location::model::ListLocationsResponse,
6226 crate::Error,
6227 > {
6228 use google_cloud_gax::paginator::Paginator;
6229 self.by_page().items()
6230 }
6231
6232 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6234 self.0.request.name = v.into();
6235 self
6236 }
6237
6238 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6240 self.0.request.filter = v.into();
6241 self
6242 }
6243
6244 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6246 self.0.request.page_size = v.into();
6247 self
6248 }
6249
6250 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6252 self.0.request.page_token = v.into();
6253 self
6254 }
6255 }
6256
6257 #[doc(hidden)]
6258 impl crate::RequestBuilder for ListLocations {
6259 fn request_options(&mut self) -> &mut crate::RequestOptions {
6260 &mut self.0.options
6261 }
6262 }
6263
6264 #[derive(Clone, Debug)]
6281 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6282
6283 impl GetLocation {
6284 pub(crate) fn new(
6285 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6286 ) -> Self {
6287 Self(RequestBuilder::new(stub))
6288 }
6289
6290 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6292 mut self,
6293 v: V,
6294 ) -> Self {
6295 self.0.request = v.into();
6296 self
6297 }
6298
6299 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6301 self.0.options = v.into();
6302 self
6303 }
6304
6305 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6307 (*self.0.stub)
6308 .get_location(self.0.request, self.0.options)
6309 .await
6310 .map(crate::Response::into_body)
6311 }
6312
6313 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6315 self.0.request.name = v.into();
6316 self
6317 }
6318 }
6319
6320 #[doc(hidden)]
6321 impl crate::RequestBuilder for GetLocation {
6322 fn request_options(&mut self) -> &mut crate::RequestOptions {
6323 &mut self.0.options
6324 }
6325 }
6326
6327 #[derive(Clone, Debug)]
6348 pub struct ListOperations(
6349 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6350 );
6351
6352 impl ListOperations {
6353 pub(crate) fn new(
6354 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6355 ) -> Self {
6356 Self(RequestBuilder::new(stub))
6357 }
6358
6359 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6361 mut self,
6362 v: V,
6363 ) -> Self {
6364 self.0.request = v.into();
6365 self
6366 }
6367
6368 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6370 self.0.options = v.into();
6371 self
6372 }
6373
6374 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
6376 (*self.0.stub)
6377 .list_operations(self.0.request, self.0.options)
6378 .await
6379 .map(crate::Response::into_body)
6380 }
6381
6382 pub fn by_page(
6384 self,
6385 ) -> impl google_cloud_gax::paginator::Paginator<
6386 google_cloud_longrunning::model::ListOperationsResponse,
6387 crate::Error,
6388 > {
6389 use std::clone::Clone;
6390 let token = self.0.request.page_token.clone();
6391 let execute = move |token: String| {
6392 let mut builder = self.clone();
6393 builder.0.request = builder.0.request.set_page_token(token);
6394 builder.send()
6395 };
6396 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6397 }
6398
6399 pub fn by_item(
6401 self,
6402 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6403 google_cloud_longrunning::model::ListOperationsResponse,
6404 crate::Error,
6405 > {
6406 use google_cloud_gax::paginator::Paginator;
6407 self.by_page().items()
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 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6418 self.0.request.filter = v.into();
6419 self
6420 }
6421
6422 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6424 self.0.request.page_size = v.into();
6425 self
6426 }
6427
6428 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6430 self.0.request.page_token = v.into();
6431 self
6432 }
6433
6434 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
6436 self.0.request.return_partial_success = v.into();
6437 self
6438 }
6439 }
6440
6441 #[doc(hidden)]
6442 impl crate::RequestBuilder for ListOperations {
6443 fn request_options(&mut self) -> &mut crate::RequestOptions {
6444 &mut self.0.options
6445 }
6446 }
6447
6448 #[derive(Clone, Debug)]
6465 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
6466
6467 impl GetOperation {
6468 pub(crate) fn new(
6469 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6470 ) -> Self {
6471 Self(RequestBuilder::new(stub))
6472 }
6473
6474 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
6476 mut self,
6477 v: V,
6478 ) -> Self {
6479 self.0.request = v.into();
6480 self
6481 }
6482
6483 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6485 self.0.options = v.into();
6486 self
6487 }
6488
6489 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6491 (*self.0.stub)
6492 .get_operation(self.0.request, self.0.options)
6493 .await
6494 .map(crate::Response::into_body)
6495 }
6496
6497 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6499 self.0.request.name = v.into();
6500 self
6501 }
6502 }
6503
6504 #[doc(hidden)]
6505 impl crate::RequestBuilder for GetOperation {
6506 fn request_options(&mut self) -> &mut crate::RequestOptions {
6507 &mut self.0.options
6508 }
6509 }
6510
6511 #[derive(Clone, Debug)]
6528 pub struct DeleteOperation(
6529 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
6530 );
6531
6532 impl DeleteOperation {
6533 pub(crate) fn new(
6534 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6535 ) -> Self {
6536 Self(RequestBuilder::new(stub))
6537 }
6538
6539 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
6541 mut self,
6542 v: V,
6543 ) -> Self {
6544 self.0.request = v.into();
6545 self
6546 }
6547
6548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6550 self.0.options = v.into();
6551 self
6552 }
6553
6554 pub async fn send(self) -> Result<()> {
6556 (*self.0.stub)
6557 .delete_operation(self.0.request, self.0.options)
6558 .await
6559 .map(crate::Response::into_body)
6560 }
6561
6562 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6564 self.0.request.name = v.into();
6565 self
6566 }
6567 }
6568
6569 #[doc(hidden)]
6570 impl crate::RequestBuilder for DeleteOperation {
6571 fn request_options(&mut self) -> &mut crate::RequestOptions {
6572 &mut self.0.options
6573 }
6574 }
6575
6576 #[derive(Clone, Debug)]
6593 pub struct CancelOperation(
6594 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
6595 );
6596
6597 impl CancelOperation {
6598 pub(crate) fn new(
6599 stub: std::sync::Arc<dyn super::super::stub::dynamic::ToolService>,
6600 ) -> Self {
6601 Self(RequestBuilder::new(stub))
6602 }
6603
6604 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
6606 mut self,
6607 v: V,
6608 ) -> Self {
6609 self.0.request = v.into();
6610 self
6611 }
6612
6613 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6615 self.0.options = v.into();
6616 self
6617 }
6618
6619 pub async fn send(self) -> Result<()> {
6621 (*self.0.stub)
6622 .cancel_operation(self.0.request, self.0.options)
6623 .await
6624 .map(crate::Response::into_body)
6625 }
6626
6627 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6629 self.0.request.name = v.into();
6630 self
6631 }
6632 }
6633
6634 #[doc(hidden)]
6635 impl crate::RequestBuilder for CancelOperation {
6636 fn request_options(&mut self) -> &mut crate::RequestOptions {
6637 &mut self.0.options
6638 }
6639 }
6640}
6641
6642pub mod widget_service {
6644 use crate::Result;
6645
6646 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
6660
6661 pub(crate) mod client {
6662 use super::super::super::client::WidgetService;
6663 pub struct Factory;
6664 impl crate::ClientFactory for Factory {
6665 type Client = WidgetService;
6666 type Credentials = gaxi::options::Credentials;
6667 async fn build(
6668 self,
6669 config: gaxi::options::ClientConfig,
6670 ) -> crate::ClientBuilderResult<Self::Client> {
6671 Self::Client::new(config).await
6672 }
6673 }
6674 }
6675
6676 #[derive(Clone, Debug)]
6678 pub(crate) struct RequestBuilder<R: std::default::Default> {
6679 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6680 request: R,
6681 options: crate::RequestOptions,
6682 }
6683
6684 impl<R> RequestBuilder<R>
6685 where
6686 R: std::default::Default,
6687 {
6688 pub(crate) fn new(
6689 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6690 ) -> Self {
6691 Self {
6692 stub,
6693 request: R::default(),
6694 options: crate::RequestOptions::default(),
6695 }
6696 }
6697 }
6698
6699 #[derive(Clone, Debug)]
6716 pub struct GenerateChatToken(RequestBuilder<crate::model::GenerateChatTokenRequest>);
6717
6718 impl GenerateChatToken {
6719 pub(crate) fn new(
6720 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6721 ) -> Self {
6722 Self(RequestBuilder::new(stub))
6723 }
6724
6725 pub fn with_request<V: Into<crate::model::GenerateChatTokenRequest>>(
6727 mut self,
6728 v: V,
6729 ) -> Self {
6730 self.0.request = v.into();
6731 self
6732 }
6733
6734 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6736 self.0.options = v.into();
6737 self
6738 }
6739
6740 pub async fn send(self) -> Result<crate::model::GenerateChatTokenResponse> {
6742 (*self.0.stub)
6743 .generate_chat_token(self.0.request, self.0.options)
6744 .await
6745 .map(crate::Response::into_body)
6746 }
6747
6748 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6752 self.0.request.name = v.into();
6753 self
6754 }
6755
6756 pub fn set_deployment<T: Into<std::string::String>>(mut self, v: T) -> Self {
6760 self.0.request.deployment = v.into();
6761 self
6762 }
6763
6764 pub fn set_recaptcha_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6766 self.0.request.recaptcha_token = v.into();
6767 self
6768 }
6769
6770 pub fn set_live_handoff_enabled<T: Into<bool>>(mut self, v: T) -> Self {
6772 self.0.request.live_handoff_enabled = v.into();
6773 self
6774 }
6775 }
6776
6777 #[doc(hidden)]
6778 impl crate::RequestBuilder for GenerateChatToken {
6779 fn request_options(&mut self) -> &mut crate::RequestOptions {
6780 &mut self.0.options
6781 }
6782 }
6783
6784 #[derive(Clone, Debug)]
6805 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6806
6807 impl ListLocations {
6808 pub(crate) fn new(
6809 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6810 ) -> Self {
6811 Self(RequestBuilder::new(stub))
6812 }
6813
6814 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6816 mut self,
6817 v: V,
6818 ) -> Self {
6819 self.0.request = v.into();
6820 self
6821 }
6822
6823 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6825 self.0.options = v.into();
6826 self
6827 }
6828
6829 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6831 (*self.0.stub)
6832 .list_locations(self.0.request, self.0.options)
6833 .await
6834 .map(crate::Response::into_body)
6835 }
6836
6837 pub fn by_page(
6839 self,
6840 ) -> impl google_cloud_gax::paginator::Paginator<
6841 google_cloud_location::model::ListLocationsResponse,
6842 crate::Error,
6843 > {
6844 use std::clone::Clone;
6845 let token = self.0.request.page_token.clone();
6846 let execute = move |token: String| {
6847 let mut builder = self.clone();
6848 builder.0.request = builder.0.request.set_page_token(token);
6849 builder.send()
6850 };
6851 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6852 }
6853
6854 pub fn by_item(
6856 self,
6857 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6858 google_cloud_location::model::ListLocationsResponse,
6859 crate::Error,
6860 > {
6861 use google_cloud_gax::paginator::Paginator;
6862 self.by_page().items()
6863 }
6864
6865 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6867 self.0.request.name = v.into();
6868 self
6869 }
6870
6871 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6873 self.0.request.filter = v.into();
6874 self
6875 }
6876
6877 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6879 self.0.request.page_size = v.into();
6880 self
6881 }
6882
6883 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6885 self.0.request.page_token = v.into();
6886 self
6887 }
6888 }
6889
6890 #[doc(hidden)]
6891 impl crate::RequestBuilder for ListLocations {
6892 fn request_options(&mut self) -> &mut crate::RequestOptions {
6893 &mut self.0.options
6894 }
6895 }
6896
6897 #[derive(Clone, Debug)]
6914 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6915
6916 impl GetLocation {
6917 pub(crate) fn new(
6918 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6919 ) -> Self {
6920 Self(RequestBuilder::new(stub))
6921 }
6922
6923 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6925 mut self,
6926 v: V,
6927 ) -> Self {
6928 self.0.request = v.into();
6929 self
6930 }
6931
6932 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6934 self.0.options = v.into();
6935 self
6936 }
6937
6938 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6940 (*self.0.stub)
6941 .get_location(self.0.request, self.0.options)
6942 .await
6943 .map(crate::Response::into_body)
6944 }
6945
6946 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6948 self.0.request.name = v.into();
6949 self
6950 }
6951 }
6952
6953 #[doc(hidden)]
6954 impl crate::RequestBuilder for GetLocation {
6955 fn request_options(&mut self) -> &mut crate::RequestOptions {
6956 &mut self.0.options
6957 }
6958 }
6959
6960 #[derive(Clone, Debug)]
6981 pub struct ListOperations(
6982 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6983 );
6984
6985 impl ListOperations {
6986 pub(crate) fn new(
6987 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
6988 ) -> Self {
6989 Self(RequestBuilder::new(stub))
6990 }
6991
6992 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
6994 mut self,
6995 v: V,
6996 ) -> Self {
6997 self.0.request = v.into();
6998 self
6999 }
7000
7001 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7003 self.0.options = v.into();
7004 self
7005 }
7006
7007 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7009 (*self.0.stub)
7010 .list_operations(self.0.request, self.0.options)
7011 .await
7012 .map(crate::Response::into_body)
7013 }
7014
7015 pub fn by_page(
7017 self,
7018 ) -> impl google_cloud_gax::paginator::Paginator<
7019 google_cloud_longrunning::model::ListOperationsResponse,
7020 crate::Error,
7021 > {
7022 use std::clone::Clone;
7023 let token = self.0.request.page_token.clone();
7024 let execute = move |token: String| {
7025 let mut builder = self.clone();
7026 builder.0.request = builder.0.request.set_page_token(token);
7027 builder.send()
7028 };
7029 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7030 }
7031
7032 pub fn by_item(
7034 self,
7035 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7036 google_cloud_longrunning::model::ListOperationsResponse,
7037 crate::Error,
7038 > {
7039 use google_cloud_gax::paginator::Paginator;
7040 self.by_page().items()
7041 }
7042
7043 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7045 self.0.request.name = v.into();
7046 self
7047 }
7048
7049 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7051 self.0.request.filter = v.into();
7052 self
7053 }
7054
7055 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7057 self.0.request.page_size = v.into();
7058 self
7059 }
7060
7061 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7063 self.0.request.page_token = v.into();
7064 self
7065 }
7066
7067 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7069 self.0.request.return_partial_success = v.into();
7070 self
7071 }
7072 }
7073
7074 #[doc(hidden)]
7075 impl crate::RequestBuilder for ListOperations {
7076 fn request_options(&mut self) -> &mut crate::RequestOptions {
7077 &mut self.0.options
7078 }
7079 }
7080
7081 #[derive(Clone, Debug)]
7098 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7099
7100 impl GetOperation {
7101 pub(crate) fn new(
7102 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
7103 ) -> Self {
7104 Self(RequestBuilder::new(stub))
7105 }
7106
7107 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7109 mut self,
7110 v: V,
7111 ) -> Self {
7112 self.0.request = v.into();
7113 self
7114 }
7115
7116 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7118 self.0.options = v.into();
7119 self
7120 }
7121
7122 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7124 (*self.0.stub)
7125 .get_operation(self.0.request, self.0.options)
7126 .await
7127 .map(crate::Response::into_body)
7128 }
7129
7130 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7132 self.0.request.name = v.into();
7133 self
7134 }
7135 }
7136
7137 #[doc(hidden)]
7138 impl crate::RequestBuilder for GetOperation {
7139 fn request_options(&mut self) -> &mut crate::RequestOptions {
7140 &mut self.0.options
7141 }
7142 }
7143
7144 #[derive(Clone, Debug)]
7161 pub struct DeleteOperation(
7162 RequestBuilder<google_cloud_longrunning::model::DeleteOperationRequest>,
7163 );
7164
7165 impl DeleteOperation {
7166 pub(crate) fn new(
7167 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
7168 ) -> Self {
7169 Self(RequestBuilder::new(stub))
7170 }
7171
7172 pub fn with_request<V: Into<google_cloud_longrunning::model::DeleteOperationRequest>>(
7174 mut self,
7175 v: V,
7176 ) -> Self {
7177 self.0.request = v.into();
7178 self
7179 }
7180
7181 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7183 self.0.options = v.into();
7184 self
7185 }
7186
7187 pub async fn send(self) -> Result<()> {
7189 (*self.0.stub)
7190 .delete_operation(self.0.request, self.0.options)
7191 .await
7192 .map(crate::Response::into_body)
7193 }
7194
7195 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7197 self.0.request.name = v.into();
7198 self
7199 }
7200 }
7201
7202 #[doc(hidden)]
7203 impl crate::RequestBuilder for DeleteOperation {
7204 fn request_options(&mut self) -> &mut crate::RequestOptions {
7205 &mut self.0.options
7206 }
7207 }
7208
7209 #[derive(Clone, Debug)]
7226 pub struct CancelOperation(
7227 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7228 );
7229
7230 impl CancelOperation {
7231 pub(crate) fn new(
7232 stub: std::sync::Arc<dyn super::super::stub::dynamic::WidgetService>,
7233 ) -> Self {
7234 Self(RequestBuilder::new(stub))
7235 }
7236
7237 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
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<()> {
7254 (*self.0.stub)
7255 .cancel_operation(self.0.request, self.0.options)
7256 .await
7257 .map(crate::Response::into_body)
7258 }
7259
7260 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7262 self.0.request.name = v.into();
7263 self
7264 }
7265 }
7266
7267 #[doc(hidden)]
7268 impl crate::RequestBuilder for CancelOperation {
7269 fn request_options(&mut self) -> &mut crate::RequestOptions {
7270 &mut self.0.options
7271 }
7272 }
7273}