1#[cfg(feature = "agents")]
19#[cfg_attr(docsrs, doc(cfg(feature = "agents")))]
20pub mod agents {
21 use crate::Result;
22
23 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
37
38 pub(crate) mod client {
39 use super::super::super::client::Agents;
40 pub struct Factory;
41 impl crate::ClientFactory for Factory {
42 type Client = Agents;
43 type Credentials = gaxi::options::Credentials;
44 async fn build(
45 self,
46 config: gaxi::options::ClientConfig,
47 ) -> crate::ClientBuilderResult<Self::Client> {
48 Self::Client::new(config).await
49 }
50 }
51 }
52
53 #[derive(Clone, Debug)]
55 pub(crate) struct RequestBuilder<R: std::default::Default> {
56 stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>,
57 request: R,
58 options: crate::RequestOptions,
59 }
60
61 impl<R> RequestBuilder<R>
62 where
63 R: std::default::Default,
64 {
65 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: crate::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
91 pub struct GetAgent(RequestBuilder<crate::model::GetAgentRequest>);
92
93 impl GetAgent {
94 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
95 Self(RequestBuilder::new(stub))
96 }
97
98 pub fn with_request<V: Into<crate::model::GetAgentRequest>>(mut self, v: V) -> Self {
100 self.0.request = v.into();
101 self
102 }
103
104 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
106 self.0.options = v.into();
107 self
108 }
109
110 pub async fn send(self) -> Result<crate::model::Agent> {
112 (*self.0.stub)
113 .get_agent(self.0.request, self.0.options)
114 .await
115 .map(crate::Response::into_body)
116 }
117
118 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
122 self.0.request.parent = v.into();
123 self
124 }
125 }
126
127 #[doc(hidden)]
128 impl crate::RequestBuilder for GetAgent {
129 fn request_options(&mut self) -> &mut crate::RequestOptions {
130 &mut self.0.options
131 }
132 }
133
134 #[derive(Clone, Debug)]
151 pub struct SetAgent(RequestBuilder<crate::model::SetAgentRequest>);
152
153 impl SetAgent {
154 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
155 Self(RequestBuilder::new(stub))
156 }
157
158 pub fn with_request<V: Into<crate::model::SetAgentRequest>>(mut self, v: V) -> Self {
160 self.0.request = v.into();
161 self
162 }
163
164 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
166 self.0.options = v.into();
167 self
168 }
169
170 pub async fn send(self) -> Result<crate::model::Agent> {
172 (*self.0.stub)
173 .set_agent(self.0.request, self.0.options)
174 .await
175 .map(crate::Response::into_body)
176 }
177
178 pub fn set_agent<T>(mut self, v: T) -> Self
182 where
183 T: std::convert::Into<crate::model::Agent>,
184 {
185 self.0.request.agent = std::option::Option::Some(v.into());
186 self
187 }
188
189 pub fn set_or_clear_agent<T>(mut self, v: std::option::Option<T>) -> Self
193 where
194 T: std::convert::Into<crate::model::Agent>,
195 {
196 self.0.request.agent = v.map(|x| x.into());
197 self
198 }
199
200 pub fn set_update_mask<T>(mut self, v: T) -> Self
202 where
203 T: std::convert::Into<wkt::FieldMask>,
204 {
205 self.0.request.update_mask = std::option::Option::Some(v.into());
206 self
207 }
208
209 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
211 where
212 T: std::convert::Into<wkt::FieldMask>,
213 {
214 self.0.request.update_mask = v.map(|x| x.into());
215 self
216 }
217 }
218
219 #[doc(hidden)]
220 impl crate::RequestBuilder for SetAgent {
221 fn request_options(&mut self) -> &mut crate::RequestOptions {
222 &mut self.0.options
223 }
224 }
225
226 #[derive(Clone, Debug)]
243 pub struct DeleteAgent(RequestBuilder<crate::model::DeleteAgentRequest>);
244
245 impl DeleteAgent {
246 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
247 Self(RequestBuilder::new(stub))
248 }
249
250 pub fn with_request<V: Into<crate::model::DeleteAgentRequest>>(mut self, v: V) -> Self {
252 self.0.request = v.into();
253 self
254 }
255
256 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
258 self.0.options = v.into();
259 self
260 }
261
262 pub async fn send(self) -> Result<()> {
264 (*self.0.stub)
265 .delete_agent(self.0.request, self.0.options)
266 .await
267 .map(crate::Response::into_body)
268 }
269
270 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
274 self.0.request.parent = v.into();
275 self
276 }
277 }
278
279 #[doc(hidden)]
280 impl crate::RequestBuilder for DeleteAgent {
281 fn request_options(&mut self) -> &mut crate::RequestOptions {
282 &mut self.0.options
283 }
284 }
285
286 #[derive(Clone, Debug)]
307 pub struct SearchAgents(RequestBuilder<crate::model::SearchAgentsRequest>);
308
309 impl SearchAgents {
310 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
311 Self(RequestBuilder::new(stub))
312 }
313
314 pub fn with_request<V: Into<crate::model::SearchAgentsRequest>>(mut self, v: V) -> Self {
316 self.0.request = v.into();
317 self
318 }
319
320 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
322 self.0.options = v.into();
323 self
324 }
325
326 pub async fn send(self) -> Result<crate::model::SearchAgentsResponse> {
328 (*self.0.stub)
329 .search_agents(self.0.request, self.0.options)
330 .await
331 .map(crate::Response::into_body)
332 }
333
334 pub fn by_page(
336 self,
337 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::SearchAgentsResponse, crate::Error>
338 {
339 use std::clone::Clone;
340 let token = self.0.request.page_token.clone();
341 let execute = move |token: String| {
342 let mut builder = self.clone();
343 builder.0.request = builder.0.request.set_page_token(token);
344 builder.send()
345 };
346 google_cloud_gax::paginator::internal::new_paginator(token, execute)
347 }
348
349 pub fn by_item(
351 self,
352 ) -> impl google_cloud_gax::paginator::ItemPaginator<
353 crate::model::SearchAgentsResponse,
354 crate::Error,
355 > {
356 use google_cloud_gax::paginator::Paginator;
357 self.by_page().items()
358 }
359
360 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
364 self.0.request.parent = v.into();
365 self
366 }
367
368 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
370 self.0.request.page_size = v.into();
371 self
372 }
373
374 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
376 self.0.request.page_token = v.into();
377 self
378 }
379 }
380
381 #[doc(hidden)]
382 impl crate::RequestBuilder for SearchAgents {
383 fn request_options(&mut self) -> &mut crate::RequestOptions {
384 &mut self.0.options
385 }
386 }
387
388 #[derive(Clone, Debug)]
406 pub struct TrainAgent(RequestBuilder<crate::model::TrainAgentRequest>);
407
408 impl TrainAgent {
409 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
410 Self(RequestBuilder::new(stub))
411 }
412
413 pub fn with_request<V: Into<crate::model::TrainAgentRequest>>(mut self, v: V) -> Self {
415 self.0.request = v.into();
416 self
417 }
418
419 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
421 self.0.options = v.into();
422 self
423 }
424
425 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
432 (*self.0.stub)
433 .train_agent(self.0.request, self.0.options)
434 .await
435 .map(crate::Response::into_body)
436 }
437
438 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
440 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
441 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
442 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
443 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
444 if let Some(ref mut details) = poller_options.tracing {
445 details.method_name =
446 "google_cloud_dialogflow_v2::client::Agents::train_agent::until_done";
447 }
448
449 let stub = self.0.stub.clone();
450 let mut options = self.0.options.clone();
451 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
452 let query = move |name| {
453 let stub = stub.clone();
454 let options = options.clone();
455 async {
456 let op = GetOperation::new(stub)
457 .set_name(name)
458 .with_options(options)
459 .send()
460 .await?;
461 Ok(Operation::new(op))
462 }
463 };
464
465 let start = move || async {
466 let op = self.send().await?;
467 Ok(Operation::new(op))
468 };
469
470 use google_cloud_lro::internal::PollerExt;
471 {
472 google_cloud_lro::internal::new_unit_response_poller(
473 polling_error_policy,
474 polling_backoff_policy,
475 start,
476 query,
477 )
478 }
479 .with_options(poller_options)
480 }
481
482 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
486 self.0.request.parent = v.into();
487 self
488 }
489 }
490
491 #[doc(hidden)]
492 impl crate::RequestBuilder for TrainAgent {
493 fn request_options(&mut self) -> &mut crate::RequestOptions {
494 &mut self.0.options
495 }
496 }
497
498 #[derive(Clone, Debug)]
516 pub struct ExportAgent(RequestBuilder<crate::model::ExportAgentRequest>);
517
518 impl ExportAgent {
519 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
520 Self(RequestBuilder::new(stub))
521 }
522
523 pub fn with_request<V: Into<crate::model::ExportAgentRequest>>(mut self, v: V) -> Self {
525 self.0.request = v.into();
526 self
527 }
528
529 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
531 self.0.options = v.into();
532 self
533 }
534
535 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
542 (*self.0.stub)
543 .export_agent(self.0.request, self.0.options)
544 .await
545 .map(crate::Response::into_body)
546 }
547
548 pub fn poller(
550 self,
551 ) -> impl google_cloud_lro::Poller<crate::model::ExportAgentResponse, wkt::Struct> {
552 type Operation = google_cloud_lro::internal::Operation<
553 crate::model::ExportAgentResponse,
554 wkt::Struct,
555 >;
556 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
557 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
558 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
559 if let Some(ref mut details) = poller_options.tracing {
560 details.method_name =
561 "google_cloud_dialogflow_v2::client::Agents::export_agent::until_done";
562 }
563
564 let stub = self.0.stub.clone();
565 let mut options = self.0.options.clone();
566 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
567 let query = move |name| {
568 let stub = stub.clone();
569 let options = options.clone();
570 async {
571 let op = GetOperation::new(stub)
572 .set_name(name)
573 .with_options(options)
574 .send()
575 .await?;
576 Ok(Operation::new(op))
577 }
578 };
579
580 let start = move || async {
581 let op = self.send().await?;
582 Ok(Operation::new(op))
583 };
584
585 use google_cloud_lro::internal::PollerExt;
586 {
587 google_cloud_lro::internal::new_poller(
588 polling_error_policy,
589 polling_backoff_policy,
590 start,
591 query,
592 )
593 }
594 .with_options(poller_options)
595 }
596
597 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
601 self.0.request.parent = v.into();
602 self
603 }
604
605 pub fn set_agent_uri<T: Into<std::string::String>>(mut self, v: T) -> Self {
609 self.0.request.agent_uri = v.into();
610 self
611 }
612 }
613
614 #[doc(hidden)]
615 impl crate::RequestBuilder for ExportAgent {
616 fn request_options(&mut self) -> &mut crate::RequestOptions {
617 &mut self.0.options
618 }
619 }
620
621 #[derive(Clone, Debug)]
639 pub struct ImportAgent(RequestBuilder<crate::model::ImportAgentRequest>);
640
641 impl ImportAgent {
642 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
643 Self(RequestBuilder::new(stub))
644 }
645
646 pub fn with_request<V: Into<crate::model::ImportAgentRequest>>(mut self, v: V) -> Self {
648 self.0.request = v.into();
649 self
650 }
651
652 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
654 self.0.options = v.into();
655 self
656 }
657
658 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
665 (*self.0.stub)
666 .import_agent(self.0.request, self.0.options)
667 .await
668 .map(crate::Response::into_body)
669 }
670
671 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
673 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
674 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
675 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
676 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
677 if let Some(ref mut details) = poller_options.tracing {
678 details.method_name =
679 "google_cloud_dialogflow_v2::client::Agents::import_agent::until_done";
680 }
681
682 let stub = self.0.stub.clone();
683 let mut options = self.0.options.clone();
684 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
685 let query = move |name| {
686 let stub = stub.clone();
687 let options = options.clone();
688 async {
689 let op = GetOperation::new(stub)
690 .set_name(name)
691 .with_options(options)
692 .send()
693 .await?;
694 Ok(Operation::new(op))
695 }
696 };
697
698 let start = move || async {
699 let op = self.send().await?;
700 Ok(Operation::new(op))
701 };
702
703 use google_cloud_lro::internal::PollerExt;
704 {
705 google_cloud_lro::internal::new_unit_response_poller(
706 polling_error_policy,
707 polling_backoff_policy,
708 start,
709 query,
710 )
711 }
712 .with_options(poller_options)
713 }
714
715 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
719 self.0.request.parent = v.into();
720 self
721 }
722
723 pub fn set_agent<T: Into<Option<crate::model::import_agent_request::Agent>>>(
728 mut self,
729 v: T,
730 ) -> Self {
731 self.0.request.agent = v.into();
732 self
733 }
734
735 pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
741 self.0.request = self.0.request.set_agent_uri(v);
742 self
743 }
744
745 pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
751 self.0.request = self.0.request.set_agent_content(v);
752 self
753 }
754 }
755
756 #[doc(hidden)]
757 impl crate::RequestBuilder for ImportAgent {
758 fn request_options(&mut self) -> &mut crate::RequestOptions {
759 &mut self.0.options
760 }
761 }
762
763 #[derive(Clone, Debug)]
781 pub struct RestoreAgent(RequestBuilder<crate::model::RestoreAgentRequest>);
782
783 impl RestoreAgent {
784 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
785 Self(RequestBuilder::new(stub))
786 }
787
788 pub fn with_request<V: Into<crate::model::RestoreAgentRequest>>(mut self, v: V) -> Self {
790 self.0.request = v.into();
791 self
792 }
793
794 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
796 self.0.options = v.into();
797 self
798 }
799
800 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
807 (*self.0.stub)
808 .restore_agent(self.0.request, self.0.options)
809 .await
810 .map(crate::Response::into_body)
811 }
812
813 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
815 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
816 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
817 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
818 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
819 if let Some(ref mut details) = poller_options.tracing {
820 details.method_name =
821 "google_cloud_dialogflow_v2::client::Agents::restore_agent::until_done";
822 }
823
824 let stub = self.0.stub.clone();
825 let mut options = self.0.options.clone();
826 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
827 let query = move |name| {
828 let stub = stub.clone();
829 let options = options.clone();
830 async {
831 let op = GetOperation::new(stub)
832 .set_name(name)
833 .with_options(options)
834 .send()
835 .await?;
836 Ok(Operation::new(op))
837 }
838 };
839
840 let start = move || async {
841 let op = self.send().await?;
842 Ok(Operation::new(op))
843 };
844
845 use google_cloud_lro::internal::PollerExt;
846 {
847 google_cloud_lro::internal::new_unit_response_poller(
848 polling_error_policy,
849 polling_backoff_policy,
850 start,
851 query,
852 )
853 }
854 .with_options(poller_options)
855 }
856
857 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
861 self.0.request.parent = v.into();
862 self
863 }
864
865 pub fn set_agent<T: Into<Option<crate::model::restore_agent_request::Agent>>>(
870 mut self,
871 v: T,
872 ) -> Self {
873 self.0.request.agent = v.into();
874 self
875 }
876
877 pub fn set_agent_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
883 self.0.request = self.0.request.set_agent_uri(v);
884 self
885 }
886
887 pub fn set_agent_content<T: std::convert::Into<::bytes::Bytes>>(mut self, v: T) -> Self {
893 self.0.request = self.0.request.set_agent_content(v);
894 self
895 }
896 }
897
898 #[doc(hidden)]
899 impl crate::RequestBuilder for RestoreAgent {
900 fn request_options(&mut self) -> &mut crate::RequestOptions {
901 &mut self.0.options
902 }
903 }
904
905 #[derive(Clone, Debug)]
922 pub struct GetValidationResult(RequestBuilder<crate::model::GetValidationResultRequest>);
923
924 impl GetValidationResult {
925 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
926 Self(RequestBuilder::new(stub))
927 }
928
929 pub fn with_request<V: Into<crate::model::GetValidationResultRequest>>(
931 mut self,
932 v: V,
933 ) -> Self {
934 self.0.request = v.into();
935 self
936 }
937
938 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
940 self.0.options = v.into();
941 self
942 }
943
944 pub async fn send(self) -> Result<crate::model::ValidationResult> {
946 (*self.0.stub)
947 .get_validation_result(self.0.request, self.0.options)
948 .await
949 .map(crate::Response::into_body)
950 }
951
952 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
956 self.0.request.parent = v.into();
957 self
958 }
959
960 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
962 self.0.request.language_code = v.into();
963 self
964 }
965 }
966
967 #[doc(hidden)]
968 impl crate::RequestBuilder for GetValidationResult {
969 fn request_options(&mut self) -> &mut crate::RequestOptions {
970 &mut self.0.options
971 }
972 }
973
974 #[derive(Clone, Debug)]
995 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
996
997 impl ListLocations {
998 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
999 Self(RequestBuilder::new(stub))
1000 }
1001
1002 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1004 mut self,
1005 v: V,
1006 ) -> Self {
1007 self.0.request = v.into();
1008 self
1009 }
1010
1011 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1013 self.0.options = v.into();
1014 self
1015 }
1016
1017 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1019 (*self.0.stub)
1020 .list_locations(self.0.request, self.0.options)
1021 .await
1022 .map(crate::Response::into_body)
1023 }
1024
1025 pub fn by_page(
1027 self,
1028 ) -> impl google_cloud_gax::paginator::Paginator<
1029 google_cloud_location::model::ListLocationsResponse,
1030 crate::Error,
1031 > {
1032 use std::clone::Clone;
1033 let token = self.0.request.page_token.clone();
1034 let execute = move |token: String| {
1035 let mut builder = self.clone();
1036 builder.0.request = builder.0.request.set_page_token(token);
1037 builder.send()
1038 };
1039 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1040 }
1041
1042 pub fn by_item(
1044 self,
1045 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1046 google_cloud_location::model::ListLocationsResponse,
1047 crate::Error,
1048 > {
1049 use google_cloud_gax::paginator::Paginator;
1050 self.by_page().items()
1051 }
1052
1053 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1055 self.0.request.name = v.into();
1056 self
1057 }
1058
1059 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1061 self.0.request.filter = v.into();
1062 self
1063 }
1064
1065 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1067 self.0.request.page_size = v.into();
1068 self
1069 }
1070
1071 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1073 self.0.request.page_token = v.into();
1074 self
1075 }
1076 }
1077
1078 #[doc(hidden)]
1079 impl crate::RequestBuilder for ListLocations {
1080 fn request_options(&mut self) -> &mut crate::RequestOptions {
1081 &mut self.0.options
1082 }
1083 }
1084
1085 #[derive(Clone, Debug)]
1102 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1103
1104 impl GetLocation {
1105 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1106 Self(RequestBuilder::new(stub))
1107 }
1108
1109 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1111 mut self,
1112 v: V,
1113 ) -> Self {
1114 self.0.request = v.into();
1115 self
1116 }
1117
1118 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1120 self.0.options = v.into();
1121 self
1122 }
1123
1124 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1126 (*self.0.stub)
1127 .get_location(self.0.request, self.0.options)
1128 .await
1129 .map(crate::Response::into_body)
1130 }
1131
1132 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1134 self.0.request.name = v.into();
1135 self
1136 }
1137 }
1138
1139 #[doc(hidden)]
1140 impl crate::RequestBuilder for GetLocation {
1141 fn request_options(&mut self) -> &mut crate::RequestOptions {
1142 &mut self.0.options
1143 }
1144 }
1145
1146 #[derive(Clone, Debug)]
1167 pub struct ListOperations(
1168 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1169 );
1170
1171 impl ListOperations {
1172 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1173 Self(RequestBuilder::new(stub))
1174 }
1175
1176 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1178 mut self,
1179 v: V,
1180 ) -> Self {
1181 self.0.request = v.into();
1182 self
1183 }
1184
1185 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1187 self.0.options = v.into();
1188 self
1189 }
1190
1191 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1193 (*self.0.stub)
1194 .list_operations(self.0.request, self.0.options)
1195 .await
1196 .map(crate::Response::into_body)
1197 }
1198
1199 pub fn by_page(
1201 self,
1202 ) -> impl google_cloud_gax::paginator::Paginator<
1203 google_cloud_longrunning::model::ListOperationsResponse,
1204 crate::Error,
1205 > {
1206 use std::clone::Clone;
1207 let token = self.0.request.page_token.clone();
1208 let execute = move |token: String| {
1209 let mut builder = self.clone();
1210 builder.0.request = builder.0.request.set_page_token(token);
1211 builder.send()
1212 };
1213 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1214 }
1215
1216 pub fn by_item(
1218 self,
1219 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1220 google_cloud_longrunning::model::ListOperationsResponse,
1221 crate::Error,
1222 > {
1223 use google_cloud_gax::paginator::Paginator;
1224 self.by_page().items()
1225 }
1226
1227 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1229 self.0.request.name = v.into();
1230 self
1231 }
1232
1233 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1235 self.0.request.filter = v.into();
1236 self
1237 }
1238
1239 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1241 self.0.request.page_size = v.into();
1242 self
1243 }
1244
1245 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1247 self.0.request.page_token = v.into();
1248 self
1249 }
1250
1251 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1253 self.0.request.return_partial_success = v.into();
1254 self
1255 }
1256 }
1257
1258 #[doc(hidden)]
1259 impl crate::RequestBuilder for ListOperations {
1260 fn request_options(&mut self) -> &mut crate::RequestOptions {
1261 &mut self.0.options
1262 }
1263 }
1264
1265 #[derive(Clone, Debug)]
1282 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1283
1284 impl GetOperation {
1285 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1286 Self(RequestBuilder::new(stub))
1287 }
1288
1289 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1291 mut self,
1292 v: V,
1293 ) -> Self {
1294 self.0.request = v.into();
1295 self
1296 }
1297
1298 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1300 self.0.options = v.into();
1301 self
1302 }
1303
1304 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
1306 (*self.0.stub)
1307 .get_operation(self.0.request, self.0.options)
1308 .await
1309 .map(crate::Response::into_body)
1310 }
1311
1312 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1314 self.0.request.name = v.into();
1315 self
1316 }
1317 }
1318
1319 #[doc(hidden)]
1320 impl crate::RequestBuilder for GetOperation {
1321 fn request_options(&mut self) -> &mut crate::RequestOptions {
1322 &mut self.0.options
1323 }
1324 }
1325
1326 #[derive(Clone, Debug)]
1343 pub struct CancelOperation(
1344 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
1345 );
1346
1347 impl CancelOperation {
1348 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Agents>) -> Self {
1349 Self(RequestBuilder::new(stub))
1350 }
1351
1352 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
1354 mut self,
1355 v: V,
1356 ) -> Self {
1357 self.0.request = v.into();
1358 self
1359 }
1360
1361 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1363 self.0.options = v.into();
1364 self
1365 }
1366
1367 pub async fn send(self) -> Result<()> {
1369 (*self.0.stub)
1370 .cancel_operation(self.0.request, self.0.options)
1371 .await
1372 .map(crate::Response::into_body)
1373 }
1374
1375 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1377 self.0.request.name = v.into();
1378 self
1379 }
1380 }
1381
1382 #[doc(hidden)]
1383 impl crate::RequestBuilder for CancelOperation {
1384 fn request_options(&mut self) -> &mut crate::RequestOptions {
1385 &mut self.0.options
1386 }
1387 }
1388}
1389
1390#[cfg(feature = "answer-records")]
1392#[cfg_attr(docsrs, doc(cfg(feature = "answer-records")))]
1393pub mod answer_records {
1394 use crate::Result;
1395
1396 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
1410
1411 pub(crate) mod client {
1412 use super::super::super::client::AnswerRecords;
1413 pub struct Factory;
1414 impl crate::ClientFactory for Factory {
1415 type Client = AnswerRecords;
1416 type Credentials = gaxi::options::Credentials;
1417 async fn build(
1418 self,
1419 config: gaxi::options::ClientConfig,
1420 ) -> crate::ClientBuilderResult<Self::Client> {
1421 Self::Client::new(config).await
1422 }
1423 }
1424 }
1425
1426 #[derive(Clone, Debug)]
1428 pub(crate) struct RequestBuilder<R: std::default::Default> {
1429 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1430 request: R,
1431 options: crate::RequestOptions,
1432 }
1433
1434 impl<R> RequestBuilder<R>
1435 where
1436 R: std::default::Default,
1437 {
1438 pub(crate) fn new(
1439 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1440 ) -> Self {
1441 Self {
1442 stub,
1443 request: R::default(),
1444 options: crate::RequestOptions::default(),
1445 }
1446 }
1447 }
1448
1449 #[derive(Clone, Debug)]
1470 pub struct ListAnswerRecords(RequestBuilder<crate::model::ListAnswerRecordsRequest>);
1471
1472 impl ListAnswerRecords {
1473 pub(crate) fn new(
1474 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1475 ) -> Self {
1476 Self(RequestBuilder::new(stub))
1477 }
1478
1479 pub fn with_request<V: Into<crate::model::ListAnswerRecordsRequest>>(
1481 mut self,
1482 v: V,
1483 ) -> Self {
1484 self.0.request = v.into();
1485 self
1486 }
1487
1488 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1490 self.0.options = v.into();
1491 self
1492 }
1493
1494 pub async fn send(self) -> Result<crate::model::ListAnswerRecordsResponse> {
1496 (*self.0.stub)
1497 .list_answer_records(self.0.request, self.0.options)
1498 .await
1499 .map(crate::Response::into_body)
1500 }
1501
1502 pub fn by_page(
1504 self,
1505 ) -> impl google_cloud_gax::paginator::Paginator<
1506 crate::model::ListAnswerRecordsResponse,
1507 crate::Error,
1508 > {
1509 use std::clone::Clone;
1510 let token = self.0.request.page_token.clone();
1511 let execute = move |token: String| {
1512 let mut builder = self.clone();
1513 builder.0.request = builder.0.request.set_page_token(token);
1514 builder.send()
1515 };
1516 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1517 }
1518
1519 pub fn by_item(
1521 self,
1522 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1523 crate::model::ListAnswerRecordsResponse,
1524 crate::Error,
1525 > {
1526 use google_cloud_gax::paginator::Paginator;
1527 self.by_page().items()
1528 }
1529
1530 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1534 self.0.request.parent = v.into();
1535 self
1536 }
1537
1538 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1540 self.0.request.filter = v.into();
1541 self
1542 }
1543
1544 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1546 self.0.request.page_size = v.into();
1547 self
1548 }
1549
1550 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1552 self.0.request.page_token = v.into();
1553 self
1554 }
1555 }
1556
1557 #[doc(hidden)]
1558 impl crate::RequestBuilder for ListAnswerRecords {
1559 fn request_options(&mut self) -> &mut crate::RequestOptions {
1560 &mut self.0.options
1561 }
1562 }
1563
1564 #[derive(Clone, Debug)]
1581 pub struct UpdateAnswerRecord(RequestBuilder<crate::model::UpdateAnswerRecordRequest>);
1582
1583 impl UpdateAnswerRecord {
1584 pub(crate) fn new(
1585 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1586 ) -> Self {
1587 Self(RequestBuilder::new(stub))
1588 }
1589
1590 pub fn with_request<V: Into<crate::model::UpdateAnswerRecordRequest>>(
1592 mut self,
1593 v: V,
1594 ) -> Self {
1595 self.0.request = v.into();
1596 self
1597 }
1598
1599 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1601 self.0.options = v.into();
1602 self
1603 }
1604
1605 pub async fn send(self) -> Result<crate::model::AnswerRecord> {
1607 (*self.0.stub)
1608 .update_answer_record(self.0.request, self.0.options)
1609 .await
1610 .map(crate::Response::into_body)
1611 }
1612
1613 pub fn set_answer_record<T>(mut self, v: T) -> Self
1617 where
1618 T: std::convert::Into<crate::model::AnswerRecord>,
1619 {
1620 self.0.request.answer_record = std::option::Option::Some(v.into());
1621 self
1622 }
1623
1624 pub fn set_or_clear_answer_record<T>(mut self, v: std::option::Option<T>) -> Self
1628 where
1629 T: std::convert::Into<crate::model::AnswerRecord>,
1630 {
1631 self.0.request.answer_record = v.map(|x| x.into());
1632 self
1633 }
1634
1635 pub fn set_update_mask<T>(mut self, v: T) -> Self
1639 where
1640 T: std::convert::Into<wkt::FieldMask>,
1641 {
1642 self.0.request.update_mask = std::option::Option::Some(v.into());
1643 self
1644 }
1645
1646 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
1650 where
1651 T: std::convert::Into<wkt::FieldMask>,
1652 {
1653 self.0.request.update_mask = v.map(|x| x.into());
1654 self
1655 }
1656 }
1657
1658 #[doc(hidden)]
1659 impl crate::RequestBuilder for UpdateAnswerRecord {
1660 fn request_options(&mut self) -> &mut crate::RequestOptions {
1661 &mut self.0.options
1662 }
1663 }
1664
1665 #[derive(Clone, Debug)]
1686 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
1687
1688 impl ListLocations {
1689 pub(crate) fn new(
1690 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1691 ) -> Self {
1692 Self(RequestBuilder::new(stub))
1693 }
1694
1695 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
1697 mut self,
1698 v: V,
1699 ) -> Self {
1700 self.0.request = v.into();
1701 self
1702 }
1703
1704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1706 self.0.options = v.into();
1707 self
1708 }
1709
1710 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
1712 (*self.0.stub)
1713 .list_locations(self.0.request, self.0.options)
1714 .await
1715 .map(crate::Response::into_body)
1716 }
1717
1718 pub fn by_page(
1720 self,
1721 ) -> impl google_cloud_gax::paginator::Paginator<
1722 google_cloud_location::model::ListLocationsResponse,
1723 crate::Error,
1724 > {
1725 use std::clone::Clone;
1726 let token = self.0.request.page_token.clone();
1727 let execute = move |token: String| {
1728 let mut builder = self.clone();
1729 builder.0.request = builder.0.request.set_page_token(token);
1730 builder.send()
1731 };
1732 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1733 }
1734
1735 pub fn by_item(
1737 self,
1738 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1739 google_cloud_location::model::ListLocationsResponse,
1740 crate::Error,
1741 > {
1742 use google_cloud_gax::paginator::Paginator;
1743 self.by_page().items()
1744 }
1745
1746 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1748 self.0.request.name = v.into();
1749 self
1750 }
1751
1752 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1754 self.0.request.filter = v.into();
1755 self
1756 }
1757
1758 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1760 self.0.request.page_size = v.into();
1761 self
1762 }
1763
1764 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1766 self.0.request.page_token = v.into();
1767 self
1768 }
1769 }
1770
1771 #[doc(hidden)]
1772 impl crate::RequestBuilder for ListLocations {
1773 fn request_options(&mut self) -> &mut crate::RequestOptions {
1774 &mut self.0.options
1775 }
1776 }
1777
1778 #[derive(Clone, Debug)]
1795 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
1796
1797 impl GetLocation {
1798 pub(crate) fn new(
1799 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1800 ) -> Self {
1801 Self(RequestBuilder::new(stub))
1802 }
1803
1804 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
1806 mut self,
1807 v: V,
1808 ) -> Self {
1809 self.0.request = v.into();
1810 self
1811 }
1812
1813 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1815 self.0.options = v.into();
1816 self
1817 }
1818
1819 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
1821 (*self.0.stub)
1822 .get_location(self.0.request, self.0.options)
1823 .await
1824 .map(crate::Response::into_body)
1825 }
1826
1827 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1829 self.0.request.name = v.into();
1830 self
1831 }
1832 }
1833
1834 #[doc(hidden)]
1835 impl crate::RequestBuilder for GetLocation {
1836 fn request_options(&mut self) -> &mut crate::RequestOptions {
1837 &mut self.0.options
1838 }
1839 }
1840
1841 #[derive(Clone, Debug)]
1862 pub struct ListOperations(
1863 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
1864 );
1865
1866 impl ListOperations {
1867 pub(crate) fn new(
1868 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1869 ) -> Self {
1870 Self(RequestBuilder::new(stub))
1871 }
1872
1873 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
1875 mut self,
1876 v: V,
1877 ) -> Self {
1878 self.0.request = v.into();
1879 self
1880 }
1881
1882 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1884 self.0.options = v.into();
1885 self
1886 }
1887
1888 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
1890 (*self.0.stub)
1891 .list_operations(self.0.request, self.0.options)
1892 .await
1893 .map(crate::Response::into_body)
1894 }
1895
1896 pub fn by_page(
1898 self,
1899 ) -> impl google_cloud_gax::paginator::Paginator<
1900 google_cloud_longrunning::model::ListOperationsResponse,
1901 crate::Error,
1902 > {
1903 use std::clone::Clone;
1904 let token = self.0.request.page_token.clone();
1905 let execute = move |token: String| {
1906 let mut builder = self.clone();
1907 builder.0.request = builder.0.request.set_page_token(token);
1908 builder.send()
1909 };
1910 google_cloud_gax::paginator::internal::new_paginator(token, execute)
1911 }
1912
1913 pub fn by_item(
1915 self,
1916 ) -> impl google_cloud_gax::paginator::ItemPaginator<
1917 google_cloud_longrunning::model::ListOperationsResponse,
1918 crate::Error,
1919 > {
1920 use google_cloud_gax::paginator::Paginator;
1921 self.by_page().items()
1922 }
1923
1924 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
1926 self.0.request.name = v.into();
1927 self
1928 }
1929
1930 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
1932 self.0.request.filter = v.into();
1933 self
1934 }
1935
1936 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1938 self.0.request.page_size = v.into();
1939 self
1940 }
1941
1942 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1944 self.0.request.page_token = v.into();
1945 self
1946 }
1947
1948 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
1950 self.0.request.return_partial_success = v.into();
1951 self
1952 }
1953 }
1954
1955 #[doc(hidden)]
1956 impl crate::RequestBuilder for ListOperations {
1957 fn request_options(&mut self) -> &mut crate::RequestOptions {
1958 &mut self.0.options
1959 }
1960 }
1961
1962 #[derive(Clone, Debug)]
1979 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
1980
1981 impl GetOperation {
1982 pub(crate) fn new(
1983 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
1984 ) -> Self {
1985 Self(RequestBuilder::new(stub))
1986 }
1987
1988 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
1990 mut self,
1991 v: V,
1992 ) -> Self {
1993 self.0.request = v.into();
1994 self
1995 }
1996
1997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
1999 self.0.options = v.into();
2000 self
2001 }
2002
2003 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2005 (*self.0.stub)
2006 .get_operation(self.0.request, self.0.options)
2007 .await
2008 .map(crate::Response::into_body)
2009 }
2010
2011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2013 self.0.request.name = v.into();
2014 self
2015 }
2016 }
2017
2018 #[doc(hidden)]
2019 impl crate::RequestBuilder for GetOperation {
2020 fn request_options(&mut self) -> &mut crate::RequestOptions {
2021 &mut self.0.options
2022 }
2023 }
2024
2025 #[derive(Clone, Debug)]
2042 pub struct CancelOperation(
2043 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2044 );
2045
2046 impl CancelOperation {
2047 pub(crate) fn new(
2048 stub: std::sync::Arc<dyn super::super::stub::dynamic::AnswerRecords>,
2049 ) -> Self {
2050 Self(RequestBuilder::new(stub))
2051 }
2052
2053 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2055 mut self,
2056 v: V,
2057 ) -> Self {
2058 self.0.request = v.into();
2059 self
2060 }
2061
2062 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2064 self.0.options = v.into();
2065 self
2066 }
2067
2068 pub async fn send(self) -> Result<()> {
2070 (*self.0.stub)
2071 .cancel_operation(self.0.request, self.0.options)
2072 .await
2073 .map(crate::Response::into_body)
2074 }
2075
2076 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2078 self.0.request.name = v.into();
2079 self
2080 }
2081 }
2082
2083 #[doc(hidden)]
2084 impl crate::RequestBuilder for CancelOperation {
2085 fn request_options(&mut self) -> &mut crate::RequestOptions {
2086 &mut self.0.options
2087 }
2088 }
2089}
2090
2091#[cfg(feature = "contexts")]
2093#[cfg_attr(docsrs, doc(cfg(feature = "contexts")))]
2094pub mod contexts {
2095 use crate::Result;
2096
2097 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
2111
2112 pub(crate) mod client {
2113 use super::super::super::client::Contexts;
2114 pub struct Factory;
2115 impl crate::ClientFactory for Factory {
2116 type Client = Contexts;
2117 type Credentials = gaxi::options::Credentials;
2118 async fn build(
2119 self,
2120 config: gaxi::options::ClientConfig,
2121 ) -> crate::ClientBuilderResult<Self::Client> {
2122 Self::Client::new(config).await
2123 }
2124 }
2125 }
2126
2127 #[derive(Clone, Debug)]
2129 pub(crate) struct RequestBuilder<R: std::default::Default> {
2130 stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>,
2131 request: R,
2132 options: crate::RequestOptions,
2133 }
2134
2135 impl<R> RequestBuilder<R>
2136 where
2137 R: std::default::Default,
2138 {
2139 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2140 Self {
2141 stub,
2142 request: R::default(),
2143 options: crate::RequestOptions::default(),
2144 }
2145 }
2146 }
2147
2148 #[derive(Clone, Debug)]
2169 pub struct ListContexts(RequestBuilder<crate::model::ListContextsRequest>);
2170
2171 impl ListContexts {
2172 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2173 Self(RequestBuilder::new(stub))
2174 }
2175
2176 pub fn with_request<V: Into<crate::model::ListContextsRequest>>(mut self, v: V) -> Self {
2178 self.0.request = v.into();
2179 self
2180 }
2181
2182 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2184 self.0.options = v.into();
2185 self
2186 }
2187
2188 pub async fn send(self) -> Result<crate::model::ListContextsResponse> {
2190 (*self.0.stub)
2191 .list_contexts(self.0.request, self.0.options)
2192 .await
2193 .map(crate::Response::into_body)
2194 }
2195
2196 pub fn by_page(
2198 self,
2199 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListContextsResponse, crate::Error>
2200 {
2201 use std::clone::Clone;
2202 let token = self.0.request.page_token.clone();
2203 let execute = move |token: String| {
2204 let mut builder = self.clone();
2205 builder.0.request = builder.0.request.set_page_token(token);
2206 builder.send()
2207 };
2208 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2209 }
2210
2211 pub fn by_item(
2213 self,
2214 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2215 crate::model::ListContextsResponse,
2216 crate::Error,
2217 > {
2218 use google_cloud_gax::paginator::Paginator;
2219 self.by_page().items()
2220 }
2221
2222 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2226 self.0.request.parent = v.into();
2227 self
2228 }
2229
2230 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2232 self.0.request.page_size = v.into();
2233 self
2234 }
2235
2236 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2238 self.0.request.page_token = v.into();
2239 self
2240 }
2241 }
2242
2243 #[doc(hidden)]
2244 impl crate::RequestBuilder for ListContexts {
2245 fn request_options(&mut self) -> &mut crate::RequestOptions {
2246 &mut self.0.options
2247 }
2248 }
2249
2250 #[derive(Clone, Debug)]
2267 pub struct GetContext(RequestBuilder<crate::model::GetContextRequest>);
2268
2269 impl GetContext {
2270 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2271 Self(RequestBuilder::new(stub))
2272 }
2273
2274 pub fn with_request<V: Into<crate::model::GetContextRequest>>(mut self, v: V) -> Self {
2276 self.0.request = v.into();
2277 self
2278 }
2279
2280 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2282 self.0.options = v.into();
2283 self
2284 }
2285
2286 pub async fn send(self) -> Result<crate::model::Context> {
2288 (*self.0.stub)
2289 .get_context(self.0.request, self.0.options)
2290 .await
2291 .map(crate::Response::into_body)
2292 }
2293
2294 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2298 self.0.request.name = v.into();
2299 self
2300 }
2301 }
2302
2303 #[doc(hidden)]
2304 impl crate::RequestBuilder for GetContext {
2305 fn request_options(&mut self) -> &mut crate::RequestOptions {
2306 &mut self.0.options
2307 }
2308 }
2309
2310 #[derive(Clone, Debug)]
2327 pub struct CreateContext(RequestBuilder<crate::model::CreateContextRequest>);
2328
2329 impl CreateContext {
2330 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2331 Self(RequestBuilder::new(stub))
2332 }
2333
2334 pub fn with_request<V: Into<crate::model::CreateContextRequest>>(mut self, v: V) -> Self {
2336 self.0.request = v.into();
2337 self
2338 }
2339
2340 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2342 self.0.options = v.into();
2343 self
2344 }
2345
2346 pub async fn send(self) -> Result<crate::model::Context> {
2348 (*self.0.stub)
2349 .create_context(self.0.request, self.0.options)
2350 .await
2351 .map(crate::Response::into_body)
2352 }
2353
2354 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2358 self.0.request.parent = v.into();
2359 self
2360 }
2361
2362 pub fn set_context<T>(mut self, v: T) -> Self
2366 where
2367 T: std::convert::Into<crate::model::Context>,
2368 {
2369 self.0.request.context = std::option::Option::Some(v.into());
2370 self
2371 }
2372
2373 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2377 where
2378 T: std::convert::Into<crate::model::Context>,
2379 {
2380 self.0.request.context = v.map(|x| x.into());
2381 self
2382 }
2383 }
2384
2385 #[doc(hidden)]
2386 impl crate::RequestBuilder for CreateContext {
2387 fn request_options(&mut self) -> &mut crate::RequestOptions {
2388 &mut self.0.options
2389 }
2390 }
2391
2392 #[derive(Clone, Debug)]
2409 pub struct UpdateContext(RequestBuilder<crate::model::UpdateContextRequest>);
2410
2411 impl UpdateContext {
2412 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2413 Self(RequestBuilder::new(stub))
2414 }
2415
2416 pub fn with_request<V: Into<crate::model::UpdateContextRequest>>(mut self, v: V) -> Self {
2418 self.0.request = v.into();
2419 self
2420 }
2421
2422 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2424 self.0.options = v.into();
2425 self
2426 }
2427
2428 pub async fn send(self) -> Result<crate::model::Context> {
2430 (*self.0.stub)
2431 .update_context(self.0.request, self.0.options)
2432 .await
2433 .map(crate::Response::into_body)
2434 }
2435
2436 pub fn set_context<T>(mut self, v: T) -> Self
2440 where
2441 T: std::convert::Into<crate::model::Context>,
2442 {
2443 self.0.request.context = std::option::Option::Some(v.into());
2444 self
2445 }
2446
2447 pub fn set_or_clear_context<T>(mut self, v: std::option::Option<T>) -> Self
2451 where
2452 T: std::convert::Into<crate::model::Context>,
2453 {
2454 self.0.request.context = v.map(|x| x.into());
2455 self
2456 }
2457
2458 pub fn set_update_mask<T>(mut self, v: T) -> Self
2460 where
2461 T: std::convert::Into<wkt::FieldMask>,
2462 {
2463 self.0.request.update_mask = std::option::Option::Some(v.into());
2464 self
2465 }
2466
2467 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
2469 where
2470 T: std::convert::Into<wkt::FieldMask>,
2471 {
2472 self.0.request.update_mask = v.map(|x| x.into());
2473 self
2474 }
2475 }
2476
2477 #[doc(hidden)]
2478 impl crate::RequestBuilder for UpdateContext {
2479 fn request_options(&mut self) -> &mut crate::RequestOptions {
2480 &mut self.0.options
2481 }
2482 }
2483
2484 #[derive(Clone, Debug)]
2501 pub struct DeleteContext(RequestBuilder<crate::model::DeleteContextRequest>);
2502
2503 impl DeleteContext {
2504 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2505 Self(RequestBuilder::new(stub))
2506 }
2507
2508 pub fn with_request<V: Into<crate::model::DeleteContextRequest>>(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<()> {
2522 (*self.0.stub)
2523 .delete_context(self.0.request, self.0.options)
2524 .await
2525 .map(crate::Response::into_body)
2526 }
2527
2528 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2532 self.0.request.name = v.into();
2533 self
2534 }
2535 }
2536
2537 #[doc(hidden)]
2538 impl crate::RequestBuilder for DeleteContext {
2539 fn request_options(&mut self) -> &mut crate::RequestOptions {
2540 &mut self.0.options
2541 }
2542 }
2543
2544 #[derive(Clone, Debug)]
2561 pub struct DeleteAllContexts(RequestBuilder<crate::model::DeleteAllContextsRequest>);
2562
2563 impl DeleteAllContexts {
2564 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2565 Self(RequestBuilder::new(stub))
2566 }
2567
2568 pub fn with_request<V: Into<crate::model::DeleteAllContextsRequest>>(
2570 mut self,
2571 v: V,
2572 ) -> Self {
2573 self.0.request = v.into();
2574 self
2575 }
2576
2577 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2579 self.0.options = v.into();
2580 self
2581 }
2582
2583 pub async fn send(self) -> Result<()> {
2585 (*self.0.stub)
2586 .delete_all_contexts(self.0.request, self.0.options)
2587 .await
2588 .map(crate::Response::into_body)
2589 }
2590
2591 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
2595 self.0.request.parent = v.into();
2596 self
2597 }
2598 }
2599
2600 #[doc(hidden)]
2601 impl crate::RequestBuilder for DeleteAllContexts {
2602 fn request_options(&mut self) -> &mut crate::RequestOptions {
2603 &mut self.0.options
2604 }
2605 }
2606
2607 #[derive(Clone, Debug)]
2628 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
2629
2630 impl ListLocations {
2631 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2632 Self(RequestBuilder::new(stub))
2633 }
2634
2635 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
2637 mut self,
2638 v: V,
2639 ) -> Self {
2640 self.0.request = v.into();
2641 self
2642 }
2643
2644 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2646 self.0.options = v.into();
2647 self
2648 }
2649
2650 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
2652 (*self.0.stub)
2653 .list_locations(self.0.request, self.0.options)
2654 .await
2655 .map(crate::Response::into_body)
2656 }
2657
2658 pub fn by_page(
2660 self,
2661 ) -> impl google_cloud_gax::paginator::Paginator<
2662 google_cloud_location::model::ListLocationsResponse,
2663 crate::Error,
2664 > {
2665 use std::clone::Clone;
2666 let token = self.0.request.page_token.clone();
2667 let execute = move |token: String| {
2668 let mut builder = self.clone();
2669 builder.0.request = builder.0.request.set_page_token(token);
2670 builder.send()
2671 };
2672 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2673 }
2674
2675 pub fn by_item(
2677 self,
2678 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2679 google_cloud_location::model::ListLocationsResponse,
2680 crate::Error,
2681 > {
2682 use google_cloud_gax::paginator::Paginator;
2683 self.by_page().items()
2684 }
2685
2686 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2688 self.0.request.name = v.into();
2689 self
2690 }
2691
2692 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2694 self.0.request.filter = v.into();
2695 self
2696 }
2697
2698 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2700 self.0.request.page_size = v.into();
2701 self
2702 }
2703
2704 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2706 self.0.request.page_token = v.into();
2707 self
2708 }
2709 }
2710
2711 #[doc(hidden)]
2712 impl crate::RequestBuilder for ListLocations {
2713 fn request_options(&mut self) -> &mut crate::RequestOptions {
2714 &mut self.0.options
2715 }
2716 }
2717
2718 #[derive(Clone, Debug)]
2735 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
2736
2737 impl GetLocation {
2738 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2739 Self(RequestBuilder::new(stub))
2740 }
2741
2742 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
2744 mut self,
2745 v: V,
2746 ) -> Self {
2747 self.0.request = v.into();
2748 self
2749 }
2750
2751 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2753 self.0.options = v.into();
2754 self
2755 }
2756
2757 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
2759 (*self.0.stub)
2760 .get_location(self.0.request, self.0.options)
2761 .await
2762 .map(crate::Response::into_body)
2763 }
2764
2765 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2767 self.0.request.name = v.into();
2768 self
2769 }
2770 }
2771
2772 #[doc(hidden)]
2773 impl crate::RequestBuilder for GetLocation {
2774 fn request_options(&mut self) -> &mut crate::RequestOptions {
2775 &mut self.0.options
2776 }
2777 }
2778
2779 #[derive(Clone, Debug)]
2800 pub struct ListOperations(
2801 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
2802 );
2803
2804 impl ListOperations {
2805 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2806 Self(RequestBuilder::new(stub))
2807 }
2808
2809 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
2811 mut self,
2812 v: V,
2813 ) -> Self {
2814 self.0.request = v.into();
2815 self
2816 }
2817
2818 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2820 self.0.options = v.into();
2821 self
2822 }
2823
2824 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
2826 (*self.0.stub)
2827 .list_operations(self.0.request, self.0.options)
2828 .await
2829 .map(crate::Response::into_body)
2830 }
2831
2832 pub fn by_page(
2834 self,
2835 ) -> impl google_cloud_gax::paginator::Paginator<
2836 google_cloud_longrunning::model::ListOperationsResponse,
2837 crate::Error,
2838 > {
2839 use std::clone::Clone;
2840 let token = self.0.request.page_token.clone();
2841 let execute = move |token: String| {
2842 let mut builder = self.clone();
2843 builder.0.request = builder.0.request.set_page_token(token);
2844 builder.send()
2845 };
2846 google_cloud_gax::paginator::internal::new_paginator(token, execute)
2847 }
2848
2849 pub fn by_item(
2851 self,
2852 ) -> impl google_cloud_gax::paginator::ItemPaginator<
2853 google_cloud_longrunning::model::ListOperationsResponse,
2854 crate::Error,
2855 > {
2856 use google_cloud_gax::paginator::Paginator;
2857 self.by_page().items()
2858 }
2859
2860 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2862 self.0.request.name = v.into();
2863 self
2864 }
2865
2866 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
2868 self.0.request.filter = v.into();
2869 self
2870 }
2871
2872 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
2874 self.0.request.page_size = v.into();
2875 self
2876 }
2877
2878 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
2880 self.0.request.page_token = v.into();
2881 self
2882 }
2883
2884 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
2886 self.0.request.return_partial_success = v.into();
2887 self
2888 }
2889 }
2890
2891 #[doc(hidden)]
2892 impl crate::RequestBuilder for ListOperations {
2893 fn request_options(&mut self) -> &mut crate::RequestOptions {
2894 &mut self.0.options
2895 }
2896 }
2897
2898 #[derive(Clone, Debug)]
2915 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
2916
2917 impl GetOperation {
2918 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2919 Self(RequestBuilder::new(stub))
2920 }
2921
2922 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
2924 mut self,
2925 v: V,
2926 ) -> Self {
2927 self.0.request = v.into();
2928 self
2929 }
2930
2931 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2933 self.0.options = v.into();
2934 self
2935 }
2936
2937 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
2939 (*self.0.stub)
2940 .get_operation(self.0.request, self.0.options)
2941 .await
2942 .map(crate::Response::into_body)
2943 }
2944
2945 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
2947 self.0.request.name = v.into();
2948 self
2949 }
2950 }
2951
2952 #[doc(hidden)]
2953 impl crate::RequestBuilder for GetOperation {
2954 fn request_options(&mut self) -> &mut crate::RequestOptions {
2955 &mut self.0.options
2956 }
2957 }
2958
2959 #[derive(Clone, Debug)]
2976 pub struct CancelOperation(
2977 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
2978 );
2979
2980 impl CancelOperation {
2981 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Contexts>) -> Self {
2982 Self(RequestBuilder::new(stub))
2983 }
2984
2985 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
2987 mut self,
2988 v: V,
2989 ) -> Self {
2990 self.0.request = v.into();
2991 self
2992 }
2993
2994 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
2996 self.0.options = v.into();
2997 self
2998 }
2999
3000 pub async fn send(self) -> Result<()> {
3002 (*self.0.stub)
3003 .cancel_operation(self.0.request, self.0.options)
3004 .await
3005 .map(crate::Response::into_body)
3006 }
3007
3008 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3010 self.0.request.name = v.into();
3011 self
3012 }
3013 }
3014
3015 #[doc(hidden)]
3016 impl crate::RequestBuilder for CancelOperation {
3017 fn request_options(&mut self) -> &mut crate::RequestOptions {
3018 &mut self.0.options
3019 }
3020 }
3021}
3022
3023#[cfg(feature = "conversations")]
3025#[cfg_attr(docsrs, doc(cfg(feature = "conversations")))]
3026pub mod conversations {
3027 use crate::Result;
3028
3029 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
3043
3044 pub(crate) mod client {
3045 use super::super::super::client::Conversations;
3046 pub struct Factory;
3047 impl crate::ClientFactory for Factory {
3048 type Client = Conversations;
3049 type Credentials = gaxi::options::Credentials;
3050 async fn build(
3051 self,
3052 config: gaxi::options::ClientConfig,
3053 ) -> crate::ClientBuilderResult<Self::Client> {
3054 Self::Client::new(config).await
3055 }
3056 }
3057 }
3058
3059 #[derive(Clone, Debug)]
3061 pub(crate) struct RequestBuilder<R: std::default::Default> {
3062 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3063 request: R,
3064 options: crate::RequestOptions,
3065 }
3066
3067 impl<R> RequestBuilder<R>
3068 where
3069 R: std::default::Default,
3070 {
3071 pub(crate) fn new(
3072 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3073 ) -> Self {
3074 Self {
3075 stub,
3076 request: R::default(),
3077 options: crate::RequestOptions::default(),
3078 }
3079 }
3080 }
3081
3082 #[derive(Clone, Debug)]
3099 pub struct CreateConversation(RequestBuilder<crate::model::CreateConversationRequest>);
3100
3101 impl CreateConversation {
3102 pub(crate) fn new(
3103 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3104 ) -> Self {
3105 Self(RequestBuilder::new(stub))
3106 }
3107
3108 pub fn with_request<V: Into<crate::model::CreateConversationRequest>>(
3110 mut self,
3111 v: V,
3112 ) -> Self {
3113 self.0.request = v.into();
3114 self
3115 }
3116
3117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3119 self.0.options = v.into();
3120 self
3121 }
3122
3123 pub async fn send(self) -> Result<crate::model::Conversation> {
3125 (*self.0.stub)
3126 .create_conversation(self.0.request, self.0.options)
3127 .await
3128 .map(crate::Response::into_body)
3129 }
3130
3131 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3135 self.0.request.parent = v.into();
3136 self
3137 }
3138
3139 pub fn set_conversation<T>(mut self, v: T) -> Self
3143 where
3144 T: std::convert::Into<crate::model::Conversation>,
3145 {
3146 self.0.request.conversation = std::option::Option::Some(v.into());
3147 self
3148 }
3149
3150 pub fn set_or_clear_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3154 where
3155 T: std::convert::Into<crate::model::Conversation>,
3156 {
3157 self.0.request.conversation = v.map(|x| x.into());
3158 self
3159 }
3160
3161 pub fn set_conversation_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
3163 self.0.request.conversation_id = v.into();
3164 self
3165 }
3166 }
3167
3168 #[doc(hidden)]
3169 impl crate::RequestBuilder for CreateConversation {
3170 fn request_options(&mut self) -> &mut crate::RequestOptions {
3171 &mut self.0.options
3172 }
3173 }
3174
3175 #[derive(Clone, Debug)]
3196 pub struct ListConversations(RequestBuilder<crate::model::ListConversationsRequest>);
3197
3198 impl ListConversations {
3199 pub(crate) fn new(
3200 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3201 ) -> Self {
3202 Self(RequestBuilder::new(stub))
3203 }
3204
3205 pub fn with_request<V: Into<crate::model::ListConversationsRequest>>(
3207 mut self,
3208 v: V,
3209 ) -> Self {
3210 self.0.request = v.into();
3211 self
3212 }
3213
3214 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3216 self.0.options = v.into();
3217 self
3218 }
3219
3220 pub async fn send(self) -> Result<crate::model::ListConversationsResponse> {
3222 (*self.0.stub)
3223 .list_conversations(self.0.request, self.0.options)
3224 .await
3225 .map(crate::Response::into_body)
3226 }
3227
3228 pub fn by_page(
3230 self,
3231 ) -> impl google_cloud_gax::paginator::Paginator<
3232 crate::model::ListConversationsResponse,
3233 crate::Error,
3234 > {
3235 use std::clone::Clone;
3236 let token = self.0.request.page_token.clone();
3237 let execute = move |token: String| {
3238 let mut builder = self.clone();
3239 builder.0.request = builder.0.request.set_page_token(token);
3240 builder.send()
3241 };
3242 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3243 }
3244
3245 pub fn by_item(
3247 self,
3248 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3249 crate::model::ListConversationsResponse,
3250 crate::Error,
3251 > {
3252 use google_cloud_gax::paginator::Paginator;
3253 self.by_page().items()
3254 }
3255
3256 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3260 self.0.request.parent = v.into();
3261 self
3262 }
3263
3264 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3266 self.0.request.page_size = v.into();
3267 self
3268 }
3269
3270 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3272 self.0.request.page_token = v.into();
3273 self
3274 }
3275
3276 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3278 self.0.request.filter = v.into();
3279 self
3280 }
3281 }
3282
3283 #[doc(hidden)]
3284 impl crate::RequestBuilder for ListConversations {
3285 fn request_options(&mut self) -> &mut crate::RequestOptions {
3286 &mut self.0.options
3287 }
3288 }
3289
3290 #[derive(Clone, Debug)]
3307 pub struct GetConversation(RequestBuilder<crate::model::GetConversationRequest>);
3308
3309 impl GetConversation {
3310 pub(crate) fn new(
3311 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3312 ) -> Self {
3313 Self(RequestBuilder::new(stub))
3314 }
3315
3316 pub fn with_request<V: Into<crate::model::GetConversationRequest>>(mut self, v: V) -> Self {
3318 self.0.request = v.into();
3319 self
3320 }
3321
3322 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3324 self.0.options = v.into();
3325 self
3326 }
3327
3328 pub async fn send(self) -> Result<crate::model::Conversation> {
3330 (*self.0.stub)
3331 .get_conversation(self.0.request, self.0.options)
3332 .await
3333 .map(crate::Response::into_body)
3334 }
3335
3336 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3340 self.0.request.name = v.into();
3341 self
3342 }
3343 }
3344
3345 #[doc(hidden)]
3346 impl crate::RequestBuilder for GetConversation {
3347 fn request_options(&mut self) -> &mut crate::RequestOptions {
3348 &mut self.0.options
3349 }
3350 }
3351
3352 #[derive(Clone, Debug)]
3369 pub struct CompleteConversation(RequestBuilder<crate::model::CompleteConversationRequest>);
3370
3371 impl CompleteConversation {
3372 pub(crate) fn new(
3373 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3374 ) -> Self {
3375 Self(RequestBuilder::new(stub))
3376 }
3377
3378 pub fn with_request<V: Into<crate::model::CompleteConversationRequest>>(
3380 mut self,
3381 v: V,
3382 ) -> Self {
3383 self.0.request = v.into();
3384 self
3385 }
3386
3387 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3389 self.0.options = v.into();
3390 self
3391 }
3392
3393 pub async fn send(self) -> Result<crate::model::Conversation> {
3395 (*self.0.stub)
3396 .complete_conversation(self.0.request, self.0.options)
3397 .await
3398 .map(crate::Response::into_body)
3399 }
3400
3401 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
3405 self.0.request.name = v.into();
3406 self
3407 }
3408 }
3409
3410 #[doc(hidden)]
3411 impl crate::RequestBuilder for CompleteConversation {
3412 fn request_options(&mut self) -> &mut crate::RequestOptions {
3413 &mut self.0.options
3414 }
3415 }
3416
3417 #[derive(Clone, Debug)]
3434 pub struct IngestContextReferences(
3435 RequestBuilder<crate::model::IngestContextReferencesRequest>,
3436 );
3437
3438 impl IngestContextReferences {
3439 pub(crate) fn new(
3440 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3441 ) -> Self {
3442 Self(RequestBuilder::new(stub))
3443 }
3444
3445 pub fn with_request<V: Into<crate::model::IngestContextReferencesRequest>>(
3447 mut self,
3448 v: V,
3449 ) -> Self {
3450 self.0.request = v.into();
3451 self
3452 }
3453
3454 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3456 self.0.options = v.into();
3457 self
3458 }
3459
3460 pub async fn send(self) -> Result<crate::model::IngestContextReferencesResponse> {
3462 (*self.0.stub)
3463 .ingest_context_references(self.0.request, self.0.options)
3464 .await
3465 .map(crate::Response::into_body)
3466 }
3467
3468 pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3472 self.0.request.conversation = v.into();
3473 self
3474 }
3475
3476 pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3480 where
3481 T: std::iter::IntoIterator<Item = (K, V)>,
3482 K: std::convert::Into<std::string::String>,
3483 V: std::convert::Into<crate::model::conversation::ContextReference>,
3484 {
3485 self.0.request.context_references =
3486 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3487 self
3488 }
3489 }
3490
3491 #[doc(hidden)]
3492 impl crate::RequestBuilder for IngestContextReferences {
3493 fn request_options(&mut self) -> &mut crate::RequestOptions {
3494 &mut self.0.options
3495 }
3496 }
3497
3498 #[derive(Clone, Debug)]
3519 pub struct ListMessages(RequestBuilder<crate::model::ListMessagesRequest>);
3520
3521 impl ListMessages {
3522 pub(crate) fn new(
3523 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3524 ) -> Self {
3525 Self(RequestBuilder::new(stub))
3526 }
3527
3528 pub fn with_request<V: Into<crate::model::ListMessagesRequest>>(mut self, v: V) -> Self {
3530 self.0.request = v.into();
3531 self
3532 }
3533
3534 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3536 self.0.options = v.into();
3537 self
3538 }
3539
3540 pub async fn send(self) -> Result<crate::model::ListMessagesResponse> {
3542 (*self.0.stub)
3543 .list_messages(self.0.request, self.0.options)
3544 .await
3545 .map(crate::Response::into_body)
3546 }
3547
3548 pub fn by_page(
3550 self,
3551 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListMessagesResponse, crate::Error>
3552 {
3553 use std::clone::Clone;
3554 let token = self.0.request.page_token.clone();
3555 let execute = move |token: String| {
3556 let mut builder = self.clone();
3557 builder.0.request = builder.0.request.set_page_token(token);
3558 builder.send()
3559 };
3560 google_cloud_gax::paginator::internal::new_paginator(token, execute)
3561 }
3562
3563 pub fn by_item(
3565 self,
3566 ) -> impl google_cloud_gax::paginator::ItemPaginator<
3567 crate::model::ListMessagesResponse,
3568 crate::Error,
3569 > {
3570 use google_cloud_gax::paginator::Paginator;
3571 self.by_page().items()
3572 }
3573
3574 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3578 self.0.request.parent = v.into();
3579 self
3580 }
3581
3582 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
3584 self.0.request.filter = v.into();
3585 self
3586 }
3587
3588 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
3590 self.0.request.page_size = v.into();
3591 self
3592 }
3593
3594 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
3596 self.0.request.page_token = v.into();
3597 self
3598 }
3599 }
3600
3601 #[doc(hidden)]
3602 impl crate::RequestBuilder for ListMessages {
3603 fn request_options(&mut self) -> &mut crate::RequestOptions {
3604 &mut self.0.options
3605 }
3606 }
3607
3608 #[derive(Clone, Debug)]
3625 pub struct SuggestConversationSummary(
3626 RequestBuilder<crate::model::SuggestConversationSummaryRequest>,
3627 );
3628
3629 impl SuggestConversationSummary {
3630 pub(crate) fn new(
3631 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3632 ) -> Self {
3633 Self(RequestBuilder::new(stub))
3634 }
3635
3636 pub fn with_request<V: Into<crate::model::SuggestConversationSummaryRequest>>(
3638 mut self,
3639 v: V,
3640 ) -> Self {
3641 self.0.request = v.into();
3642 self
3643 }
3644
3645 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3647 self.0.options = v.into();
3648 self
3649 }
3650
3651 pub async fn send(self) -> Result<crate::model::SuggestConversationSummaryResponse> {
3653 (*self.0.stub)
3654 .suggest_conversation_summary(self.0.request, self.0.options)
3655 .await
3656 .map(crate::Response::into_body)
3657 }
3658
3659 pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
3663 self.0.request.conversation = v.into();
3664 self
3665 }
3666
3667 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3669 self.0.request.latest_message = v.into();
3670 self
3671 }
3672
3673 pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3675 self.0.request.context_size = v.into();
3676 self
3677 }
3678
3679 pub fn set_assist_query_params<T>(mut self, v: T) -> Self
3681 where
3682 T: std::convert::Into<crate::model::AssistQueryParameters>,
3683 {
3684 self.0.request.assist_query_params = std::option::Option::Some(v.into());
3685 self
3686 }
3687
3688 pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
3690 where
3691 T: std::convert::Into<crate::model::AssistQueryParameters>,
3692 {
3693 self.0.request.assist_query_params = v.map(|x| x.into());
3694 self
3695 }
3696 }
3697
3698 #[doc(hidden)]
3699 impl crate::RequestBuilder for SuggestConversationSummary {
3700 fn request_options(&mut self) -> &mut crate::RequestOptions {
3701 &mut self.0.options
3702 }
3703 }
3704
3705 #[derive(Clone, Debug)]
3722 pub struct GenerateStatelessSummary(
3723 RequestBuilder<crate::model::GenerateStatelessSummaryRequest>,
3724 );
3725
3726 impl GenerateStatelessSummary {
3727 pub(crate) fn new(
3728 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3729 ) -> Self {
3730 Self(RequestBuilder::new(stub))
3731 }
3732
3733 pub fn with_request<V: Into<crate::model::GenerateStatelessSummaryRequest>>(
3735 mut self,
3736 v: V,
3737 ) -> Self {
3738 self.0.request = v.into();
3739 self
3740 }
3741
3742 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3744 self.0.options = v.into();
3745 self
3746 }
3747
3748 pub async fn send(self) -> Result<crate::model::GenerateStatelessSummaryResponse> {
3750 (*self.0.stub)
3751 .generate_stateless_summary(self.0.request, self.0.options)
3752 .await
3753 .map(crate::Response::into_body)
3754 }
3755
3756 pub fn set_stateless_conversation<T>(mut self, v: T) -> Self
3760 where
3761 T: std::convert::Into<
3762 crate::model::generate_stateless_summary_request::MinimalConversation,
3763 >,
3764 {
3765 self.0.request.stateless_conversation = std::option::Option::Some(v.into());
3766 self
3767 }
3768
3769 pub fn set_or_clear_stateless_conversation<T>(mut self, v: std::option::Option<T>) -> Self
3773 where
3774 T: std::convert::Into<
3775 crate::model::generate_stateless_summary_request::MinimalConversation,
3776 >,
3777 {
3778 self.0.request.stateless_conversation = v.map(|x| x.into());
3779 self
3780 }
3781
3782 pub fn set_conversation_profile<T>(mut self, v: T) -> Self
3786 where
3787 T: std::convert::Into<crate::model::ConversationProfile>,
3788 {
3789 self.0.request.conversation_profile = std::option::Option::Some(v.into());
3790 self
3791 }
3792
3793 pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
3797 where
3798 T: std::convert::Into<crate::model::ConversationProfile>,
3799 {
3800 self.0.request.conversation_profile = v.map(|x| x.into());
3801 self
3802 }
3803
3804 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
3806 self.0.request.latest_message = v.into();
3807 self
3808 }
3809
3810 pub fn set_max_context_size<T: Into<i32>>(mut self, v: T) -> Self {
3812 self.0.request.max_context_size = v.into();
3813 self
3814 }
3815 }
3816
3817 #[doc(hidden)]
3818 impl crate::RequestBuilder for GenerateStatelessSummary {
3819 fn request_options(&mut self) -> &mut crate::RequestOptions {
3820 &mut self.0.options
3821 }
3822 }
3823
3824 #[derive(Clone, Debug)]
3841 pub struct GenerateStatelessSuggestion(
3842 RequestBuilder<crate::model::GenerateStatelessSuggestionRequest>,
3843 );
3844
3845 impl GenerateStatelessSuggestion {
3846 pub(crate) fn new(
3847 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
3848 ) -> Self {
3849 Self(RequestBuilder::new(stub))
3850 }
3851
3852 pub fn with_request<V: Into<crate::model::GenerateStatelessSuggestionRequest>>(
3854 mut self,
3855 v: V,
3856 ) -> Self {
3857 self.0.request = v.into();
3858 self
3859 }
3860
3861 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
3863 self.0.options = v.into();
3864 self
3865 }
3866
3867 pub async fn send(self) -> Result<crate::model::GenerateStatelessSuggestionResponse> {
3869 (*self.0.stub)
3870 .generate_stateless_suggestion(self.0.request, self.0.options)
3871 .await
3872 .map(crate::Response::into_body)
3873 }
3874
3875 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
3879 self.0.request.parent = v.into();
3880 self
3881 }
3882
3883 pub fn set_context_references<T, K, V>(mut self, v: T) -> Self
3885 where
3886 T: std::iter::IntoIterator<Item = (K, V)>,
3887 K: std::convert::Into<std::string::String>,
3888 V: std::convert::Into<crate::model::conversation::ContextReference>,
3889 {
3890 self.0.request.context_references =
3891 v.into_iter().map(|(k, v)| (k.into(), v.into())).collect();
3892 self
3893 }
3894
3895 pub fn set_conversation_context<T>(mut self, v: T) -> Self
3897 where
3898 T: std::convert::Into<crate::model::ConversationContext>,
3899 {
3900 self.0.request.conversation_context = std::option::Option::Some(v.into());
3901 self
3902 }
3903
3904 pub fn set_or_clear_conversation_context<T>(mut self, v: std::option::Option<T>) -> Self
3906 where
3907 T: std::convert::Into<crate::model::ConversationContext>,
3908 {
3909 self.0.request.conversation_context = v.map(|x| x.into());
3910 self
3911 }
3912
3913 pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
3915 where
3916 T: std::iter::IntoIterator<Item = V>,
3917 V: std::convert::Into<crate::model::TriggerEvent>,
3918 {
3919 use std::iter::Iterator;
3920 self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
3921 self
3922 }
3923
3924 pub fn set_security_settings<T: Into<std::string::String>>(mut self, v: T) -> Self {
3926 self.0.request.security_settings = v.into();
3927 self
3928 }
3929
3930 pub fn set_generator_resource<
3935 T: Into<Option<crate::model::generate_stateless_suggestion_request::GeneratorResource>>,
3936 >(
3937 mut self,
3938 v: T,
3939 ) -> Self {
3940 self.0.request.generator_resource = v.into();
3941 self
3942 }
3943
3944 pub fn set_generator<T: std::convert::Into<std::boxed::Box<crate::model::Generator>>>(
3950 mut self,
3951 v: T,
3952 ) -> Self {
3953 self.0.request = self.0.request.set_generator(v);
3954 self
3955 }
3956
3957 pub fn set_generator_name<T: std::convert::Into<std::string::String>>(
3963 mut self,
3964 v: T,
3965 ) -> Self {
3966 self.0.request = self.0.request.set_generator_name(v);
3967 self
3968 }
3969 }
3970
3971 #[doc(hidden)]
3972 impl crate::RequestBuilder for GenerateStatelessSuggestion {
3973 fn request_options(&mut self) -> &mut crate::RequestOptions {
3974 &mut self.0.options
3975 }
3976 }
3977
3978 #[derive(Clone, Debug)]
3995 pub struct SearchKnowledge(RequestBuilder<crate::model::SearchKnowledgeRequest>);
3996
3997 impl SearchKnowledge {
3998 pub(crate) fn new(
3999 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4000 ) -> Self {
4001 Self(RequestBuilder::new(stub))
4002 }
4003
4004 pub fn with_request<V: Into<crate::model::SearchKnowledgeRequest>>(mut self, v: V) -> Self {
4006 self.0.request = v.into();
4007 self
4008 }
4009
4010 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4012 self.0.options = v.into();
4013 self
4014 }
4015
4016 pub async fn send(self) -> Result<crate::model::SearchKnowledgeResponse> {
4018 (*self.0.stub)
4019 .search_knowledge(self.0.request, self.0.options)
4020 .await
4021 .map(crate::Response::into_body)
4022 }
4023
4024 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4028 self.0.request.parent = v.into();
4029 self
4030 }
4031
4032 pub fn set_query<T>(mut self, v: T) -> Self
4036 where
4037 T: std::convert::Into<crate::model::TextInput>,
4038 {
4039 self.0.request.query = std::option::Option::Some(v.into());
4040 self
4041 }
4042
4043 pub fn set_or_clear_query<T>(mut self, v: std::option::Option<T>) -> Self
4047 where
4048 T: std::convert::Into<crate::model::TextInput>,
4049 {
4050 self.0.request.query = v.map(|x| x.into());
4051 self
4052 }
4053
4054 pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
4058 self.0.request.conversation_profile = v.into();
4059 self
4060 }
4061
4062 pub fn set_session_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
4066 self.0.request.session_id = v.into();
4067 self
4068 }
4069
4070 pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4072 self.0.request.conversation = v.into();
4073 self
4074 }
4075
4076 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4078 self.0.request.latest_message = v.into();
4079 self
4080 }
4081
4082 pub fn set_query_source<T: Into<crate::model::search_knowledge_request::QuerySource>>(
4084 mut self,
4085 v: T,
4086 ) -> Self {
4087 self.0.request.query_source = v.into();
4088 self
4089 }
4090
4091 pub fn set_end_user_metadata<T>(mut self, v: T) -> Self
4093 where
4094 T: std::convert::Into<wkt::Struct>,
4095 {
4096 self.0.request.end_user_metadata = std::option::Option::Some(v.into());
4097 self
4098 }
4099
4100 pub fn set_or_clear_end_user_metadata<T>(mut self, v: std::option::Option<T>) -> Self
4102 where
4103 T: std::convert::Into<wkt::Struct>,
4104 {
4105 self.0.request.end_user_metadata = v.map(|x| x.into());
4106 self
4107 }
4108
4109 pub fn set_search_config<T>(mut self, v: T) -> Self
4111 where
4112 T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4113 {
4114 self.0.request.search_config = std::option::Option::Some(v.into());
4115 self
4116 }
4117
4118 pub fn set_or_clear_search_config<T>(mut self, v: std::option::Option<T>) -> Self
4120 where
4121 T: std::convert::Into<crate::model::search_knowledge_request::SearchConfig>,
4122 {
4123 self.0.request.search_config = v.map(|x| x.into());
4124 self
4125 }
4126
4127 pub fn set_exact_search<T: Into<bool>>(mut self, v: T) -> Self {
4129 self.0.request.exact_search = v.into();
4130 self
4131 }
4132 }
4133
4134 #[doc(hidden)]
4135 impl crate::RequestBuilder for SearchKnowledge {
4136 fn request_options(&mut self) -> &mut crate::RequestOptions {
4137 &mut self.0.options
4138 }
4139 }
4140
4141 #[derive(Clone, Debug)]
4158 pub struct GenerateSuggestions(RequestBuilder<crate::model::GenerateSuggestionsRequest>);
4159
4160 impl GenerateSuggestions {
4161 pub(crate) fn new(
4162 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4163 ) -> Self {
4164 Self(RequestBuilder::new(stub))
4165 }
4166
4167 pub fn with_request<V: Into<crate::model::GenerateSuggestionsRequest>>(
4169 mut self,
4170 v: V,
4171 ) -> Self {
4172 self.0.request = v.into();
4173 self
4174 }
4175
4176 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4178 self.0.options = v.into();
4179 self
4180 }
4181
4182 pub async fn send(self) -> Result<crate::model::GenerateSuggestionsResponse> {
4184 (*self.0.stub)
4185 .generate_suggestions(self.0.request, self.0.options)
4186 .await
4187 .map(crate::Response::into_body)
4188 }
4189
4190 pub fn set_conversation<T: Into<std::string::String>>(mut self, v: T) -> Self {
4194 self.0.request.conversation = v.into();
4195 self
4196 }
4197
4198 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
4200 self.0.request.latest_message = v.into();
4201 self
4202 }
4203
4204 pub fn set_trigger_events<T, V>(mut self, v: T) -> Self
4206 where
4207 T: std::iter::IntoIterator<Item = V>,
4208 V: std::convert::Into<crate::model::TriggerEvent>,
4209 {
4210 use std::iter::Iterator;
4211 self.0.request.trigger_events = v.into_iter().map(|i| i.into()).collect();
4212 self
4213 }
4214 }
4215
4216 #[doc(hidden)]
4217 impl crate::RequestBuilder for GenerateSuggestions {
4218 fn request_options(&mut self) -> &mut crate::RequestOptions {
4219 &mut self.0.options
4220 }
4221 }
4222
4223 #[derive(Clone, Debug)]
4244 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
4245
4246 impl ListLocations {
4247 pub(crate) fn new(
4248 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4249 ) -> Self {
4250 Self(RequestBuilder::new(stub))
4251 }
4252
4253 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
4255 mut self,
4256 v: V,
4257 ) -> Self {
4258 self.0.request = v.into();
4259 self
4260 }
4261
4262 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4264 self.0.options = v.into();
4265 self
4266 }
4267
4268 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
4270 (*self.0.stub)
4271 .list_locations(self.0.request, self.0.options)
4272 .await
4273 .map(crate::Response::into_body)
4274 }
4275
4276 pub fn by_page(
4278 self,
4279 ) -> impl google_cloud_gax::paginator::Paginator<
4280 google_cloud_location::model::ListLocationsResponse,
4281 crate::Error,
4282 > {
4283 use std::clone::Clone;
4284 let token = self.0.request.page_token.clone();
4285 let execute = move |token: String| {
4286 let mut builder = self.clone();
4287 builder.0.request = builder.0.request.set_page_token(token);
4288 builder.send()
4289 };
4290 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4291 }
4292
4293 pub fn by_item(
4295 self,
4296 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4297 google_cloud_location::model::ListLocationsResponse,
4298 crate::Error,
4299 > {
4300 use google_cloud_gax::paginator::Paginator;
4301 self.by_page().items()
4302 }
4303
4304 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4306 self.0.request.name = v.into();
4307 self
4308 }
4309
4310 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4312 self.0.request.filter = v.into();
4313 self
4314 }
4315
4316 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4318 self.0.request.page_size = v.into();
4319 self
4320 }
4321
4322 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4324 self.0.request.page_token = v.into();
4325 self
4326 }
4327 }
4328
4329 #[doc(hidden)]
4330 impl crate::RequestBuilder for ListLocations {
4331 fn request_options(&mut self) -> &mut crate::RequestOptions {
4332 &mut self.0.options
4333 }
4334 }
4335
4336 #[derive(Clone, Debug)]
4353 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
4354
4355 impl GetLocation {
4356 pub(crate) fn new(
4357 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4358 ) -> Self {
4359 Self(RequestBuilder::new(stub))
4360 }
4361
4362 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
4364 mut self,
4365 v: V,
4366 ) -> Self {
4367 self.0.request = v.into();
4368 self
4369 }
4370
4371 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4373 self.0.options = v.into();
4374 self
4375 }
4376
4377 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
4379 (*self.0.stub)
4380 .get_location(self.0.request, self.0.options)
4381 .await
4382 .map(crate::Response::into_body)
4383 }
4384
4385 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4387 self.0.request.name = v.into();
4388 self
4389 }
4390 }
4391
4392 #[doc(hidden)]
4393 impl crate::RequestBuilder for GetLocation {
4394 fn request_options(&mut self) -> &mut crate::RequestOptions {
4395 &mut self.0.options
4396 }
4397 }
4398
4399 #[derive(Clone, Debug)]
4420 pub struct ListOperations(
4421 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
4422 );
4423
4424 impl ListOperations {
4425 pub(crate) fn new(
4426 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4427 ) -> Self {
4428 Self(RequestBuilder::new(stub))
4429 }
4430
4431 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
4433 mut self,
4434 v: V,
4435 ) -> Self {
4436 self.0.request = v.into();
4437 self
4438 }
4439
4440 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4442 self.0.options = v.into();
4443 self
4444 }
4445
4446 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
4448 (*self.0.stub)
4449 .list_operations(self.0.request, self.0.options)
4450 .await
4451 .map(crate::Response::into_body)
4452 }
4453
4454 pub fn by_page(
4456 self,
4457 ) -> impl google_cloud_gax::paginator::Paginator<
4458 google_cloud_longrunning::model::ListOperationsResponse,
4459 crate::Error,
4460 > {
4461 use std::clone::Clone;
4462 let token = self.0.request.page_token.clone();
4463 let execute = move |token: String| {
4464 let mut builder = self.clone();
4465 builder.0.request = builder.0.request.set_page_token(token);
4466 builder.send()
4467 };
4468 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4469 }
4470
4471 pub fn by_item(
4473 self,
4474 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4475 google_cloud_longrunning::model::ListOperationsResponse,
4476 crate::Error,
4477 > {
4478 use google_cloud_gax::paginator::Paginator;
4479 self.by_page().items()
4480 }
4481
4482 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4484 self.0.request.name = v.into();
4485 self
4486 }
4487
4488 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
4490 self.0.request.filter = v.into();
4491 self
4492 }
4493
4494 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
4496 self.0.request.page_size = v.into();
4497 self
4498 }
4499
4500 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
4502 self.0.request.page_token = v.into();
4503 self
4504 }
4505
4506 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
4508 self.0.request.return_partial_success = v.into();
4509 self
4510 }
4511 }
4512
4513 #[doc(hidden)]
4514 impl crate::RequestBuilder for ListOperations {
4515 fn request_options(&mut self) -> &mut crate::RequestOptions {
4516 &mut self.0.options
4517 }
4518 }
4519
4520 #[derive(Clone, Debug)]
4537 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
4538
4539 impl GetOperation {
4540 pub(crate) fn new(
4541 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4542 ) -> Self {
4543 Self(RequestBuilder::new(stub))
4544 }
4545
4546 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
4548 mut self,
4549 v: V,
4550 ) -> Self {
4551 self.0.request = v.into();
4552 self
4553 }
4554
4555 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4557 self.0.options = v.into();
4558 self
4559 }
4560
4561 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4563 (*self.0.stub)
4564 .get_operation(self.0.request, self.0.options)
4565 .await
4566 .map(crate::Response::into_body)
4567 }
4568
4569 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4571 self.0.request.name = v.into();
4572 self
4573 }
4574 }
4575
4576 #[doc(hidden)]
4577 impl crate::RequestBuilder for GetOperation {
4578 fn request_options(&mut self) -> &mut crate::RequestOptions {
4579 &mut self.0.options
4580 }
4581 }
4582
4583 #[derive(Clone, Debug)]
4600 pub struct CancelOperation(
4601 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
4602 );
4603
4604 impl CancelOperation {
4605 pub(crate) fn new(
4606 stub: std::sync::Arc<dyn super::super::stub::dynamic::Conversations>,
4607 ) -> Self {
4608 Self(RequestBuilder::new(stub))
4609 }
4610
4611 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
4613 mut self,
4614 v: V,
4615 ) -> Self {
4616 self.0.request = v.into();
4617 self
4618 }
4619
4620 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4622 self.0.options = v.into();
4623 self
4624 }
4625
4626 pub async fn send(self) -> Result<()> {
4628 (*self.0.stub)
4629 .cancel_operation(self.0.request, self.0.options)
4630 .await
4631 .map(crate::Response::into_body)
4632 }
4633
4634 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4636 self.0.request.name = v.into();
4637 self
4638 }
4639 }
4640
4641 #[doc(hidden)]
4642 impl crate::RequestBuilder for CancelOperation {
4643 fn request_options(&mut self) -> &mut crate::RequestOptions {
4644 &mut self.0.options
4645 }
4646 }
4647}
4648
4649#[cfg(feature = "conversation-datasets")]
4651#[cfg_attr(docsrs, doc(cfg(feature = "conversation-datasets")))]
4652pub mod conversation_datasets {
4653 use crate::Result;
4654
4655 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
4669
4670 pub(crate) mod client {
4671 use super::super::super::client::ConversationDatasets;
4672 pub struct Factory;
4673 impl crate::ClientFactory for Factory {
4674 type Client = ConversationDatasets;
4675 type Credentials = gaxi::options::Credentials;
4676 async fn build(
4677 self,
4678 config: gaxi::options::ClientConfig,
4679 ) -> crate::ClientBuilderResult<Self::Client> {
4680 Self::Client::new(config).await
4681 }
4682 }
4683 }
4684
4685 #[derive(Clone, Debug)]
4687 pub(crate) struct RequestBuilder<R: std::default::Default> {
4688 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4689 request: R,
4690 options: crate::RequestOptions,
4691 }
4692
4693 impl<R> RequestBuilder<R>
4694 where
4695 R: std::default::Default,
4696 {
4697 pub(crate) fn new(
4698 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4699 ) -> Self {
4700 Self {
4701 stub,
4702 request: R::default(),
4703 options: crate::RequestOptions::default(),
4704 }
4705 }
4706 }
4707
4708 #[derive(Clone, Debug)]
4726 pub struct CreateConversationDataset(
4727 RequestBuilder<crate::model::CreateConversationDatasetRequest>,
4728 );
4729
4730 impl CreateConversationDataset {
4731 pub(crate) fn new(
4732 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4733 ) -> Self {
4734 Self(RequestBuilder::new(stub))
4735 }
4736
4737 pub fn with_request<V: Into<crate::model::CreateConversationDatasetRequest>>(
4739 mut self,
4740 v: V,
4741 ) -> Self {
4742 self.0.request = v.into();
4743 self
4744 }
4745
4746 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4748 self.0.options = v.into();
4749 self
4750 }
4751
4752 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
4759 (*self.0.stub)
4760 .create_conversation_dataset(self.0.request, self.0.options)
4761 .await
4762 .map(crate::Response::into_body)
4763 }
4764
4765 pub fn poller(
4767 self,
4768 ) -> impl google_cloud_lro::Poller<
4769 crate::model::ConversationDataset,
4770 crate::model::CreateConversationDatasetOperationMetadata,
4771 > {
4772 type Operation = google_cloud_lro::internal::Operation<
4773 crate::model::ConversationDataset,
4774 crate::model::CreateConversationDatasetOperationMetadata,
4775 >;
4776 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
4777 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
4778 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
4779 if let Some(ref mut details) = poller_options.tracing {
4780 details.method_name = "google_cloud_dialogflow_v2::client::ConversationDatasets::create_conversation_dataset::until_done";
4781 }
4782
4783 let stub = self.0.stub.clone();
4784 let mut options = self.0.options.clone();
4785 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
4786 let query = move |name| {
4787 let stub = stub.clone();
4788 let options = options.clone();
4789 async {
4790 let op = GetOperation::new(stub)
4791 .set_name(name)
4792 .with_options(options)
4793 .send()
4794 .await?;
4795 Ok(Operation::new(op))
4796 }
4797 };
4798
4799 let start = move || async {
4800 let op = self.send().await?;
4801 Ok(Operation::new(op))
4802 };
4803
4804 use google_cloud_lro::internal::PollerExt;
4805 {
4806 google_cloud_lro::internal::new_poller(
4807 polling_error_policy,
4808 polling_backoff_policy,
4809 start,
4810 query,
4811 )
4812 }
4813 .with_options(poller_options)
4814 }
4815
4816 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
4820 self.0.request.parent = v.into();
4821 self
4822 }
4823
4824 pub fn set_conversation_dataset<T>(mut self, v: T) -> Self
4828 where
4829 T: std::convert::Into<crate::model::ConversationDataset>,
4830 {
4831 self.0.request.conversation_dataset = std::option::Option::Some(v.into());
4832 self
4833 }
4834
4835 pub fn set_or_clear_conversation_dataset<T>(mut self, v: std::option::Option<T>) -> Self
4839 where
4840 T: std::convert::Into<crate::model::ConversationDataset>,
4841 {
4842 self.0.request.conversation_dataset = v.map(|x| x.into());
4843 self
4844 }
4845 }
4846
4847 #[doc(hidden)]
4848 impl crate::RequestBuilder for CreateConversationDataset {
4849 fn request_options(&mut self) -> &mut crate::RequestOptions {
4850 &mut self.0.options
4851 }
4852 }
4853
4854 #[derive(Clone, Debug)]
4871 pub struct GetConversationDataset(RequestBuilder<crate::model::GetConversationDatasetRequest>);
4872
4873 impl GetConversationDataset {
4874 pub(crate) fn new(
4875 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4876 ) -> Self {
4877 Self(RequestBuilder::new(stub))
4878 }
4879
4880 pub fn with_request<V: Into<crate::model::GetConversationDatasetRequest>>(
4882 mut self,
4883 v: V,
4884 ) -> Self {
4885 self.0.request = v.into();
4886 self
4887 }
4888
4889 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4891 self.0.options = v.into();
4892 self
4893 }
4894
4895 pub async fn send(self) -> Result<crate::model::ConversationDataset> {
4897 (*self.0.stub)
4898 .get_conversation_dataset(self.0.request, self.0.options)
4899 .await
4900 .map(crate::Response::into_body)
4901 }
4902
4903 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
4907 self.0.request.name = v.into();
4908 self
4909 }
4910 }
4911
4912 #[doc(hidden)]
4913 impl crate::RequestBuilder for GetConversationDataset {
4914 fn request_options(&mut self) -> &mut crate::RequestOptions {
4915 &mut self.0.options
4916 }
4917 }
4918
4919 #[derive(Clone, Debug)]
4940 pub struct ListConversationDatasets(
4941 RequestBuilder<crate::model::ListConversationDatasetsRequest>,
4942 );
4943
4944 impl ListConversationDatasets {
4945 pub(crate) fn new(
4946 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
4947 ) -> Self {
4948 Self(RequestBuilder::new(stub))
4949 }
4950
4951 pub fn with_request<V: Into<crate::model::ListConversationDatasetsRequest>>(
4953 mut self,
4954 v: V,
4955 ) -> Self {
4956 self.0.request = v.into();
4957 self
4958 }
4959
4960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
4962 self.0.options = v.into();
4963 self
4964 }
4965
4966 pub async fn send(self) -> Result<crate::model::ListConversationDatasetsResponse> {
4968 (*self.0.stub)
4969 .list_conversation_datasets(self.0.request, self.0.options)
4970 .await
4971 .map(crate::Response::into_body)
4972 }
4973
4974 pub fn by_page(
4976 self,
4977 ) -> impl google_cloud_gax::paginator::Paginator<
4978 crate::model::ListConversationDatasetsResponse,
4979 crate::Error,
4980 > {
4981 use std::clone::Clone;
4982 let token = self.0.request.page_token.clone();
4983 let execute = move |token: String| {
4984 let mut builder = self.clone();
4985 builder.0.request = builder.0.request.set_page_token(token);
4986 builder.send()
4987 };
4988 google_cloud_gax::paginator::internal::new_paginator(token, execute)
4989 }
4990
4991 pub fn by_item(
4993 self,
4994 ) -> impl google_cloud_gax::paginator::ItemPaginator<
4995 crate::model::ListConversationDatasetsResponse,
4996 crate::Error,
4997 > {
4998 use google_cloud_gax::paginator::Paginator;
4999 self.by_page().items()
5000 }
5001
5002 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5006 self.0.request.parent = v.into();
5007 self
5008 }
5009
5010 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5012 self.0.request.page_size = v.into();
5013 self
5014 }
5015
5016 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5018 self.0.request.page_token = v.into();
5019 self
5020 }
5021 }
5022
5023 #[doc(hidden)]
5024 impl crate::RequestBuilder for ListConversationDatasets {
5025 fn request_options(&mut self) -> &mut crate::RequestOptions {
5026 &mut self.0.options
5027 }
5028 }
5029
5030 #[derive(Clone, Debug)]
5048 pub struct DeleteConversationDataset(
5049 RequestBuilder<crate::model::DeleteConversationDatasetRequest>,
5050 );
5051
5052 impl DeleteConversationDataset {
5053 pub(crate) fn new(
5054 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5055 ) -> Self {
5056 Self(RequestBuilder::new(stub))
5057 }
5058
5059 pub fn with_request<V: Into<crate::model::DeleteConversationDatasetRequest>>(
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<google_cloud_longrunning::model::Operation> {
5081 (*self.0.stub)
5082 .delete_conversation_dataset(self.0.request, self.0.options)
5083 .await
5084 .map(crate::Response::into_body)
5085 }
5086
5087 pub fn poller(
5089 self,
5090 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationDatasetOperationMetadata>
5091 {
5092 type Operation = google_cloud_lro::internal::Operation<
5093 wkt::Empty,
5094 crate::model::DeleteConversationDatasetOperationMetadata,
5095 >;
5096 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5097 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5098 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5099 if let Some(ref mut details) = poller_options.tracing {
5100 details.method_name = "google_cloud_dialogflow_v2::client::ConversationDatasets::delete_conversation_dataset::until_done";
5101 }
5102
5103 let stub = self.0.stub.clone();
5104 let mut options = self.0.options.clone();
5105 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5106 let query = move |name| {
5107 let stub = stub.clone();
5108 let options = options.clone();
5109 async {
5110 let op = GetOperation::new(stub)
5111 .set_name(name)
5112 .with_options(options)
5113 .send()
5114 .await?;
5115 Ok(Operation::new(op))
5116 }
5117 };
5118
5119 let start = move || async {
5120 let op = self.send().await?;
5121 Ok(Operation::new(op))
5122 };
5123
5124 use google_cloud_lro::internal::PollerExt;
5125 {
5126 google_cloud_lro::internal::new_unit_response_poller(
5127 polling_error_policy,
5128 polling_backoff_policy,
5129 start,
5130 query,
5131 )
5132 }
5133 .with_options(poller_options)
5134 }
5135
5136 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5140 self.0.request.name = v.into();
5141 self
5142 }
5143 }
5144
5145 #[doc(hidden)]
5146 impl crate::RequestBuilder for DeleteConversationDataset {
5147 fn request_options(&mut self) -> &mut crate::RequestOptions {
5148 &mut self.0.options
5149 }
5150 }
5151
5152 #[derive(Clone, Debug)]
5170 pub struct ImportConversationData(RequestBuilder<crate::model::ImportConversationDataRequest>);
5171
5172 impl ImportConversationData {
5173 pub(crate) fn new(
5174 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5175 ) -> Self {
5176 Self(RequestBuilder::new(stub))
5177 }
5178
5179 pub fn with_request<V: Into<crate::model::ImportConversationDataRequest>>(
5181 mut self,
5182 v: V,
5183 ) -> Self {
5184 self.0.request = v.into();
5185 self
5186 }
5187
5188 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5190 self.0.options = v.into();
5191 self
5192 }
5193
5194 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5201 (*self.0.stub)
5202 .import_conversation_data(self.0.request, self.0.options)
5203 .await
5204 .map(crate::Response::into_body)
5205 }
5206
5207 pub fn poller(
5209 self,
5210 ) -> impl google_cloud_lro::Poller<
5211 crate::model::ImportConversationDataOperationResponse,
5212 crate::model::ImportConversationDataOperationMetadata,
5213 > {
5214 type Operation = google_cloud_lro::internal::Operation<
5215 crate::model::ImportConversationDataOperationResponse,
5216 crate::model::ImportConversationDataOperationMetadata,
5217 >;
5218 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5219 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5220 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5221 if let Some(ref mut details) = poller_options.tracing {
5222 details.method_name = "google_cloud_dialogflow_v2::client::ConversationDatasets::import_conversation_data::until_done";
5223 }
5224
5225 let stub = self.0.stub.clone();
5226 let mut options = self.0.options.clone();
5227 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5228 let query = move |name| {
5229 let stub = stub.clone();
5230 let options = options.clone();
5231 async {
5232 let op = GetOperation::new(stub)
5233 .set_name(name)
5234 .with_options(options)
5235 .send()
5236 .await?;
5237 Ok(Operation::new(op))
5238 }
5239 };
5240
5241 let start = move || async {
5242 let op = self.send().await?;
5243 Ok(Operation::new(op))
5244 };
5245
5246 use google_cloud_lro::internal::PollerExt;
5247 {
5248 google_cloud_lro::internal::new_poller(
5249 polling_error_policy,
5250 polling_backoff_policy,
5251 start,
5252 query,
5253 )
5254 }
5255 .with_options(poller_options)
5256 }
5257
5258 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5262 self.0.request.name = v.into();
5263 self
5264 }
5265
5266 pub fn set_input_config<T>(mut self, v: T) -> Self
5270 where
5271 T: std::convert::Into<crate::model::InputConfig>,
5272 {
5273 self.0.request.input_config = std::option::Option::Some(v.into());
5274 self
5275 }
5276
5277 pub fn set_or_clear_input_config<T>(mut self, v: std::option::Option<T>) -> Self
5281 where
5282 T: std::convert::Into<crate::model::InputConfig>,
5283 {
5284 self.0.request.input_config = v.map(|x| x.into());
5285 self
5286 }
5287 }
5288
5289 #[doc(hidden)]
5290 impl crate::RequestBuilder for ImportConversationData {
5291 fn request_options(&mut self) -> &mut crate::RequestOptions {
5292 &mut self.0.options
5293 }
5294 }
5295
5296 #[derive(Clone, Debug)]
5317 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
5318
5319 impl ListLocations {
5320 pub(crate) fn new(
5321 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5322 ) -> Self {
5323 Self(RequestBuilder::new(stub))
5324 }
5325
5326 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
5328 mut self,
5329 v: V,
5330 ) -> Self {
5331 self.0.request = v.into();
5332 self
5333 }
5334
5335 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5337 self.0.options = v.into();
5338 self
5339 }
5340
5341 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
5343 (*self.0.stub)
5344 .list_locations(self.0.request, self.0.options)
5345 .await
5346 .map(crate::Response::into_body)
5347 }
5348
5349 pub fn by_page(
5351 self,
5352 ) -> impl google_cloud_gax::paginator::Paginator<
5353 google_cloud_location::model::ListLocationsResponse,
5354 crate::Error,
5355 > {
5356 use std::clone::Clone;
5357 let token = self.0.request.page_token.clone();
5358 let execute = move |token: String| {
5359 let mut builder = self.clone();
5360 builder.0.request = builder.0.request.set_page_token(token);
5361 builder.send()
5362 };
5363 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5364 }
5365
5366 pub fn by_item(
5368 self,
5369 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5370 google_cloud_location::model::ListLocationsResponse,
5371 crate::Error,
5372 > {
5373 use google_cloud_gax::paginator::Paginator;
5374 self.by_page().items()
5375 }
5376
5377 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5379 self.0.request.name = v.into();
5380 self
5381 }
5382
5383 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5385 self.0.request.filter = v.into();
5386 self
5387 }
5388
5389 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5391 self.0.request.page_size = v.into();
5392 self
5393 }
5394
5395 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5397 self.0.request.page_token = v.into();
5398 self
5399 }
5400 }
5401
5402 #[doc(hidden)]
5403 impl crate::RequestBuilder for ListLocations {
5404 fn request_options(&mut self) -> &mut crate::RequestOptions {
5405 &mut self.0.options
5406 }
5407 }
5408
5409 #[derive(Clone, Debug)]
5426 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
5427
5428 impl GetLocation {
5429 pub(crate) fn new(
5430 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5431 ) -> Self {
5432 Self(RequestBuilder::new(stub))
5433 }
5434
5435 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
5437 mut self,
5438 v: V,
5439 ) -> Self {
5440 self.0.request = v.into();
5441 self
5442 }
5443
5444 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5446 self.0.options = v.into();
5447 self
5448 }
5449
5450 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
5452 (*self.0.stub)
5453 .get_location(self.0.request, self.0.options)
5454 .await
5455 .map(crate::Response::into_body)
5456 }
5457
5458 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5460 self.0.request.name = v.into();
5461 self
5462 }
5463 }
5464
5465 #[doc(hidden)]
5466 impl crate::RequestBuilder for GetLocation {
5467 fn request_options(&mut self) -> &mut crate::RequestOptions {
5468 &mut self.0.options
5469 }
5470 }
5471
5472 #[derive(Clone, Debug)]
5493 pub struct ListOperations(
5494 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
5495 );
5496
5497 impl ListOperations {
5498 pub(crate) fn new(
5499 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5500 ) -> Self {
5501 Self(RequestBuilder::new(stub))
5502 }
5503
5504 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
5506 mut self,
5507 v: V,
5508 ) -> Self {
5509 self.0.request = v.into();
5510 self
5511 }
5512
5513 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5515 self.0.options = v.into();
5516 self
5517 }
5518
5519 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
5521 (*self.0.stub)
5522 .list_operations(self.0.request, self.0.options)
5523 .await
5524 .map(crate::Response::into_body)
5525 }
5526
5527 pub fn by_page(
5529 self,
5530 ) -> impl google_cloud_gax::paginator::Paginator<
5531 google_cloud_longrunning::model::ListOperationsResponse,
5532 crate::Error,
5533 > {
5534 use std::clone::Clone;
5535 let token = self.0.request.page_token.clone();
5536 let execute = move |token: String| {
5537 let mut builder = self.clone();
5538 builder.0.request = builder.0.request.set_page_token(token);
5539 builder.send()
5540 };
5541 google_cloud_gax::paginator::internal::new_paginator(token, execute)
5542 }
5543
5544 pub fn by_item(
5546 self,
5547 ) -> impl google_cloud_gax::paginator::ItemPaginator<
5548 google_cloud_longrunning::model::ListOperationsResponse,
5549 crate::Error,
5550 > {
5551 use google_cloud_gax::paginator::Paginator;
5552 self.by_page().items()
5553 }
5554
5555 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5557 self.0.request.name = v.into();
5558 self
5559 }
5560
5561 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
5563 self.0.request.filter = v.into();
5564 self
5565 }
5566
5567 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
5569 self.0.request.page_size = v.into();
5570 self
5571 }
5572
5573 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
5575 self.0.request.page_token = v.into();
5576 self
5577 }
5578
5579 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
5581 self.0.request.return_partial_success = v.into();
5582 self
5583 }
5584 }
5585
5586 #[doc(hidden)]
5587 impl crate::RequestBuilder for ListOperations {
5588 fn request_options(&mut self) -> &mut crate::RequestOptions {
5589 &mut self.0.options
5590 }
5591 }
5592
5593 #[derive(Clone, Debug)]
5610 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
5611
5612 impl GetOperation {
5613 pub(crate) fn new(
5614 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5615 ) -> Self {
5616 Self(RequestBuilder::new(stub))
5617 }
5618
5619 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
5621 mut self,
5622 v: V,
5623 ) -> Self {
5624 self.0.request = v.into();
5625 self
5626 }
5627
5628 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5630 self.0.options = v.into();
5631 self
5632 }
5633
5634 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5636 (*self.0.stub)
5637 .get_operation(self.0.request, self.0.options)
5638 .await
5639 .map(crate::Response::into_body)
5640 }
5641
5642 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5644 self.0.request.name = v.into();
5645 self
5646 }
5647 }
5648
5649 #[doc(hidden)]
5650 impl crate::RequestBuilder for GetOperation {
5651 fn request_options(&mut self) -> &mut crate::RequestOptions {
5652 &mut self.0.options
5653 }
5654 }
5655
5656 #[derive(Clone, Debug)]
5673 pub struct CancelOperation(
5674 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
5675 );
5676
5677 impl CancelOperation {
5678 pub(crate) fn new(
5679 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationDatasets>,
5680 ) -> Self {
5681 Self(RequestBuilder::new(stub))
5682 }
5683
5684 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
5686 mut self,
5687 v: V,
5688 ) -> Self {
5689 self.0.request = v.into();
5690 self
5691 }
5692
5693 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5695 self.0.options = v.into();
5696 self
5697 }
5698
5699 pub async fn send(self) -> Result<()> {
5701 (*self.0.stub)
5702 .cancel_operation(self.0.request, self.0.options)
5703 .await
5704 .map(crate::Response::into_body)
5705 }
5706
5707 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5709 self.0.request.name = v.into();
5710 self
5711 }
5712 }
5713
5714 #[doc(hidden)]
5715 impl crate::RequestBuilder for CancelOperation {
5716 fn request_options(&mut self) -> &mut crate::RequestOptions {
5717 &mut self.0.options
5718 }
5719 }
5720}
5721
5722#[cfg(feature = "conversation-models")]
5724#[cfg_attr(docsrs, doc(cfg(feature = "conversation-models")))]
5725pub mod conversation_models {
5726 use crate::Result;
5727
5728 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
5742
5743 pub(crate) mod client {
5744 use super::super::super::client::ConversationModels;
5745 pub struct Factory;
5746 impl crate::ClientFactory for Factory {
5747 type Client = ConversationModels;
5748 type Credentials = gaxi::options::Credentials;
5749 async fn build(
5750 self,
5751 config: gaxi::options::ClientConfig,
5752 ) -> crate::ClientBuilderResult<Self::Client> {
5753 Self::Client::new(config).await
5754 }
5755 }
5756 }
5757
5758 #[derive(Clone, Debug)]
5760 pub(crate) struct RequestBuilder<R: std::default::Default> {
5761 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5762 request: R,
5763 options: crate::RequestOptions,
5764 }
5765
5766 impl<R> RequestBuilder<R>
5767 where
5768 R: std::default::Default,
5769 {
5770 pub(crate) fn new(
5771 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5772 ) -> Self {
5773 Self {
5774 stub,
5775 request: R::default(),
5776 options: crate::RequestOptions::default(),
5777 }
5778 }
5779 }
5780
5781 #[derive(Clone, Debug)]
5799 pub struct CreateConversationModel(
5800 RequestBuilder<crate::model::CreateConversationModelRequest>,
5801 );
5802
5803 impl CreateConversationModel {
5804 pub(crate) fn new(
5805 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5806 ) -> Self {
5807 Self(RequestBuilder::new(stub))
5808 }
5809
5810 pub fn with_request<V: Into<crate::model::CreateConversationModelRequest>>(
5812 mut self,
5813 v: V,
5814 ) -> Self {
5815 self.0.request = v.into();
5816 self
5817 }
5818
5819 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5821 self.0.options = v.into();
5822 self
5823 }
5824
5825 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
5832 (*self.0.stub)
5833 .create_conversation_model(self.0.request, self.0.options)
5834 .await
5835 .map(crate::Response::into_body)
5836 }
5837
5838 pub fn poller(
5840 self,
5841 ) -> impl google_cloud_lro::Poller<
5842 crate::model::ConversationModel,
5843 crate::model::CreateConversationModelOperationMetadata,
5844 > {
5845 type Operation = google_cloud_lro::internal::Operation<
5846 crate::model::ConversationModel,
5847 crate::model::CreateConversationModelOperationMetadata,
5848 >;
5849 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
5850 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
5851 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
5852 if let Some(ref mut details) = poller_options.tracing {
5853 details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::create_conversation_model::until_done";
5854 }
5855
5856 let stub = self.0.stub.clone();
5857 let mut options = self.0.options.clone();
5858 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
5859 let query = move |name| {
5860 let stub = stub.clone();
5861 let options = options.clone();
5862 async {
5863 let op = GetOperation::new(stub)
5864 .set_name(name)
5865 .with_options(options)
5866 .send()
5867 .await?;
5868 Ok(Operation::new(op))
5869 }
5870 };
5871
5872 let start = move || async {
5873 let op = self.send().await?;
5874 Ok(Operation::new(op))
5875 };
5876
5877 use google_cloud_lro::internal::PollerExt;
5878 {
5879 google_cloud_lro::internal::new_poller(
5880 polling_error_policy,
5881 polling_backoff_policy,
5882 start,
5883 query,
5884 )
5885 }
5886 .with_options(poller_options)
5887 }
5888
5889 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
5891 self.0.request.parent = v.into();
5892 self
5893 }
5894
5895 pub fn set_conversation_model<T>(mut self, v: T) -> Self
5899 where
5900 T: std::convert::Into<crate::model::ConversationModel>,
5901 {
5902 self.0.request.conversation_model = std::option::Option::Some(v.into());
5903 self
5904 }
5905
5906 pub fn set_or_clear_conversation_model<T>(mut self, v: std::option::Option<T>) -> Self
5910 where
5911 T: std::convert::Into<crate::model::ConversationModel>,
5912 {
5913 self.0.request.conversation_model = v.map(|x| x.into());
5914 self
5915 }
5916 }
5917
5918 #[doc(hidden)]
5919 impl crate::RequestBuilder for CreateConversationModel {
5920 fn request_options(&mut self) -> &mut crate::RequestOptions {
5921 &mut self.0.options
5922 }
5923 }
5924
5925 #[derive(Clone, Debug)]
5942 pub struct GetConversationModel(RequestBuilder<crate::model::GetConversationModelRequest>);
5943
5944 impl GetConversationModel {
5945 pub(crate) fn new(
5946 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
5947 ) -> Self {
5948 Self(RequestBuilder::new(stub))
5949 }
5950
5951 pub fn with_request<V: Into<crate::model::GetConversationModelRequest>>(
5953 mut self,
5954 v: V,
5955 ) -> Self {
5956 self.0.request = v.into();
5957 self
5958 }
5959
5960 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
5962 self.0.options = v.into();
5963 self
5964 }
5965
5966 pub async fn send(self) -> Result<crate::model::ConversationModel> {
5968 (*self.0.stub)
5969 .get_conversation_model(self.0.request, self.0.options)
5970 .await
5971 .map(crate::Response::into_body)
5972 }
5973
5974 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
5978 self.0.request.name = v.into();
5979 self
5980 }
5981 }
5982
5983 #[doc(hidden)]
5984 impl crate::RequestBuilder for GetConversationModel {
5985 fn request_options(&mut self) -> &mut crate::RequestOptions {
5986 &mut self.0.options
5987 }
5988 }
5989
5990 #[derive(Clone, Debug)]
6011 pub struct ListConversationModels(RequestBuilder<crate::model::ListConversationModelsRequest>);
6012
6013 impl ListConversationModels {
6014 pub(crate) fn new(
6015 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6016 ) -> Self {
6017 Self(RequestBuilder::new(stub))
6018 }
6019
6020 pub fn with_request<V: Into<crate::model::ListConversationModelsRequest>>(
6022 mut self,
6023 v: V,
6024 ) -> Self {
6025 self.0.request = v.into();
6026 self
6027 }
6028
6029 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6031 self.0.options = v.into();
6032 self
6033 }
6034
6035 pub async fn send(self) -> Result<crate::model::ListConversationModelsResponse> {
6037 (*self.0.stub)
6038 .list_conversation_models(self.0.request, self.0.options)
6039 .await
6040 .map(crate::Response::into_body)
6041 }
6042
6043 pub fn by_page(
6045 self,
6046 ) -> impl google_cloud_gax::paginator::Paginator<
6047 crate::model::ListConversationModelsResponse,
6048 crate::Error,
6049 > {
6050 use std::clone::Clone;
6051 let token = self.0.request.page_token.clone();
6052 let execute = move |token: String| {
6053 let mut builder = self.clone();
6054 builder.0.request = builder.0.request.set_page_token(token);
6055 builder.send()
6056 };
6057 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6058 }
6059
6060 pub fn by_item(
6062 self,
6063 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6064 crate::model::ListConversationModelsResponse,
6065 crate::Error,
6066 > {
6067 use google_cloud_gax::paginator::Paginator;
6068 self.by_page().items()
6069 }
6070
6071 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6075 self.0.request.parent = v.into();
6076 self
6077 }
6078
6079 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6081 self.0.request.page_size = v.into();
6082 self
6083 }
6084
6085 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6087 self.0.request.page_token = v.into();
6088 self
6089 }
6090 }
6091
6092 #[doc(hidden)]
6093 impl crate::RequestBuilder for ListConversationModels {
6094 fn request_options(&mut self) -> &mut crate::RequestOptions {
6095 &mut self.0.options
6096 }
6097 }
6098
6099 #[derive(Clone, Debug)]
6117 pub struct DeleteConversationModel(
6118 RequestBuilder<crate::model::DeleteConversationModelRequest>,
6119 );
6120
6121 impl DeleteConversationModel {
6122 pub(crate) fn new(
6123 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6124 ) -> Self {
6125 Self(RequestBuilder::new(stub))
6126 }
6127
6128 pub fn with_request<V: Into<crate::model::DeleteConversationModelRequest>>(
6130 mut self,
6131 v: V,
6132 ) -> Self {
6133 self.0.request = v.into();
6134 self
6135 }
6136
6137 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6139 self.0.options = v.into();
6140 self
6141 }
6142
6143 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6150 (*self.0.stub)
6151 .delete_conversation_model(self.0.request, self.0.options)
6152 .await
6153 .map(crate::Response::into_body)
6154 }
6155
6156 pub fn poller(
6158 self,
6159 ) -> impl google_cloud_lro::Poller<(), crate::model::DeleteConversationModelOperationMetadata>
6160 {
6161 type Operation = google_cloud_lro::internal::Operation<
6162 wkt::Empty,
6163 crate::model::DeleteConversationModelOperationMetadata,
6164 >;
6165 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6166 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6167 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6168 if let Some(ref mut details) = poller_options.tracing {
6169 details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::delete_conversation_model::until_done";
6170 }
6171
6172 let stub = self.0.stub.clone();
6173 let mut options = self.0.options.clone();
6174 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6175 let query = move |name| {
6176 let stub = stub.clone();
6177 let options = options.clone();
6178 async {
6179 let op = GetOperation::new(stub)
6180 .set_name(name)
6181 .with_options(options)
6182 .send()
6183 .await?;
6184 Ok(Operation::new(op))
6185 }
6186 };
6187
6188 let start = move || async {
6189 let op = self.send().await?;
6190 Ok(Operation::new(op))
6191 };
6192
6193 use google_cloud_lro::internal::PollerExt;
6194 {
6195 google_cloud_lro::internal::new_unit_response_poller(
6196 polling_error_policy,
6197 polling_backoff_policy,
6198 start,
6199 query,
6200 )
6201 }
6202 .with_options(poller_options)
6203 }
6204
6205 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6209 self.0.request.name = v.into();
6210 self
6211 }
6212 }
6213
6214 #[doc(hidden)]
6215 impl crate::RequestBuilder for DeleteConversationModel {
6216 fn request_options(&mut self) -> &mut crate::RequestOptions {
6217 &mut self.0.options
6218 }
6219 }
6220
6221 #[derive(Clone, Debug)]
6239 pub struct DeployConversationModel(
6240 RequestBuilder<crate::model::DeployConversationModelRequest>,
6241 );
6242
6243 impl DeployConversationModel {
6244 pub(crate) fn new(
6245 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6246 ) -> Self {
6247 Self(RequestBuilder::new(stub))
6248 }
6249
6250 pub fn with_request<V: Into<crate::model::DeployConversationModelRequest>>(
6252 mut self,
6253 v: V,
6254 ) -> Self {
6255 self.0.request = v.into();
6256 self
6257 }
6258
6259 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6261 self.0.options = v.into();
6262 self
6263 }
6264
6265 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6272 (*self.0.stub)
6273 .deploy_conversation_model(self.0.request, self.0.options)
6274 .await
6275 .map(crate::Response::into_body)
6276 }
6277
6278 pub fn poller(
6280 self,
6281 ) -> impl google_cloud_lro::Poller<(), crate::model::DeployConversationModelOperationMetadata>
6282 {
6283 type Operation = google_cloud_lro::internal::Operation<
6284 wkt::Empty,
6285 crate::model::DeployConversationModelOperationMetadata,
6286 >;
6287 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6288 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6289 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6290 if let Some(ref mut details) = poller_options.tracing {
6291 details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::deploy_conversation_model::until_done";
6292 }
6293
6294 let stub = self.0.stub.clone();
6295 let mut options = self.0.options.clone();
6296 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6297 let query = move |name| {
6298 let stub = stub.clone();
6299 let options = options.clone();
6300 async {
6301 let op = GetOperation::new(stub)
6302 .set_name(name)
6303 .with_options(options)
6304 .send()
6305 .await?;
6306 Ok(Operation::new(op))
6307 }
6308 };
6309
6310 let start = move || async {
6311 let op = self.send().await?;
6312 Ok(Operation::new(op))
6313 };
6314
6315 use google_cloud_lro::internal::PollerExt;
6316 {
6317 google_cloud_lro::internal::new_unit_response_poller(
6318 polling_error_policy,
6319 polling_backoff_policy,
6320 start,
6321 query,
6322 )
6323 }
6324 .with_options(poller_options)
6325 }
6326
6327 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6331 self.0.request.name = v.into();
6332 self
6333 }
6334 }
6335
6336 #[doc(hidden)]
6337 impl crate::RequestBuilder for DeployConversationModel {
6338 fn request_options(&mut self) -> &mut crate::RequestOptions {
6339 &mut self.0.options
6340 }
6341 }
6342
6343 #[derive(Clone, Debug)]
6361 pub struct UndeployConversationModel(
6362 RequestBuilder<crate::model::UndeployConversationModelRequest>,
6363 );
6364
6365 impl UndeployConversationModel {
6366 pub(crate) fn new(
6367 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6368 ) -> Self {
6369 Self(RequestBuilder::new(stub))
6370 }
6371
6372 pub fn with_request<V: Into<crate::model::UndeployConversationModelRequest>>(
6374 mut self,
6375 v: V,
6376 ) -> Self {
6377 self.0.request = v.into();
6378 self
6379 }
6380
6381 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6383 self.0.options = v.into();
6384 self
6385 }
6386
6387 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6394 (*self.0.stub)
6395 .undeploy_conversation_model(self.0.request, self.0.options)
6396 .await
6397 .map(crate::Response::into_body)
6398 }
6399
6400 pub fn poller(
6402 self,
6403 ) -> impl google_cloud_lro::Poller<(), crate::model::UndeployConversationModelOperationMetadata>
6404 {
6405 type Operation = google_cloud_lro::internal::Operation<
6406 wkt::Empty,
6407 crate::model::UndeployConversationModelOperationMetadata,
6408 >;
6409 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6410 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6411 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6412 if let Some(ref mut details) = poller_options.tracing {
6413 details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::undeploy_conversation_model::until_done";
6414 }
6415
6416 let stub = self.0.stub.clone();
6417 let mut options = self.0.options.clone();
6418 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6419 let query = move |name| {
6420 let stub = stub.clone();
6421 let options = options.clone();
6422 async {
6423 let op = GetOperation::new(stub)
6424 .set_name(name)
6425 .with_options(options)
6426 .send()
6427 .await?;
6428 Ok(Operation::new(op))
6429 }
6430 };
6431
6432 let start = move || async {
6433 let op = self.send().await?;
6434 Ok(Operation::new(op))
6435 };
6436
6437 use google_cloud_lro::internal::PollerExt;
6438 {
6439 google_cloud_lro::internal::new_unit_response_poller(
6440 polling_error_policy,
6441 polling_backoff_policy,
6442 start,
6443 query,
6444 )
6445 }
6446 .with_options(poller_options)
6447 }
6448
6449 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6453 self.0.request.name = v.into();
6454 self
6455 }
6456 }
6457
6458 #[doc(hidden)]
6459 impl crate::RequestBuilder for UndeployConversationModel {
6460 fn request_options(&mut self) -> &mut crate::RequestOptions {
6461 &mut self.0.options
6462 }
6463 }
6464
6465 #[derive(Clone, Debug)]
6482 pub struct GetConversationModelEvaluation(
6483 RequestBuilder<crate::model::GetConversationModelEvaluationRequest>,
6484 );
6485
6486 impl GetConversationModelEvaluation {
6487 pub(crate) fn new(
6488 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6489 ) -> Self {
6490 Self(RequestBuilder::new(stub))
6491 }
6492
6493 pub fn with_request<V: Into<crate::model::GetConversationModelEvaluationRequest>>(
6495 mut self,
6496 v: V,
6497 ) -> Self {
6498 self.0.request = v.into();
6499 self
6500 }
6501
6502 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6504 self.0.options = v.into();
6505 self
6506 }
6507
6508 pub async fn send(self) -> Result<crate::model::ConversationModelEvaluation> {
6510 (*self.0.stub)
6511 .get_conversation_model_evaluation(self.0.request, self.0.options)
6512 .await
6513 .map(crate::Response::into_body)
6514 }
6515
6516 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6520 self.0.request.name = v.into();
6521 self
6522 }
6523 }
6524
6525 #[doc(hidden)]
6526 impl crate::RequestBuilder for GetConversationModelEvaluation {
6527 fn request_options(&mut self) -> &mut crate::RequestOptions {
6528 &mut self.0.options
6529 }
6530 }
6531
6532 #[derive(Clone, Debug)]
6553 pub struct ListConversationModelEvaluations(
6554 RequestBuilder<crate::model::ListConversationModelEvaluationsRequest>,
6555 );
6556
6557 impl ListConversationModelEvaluations {
6558 pub(crate) fn new(
6559 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6560 ) -> Self {
6561 Self(RequestBuilder::new(stub))
6562 }
6563
6564 pub fn with_request<V: Into<crate::model::ListConversationModelEvaluationsRequest>>(
6566 mut self,
6567 v: V,
6568 ) -> Self {
6569 self.0.request = v.into();
6570 self
6571 }
6572
6573 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6575 self.0.options = v.into();
6576 self
6577 }
6578
6579 pub async fn send(self) -> Result<crate::model::ListConversationModelEvaluationsResponse> {
6581 (*self.0.stub)
6582 .list_conversation_model_evaluations(self.0.request, self.0.options)
6583 .await
6584 .map(crate::Response::into_body)
6585 }
6586
6587 pub fn by_page(
6589 self,
6590 ) -> impl google_cloud_gax::paginator::Paginator<
6591 crate::model::ListConversationModelEvaluationsResponse,
6592 crate::Error,
6593 > {
6594 use std::clone::Clone;
6595 let token = self.0.request.page_token.clone();
6596 let execute = move |token: String| {
6597 let mut builder = self.clone();
6598 builder.0.request = builder.0.request.set_page_token(token);
6599 builder.send()
6600 };
6601 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6602 }
6603
6604 pub fn by_item(
6606 self,
6607 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6608 crate::model::ListConversationModelEvaluationsResponse,
6609 crate::Error,
6610 > {
6611 use google_cloud_gax::paginator::Paginator;
6612 self.by_page().items()
6613 }
6614
6615 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6619 self.0.request.parent = v.into();
6620 self
6621 }
6622
6623 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6625 self.0.request.page_size = v.into();
6626 self
6627 }
6628
6629 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6631 self.0.request.page_token = v.into();
6632 self
6633 }
6634 }
6635
6636 #[doc(hidden)]
6637 impl crate::RequestBuilder for ListConversationModelEvaluations {
6638 fn request_options(&mut self) -> &mut crate::RequestOptions {
6639 &mut self.0.options
6640 }
6641 }
6642
6643 #[derive(Clone, Debug)]
6661 pub struct CreateConversationModelEvaluation(
6662 RequestBuilder<crate::model::CreateConversationModelEvaluationRequest>,
6663 );
6664
6665 impl CreateConversationModelEvaluation {
6666 pub(crate) fn new(
6667 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6668 ) -> Self {
6669 Self(RequestBuilder::new(stub))
6670 }
6671
6672 pub fn with_request<V: Into<crate::model::CreateConversationModelEvaluationRequest>>(
6674 mut self,
6675 v: V,
6676 ) -> Self {
6677 self.0.request = v.into();
6678 self
6679 }
6680
6681 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6683 self.0.options = v.into();
6684 self
6685 }
6686
6687 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
6694 (*self.0.stub)
6695 .create_conversation_model_evaluation(self.0.request, self.0.options)
6696 .await
6697 .map(crate::Response::into_body)
6698 }
6699
6700 pub fn poller(
6702 self,
6703 ) -> impl google_cloud_lro::Poller<
6704 crate::model::ConversationModelEvaluation,
6705 crate::model::CreateConversationModelEvaluationOperationMetadata,
6706 > {
6707 type Operation = google_cloud_lro::internal::Operation<
6708 crate::model::ConversationModelEvaluation,
6709 crate::model::CreateConversationModelEvaluationOperationMetadata,
6710 >;
6711 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
6712 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
6713 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
6714 if let Some(ref mut details) = poller_options.tracing {
6715 details.method_name = "google_cloud_dialogflow_v2::client::ConversationModels::create_conversation_model_evaluation::until_done";
6716 }
6717
6718 let stub = self.0.stub.clone();
6719 let mut options = self.0.options.clone();
6720 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
6721 let query = move |name| {
6722 let stub = stub.clone();
6723 let options = options.clone();
6724 async {
6725 let op = GetOperation::new(stub)
6726 .set_name(name)
6727 .with_options(options)
6728 .send()
6729 .await?;
6730 Ok(Operation::new(op))
6731 }
6732 };
6733
6734 let start = move || async {
6735 let op = self.send().await?;
6736 Ok(Operation::new(op))
6737 };
6738
6739 use google_cloud_lro::internal::PollerExt;
6740 {
6741 google_cloud_lro::internal::new_poller(
6742 polling_error_policy,
6743 polling_backoff_policy,
6744 start,
6745 query,
6746 )
6747 }
6748 .with_options(poller_options)
6749 }
6750
6751 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
6755 self.0.request.parent = v.into();
6756 self
6757 }
6758
6759 pub fn set_conversation_model_evaluation<T>(mut self, v: T) -> Self
6763 where
6764 T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6765 {
6766 self.0.request.conversation_model_evaluation = std::option::Option::Some(v.into());
6767 self
6768 }
6769
6770 pub fn set_or_clear_conversation_model_evaluation<T>(
6774 mut self,
6775 v: std::option::Option<T>,
6776 ) -> Self
6777 where
6778 T: std::convert::Into<crate::model::ConversationModelEvaluation>,
6779 {
6780 self.0.request.conversation_model_evaluation = v.map(|x| x.into());
6781 self
6782 }
6783 }
6784
6785 #[doc(hidden)]
6786 impl crate::RequestBuilder for CreateConversationModelEvaluation {
6787 fn request_options(&mut self) -> &mut crate::RequestOptions {
6788 &mut self.0.options
6789 }
6790 }
6791
6792 #[derive(Clone, Debug)]
6813 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
6814
6815 impl ListLocations {
6816 pub(crate) fn new(
6817 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6818 ) -> Self {
6819 Self(RequestBuilder::new(stub))
6820 }
6821
6822 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
6824 mut self,
6825 v: V,
6826 ) -> Self {
6827 self.0.request = v.into();
6828 self
6829 }
6830
6831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6833 self.0.options = v.into();
6834 self
6835 }
6836
6837 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
6839 (*self.0.stub)
6840 .list_locations(self.0.request, self.0.options)
6841 .await
6842 .map(crate::Response::into_body)
6843 }
6844
6845 pub fn by_page(
6847 self,
6848 ) -> impl google_cloud_gax::paginator::Paginator<
6849 google_cloud_location::model::ListLocationsResponse,
6850 crate::Error,
6851 > {
6852 use std::clone::Clone;
6853 let token = self.0.request.page_token.clone();
6854 let execute = move |token: String| {
6855 let mut builder = self.clone();
6856 builder.0.request = builder.0.request.set_page_token(token);
6857 builder.send()
6858 };
6859 google_cloud_gax::paginator::internal::new_paginator(token, execute)
6860 }
6861
6862 pub fn by_item(
6864 self,
6865 ) -> impl google_cloud_gax::paginator::ItemPaginator<
6866 google_cloud_location::model::ListLocationsResponse,
6867 crate::Error,
6868 > {
6869 use google_cloud_gax::paginator::Paginator;
6870 self.by_page().items()
6871 }
6872
6873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6875 self.0.request.name = v.into();
6876 self
6877 }
6878
6879 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
6881 self.0.request.filter = v.into();
6882 self
6883 }
6884
6885 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
6887 self.0.request.page_size = v.into();
6888 self
6889 }
6890
6891 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
6893 self.0.request.page_token = v.into();
6894 self
6895 }
6896 }
6897
6898 #[doc(hidden)]
6899 impl crate::RequestBuilder for ListLocations {
6900 fn request_options(&mut self) -> &mut crate::RequestOptions {
6901 &mut self.0.options
6902 }
6903 }
6904
6905 #[derive(Clone, Debug)]
6922 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
6923
6924 impl GetLocation {
6925 pub(crate) fn new(
6926 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6927 ) -> Self {
6928 Self(RequestBuilder::new(stub))
6929 }
6930
6931 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
6933 mut self,
6934 v: V,
6935 ) -> Self {
6936 self.0.request = v.into();
6937 self
6938 }
6939
6940 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
6942 self.0.options = v.into();
6943 self
6944 }
6945
6946 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
6948 (*self.0.stub)
6949 .get_location(self.0.request, self.0.options)
6950 .await
6951 .map(crate::Response::into_body)
6952 }
6953
6954 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
6956 self.0.request.name = v.into();
6957 self
6958 }
6959 }
6960
6961 #[doc(hidden)]
6962 impl crate::RequestBuilder for GetLocation {
6963 fn request_options(&mut self) -> &mut crate::RequestOptions {
6964 &mut self.0.options
6965 }
6966 }
6967
6968 #[derive(Clone, Debug)]
6989 pub struct ListOperations(
6990 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
6991 );
6992
6993 impl ListOperations {
6994 pub(crate) fn new(
6995 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
6996 ) -> Self {
6997 Self(RequestBuilder::new(stub))
6998 }
6999
7000 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
7002 mut self,
7003 v: V,
7004 ) -> Self {
7005 self.0.request = v.into();
7006 self
7007 }
7008
7009 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7011 self.0.options = v.into();
7012 self
7013 }
7014
7015 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
7017 (*self.0.stub)
7018 .list_operations(self.0.request, self.0.options)
7019 .await
7020 .map(crate::Response::into_body)
7021 }
7022
7023 pub fn by_page(
7025 self,
7026 ) -> impl google_cloud_gax::paginator::Paginator<
7027 google_cloud_longrunning::model::ListOperationsResponse,
7028 crate::Error,
7029 > {
7030 use std::clone::Clone;
7031 let token = self.0.request.page_token.clone();
7032 let execute = move |token: String| {
7033 let mut builder = self.clone();
7034 builder.0.request = builder.0.request.set_page_token(token);
7035 builder.send()
7036 };
7037 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7038 }
7039
7040 pub fn by_item(
7042 self,
7043 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7044 google_cloud_longrunning::model::ListOperationsResponse,
7045 crate::Error,
7046 > {
7047 use google_cloud_gax::paginator::Paginator;
7048 self.by_page().items()
7049 }
7050
7051 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7053 self.0.request.name = v.into();
7054 self
7055 }
7056
7057 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
7059 self.0.request.filter = v.into();
7060 self
7061 }
7062
7063 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7065 self.0.request.page_size = v.into();
7066 self
7067 }
7068
7069 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7071 self.0.request.page_token = v.into();
7072 self
7073 }
7074
7075 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
7077 self.0.request.return_partial_success = v.into();
7078 self
7079 }
7080 }
7081
7082 #[doc(hidden)]
7083 impl crate::RequestBuilder for ListOperations {
7084 fn request_options(&mut self) -> &mut crate::RequestOptions {
7085 &mut self.0.options
7086 }
7087 }
7088
7089 #[derive(Clone, Debug)]
7106 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
7107
7108 impl GetOperation {
7109 pub(crate) fn new(
7110 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7111 ) -> Self {
7112 Self(RequestBuilder::new(stub))
7113 }
7114
7115 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
7117 mut self,
7118 v: V,
7119 ) -> Self {
7120 self.0.request = v.into();
7121 self
7122 }
7123
7124 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7126 self.0.options = v.into();
7127 self
7128 }
7129
7130 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7132 (*self.0.stub)
7133 .get_operation(self.0.request, self.0.options)
7134 .await
7135 .map(crate::Response::into_body)
7136 }
7137
7138 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7140 self.0.request.name = v.into();
7141 self
7142 }
7143 }
7144
7145 #[doc(hidden)]
7146 impl crate::RequestBuilder for GetOperation {
7147 fn request_options(&mut self) -> &mut crate::RequestOptions {
7148 &mut self.0.options
7149 }
7150 }
7151
7152 #[derive(Clone, Debug)]
7169 pub struct CancelOperation(
7170 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
7171 );
7172
7173 impl CancelOperation {
7174 pub(crate) fn new(
7175 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationModels>,
7176 ) -> Self {
7177 Self(RequestBuilder::new(stub))
7178 }
7179
7180 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
7182 mut self,
7183 v: V,
7184 ) -> Self {
7185 self.0.request = v.into();
7186 self
7187 }
7188
7189 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7191 self.0.options = v.into();
7192 self
7193 }
7194
7195 pub async fn send(self) -> Result<()> {
7197 (*self.0.stub)
7198 .cancel_operation(self.0.request, self.0.options)
7199 .await
7200 .map(crate::Response::into_body)
7201 }
7202
7203 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7205 self.0.request.name = v.into();
7206 self
7207 }
7208 }
7209
7210 #[doc(hidden)]
7211 impl crate::RequestBuilder for CancelOperation {
7212 fn request_options(&mut self) -> &mut crate::RequestOptions {
7213 &mut self.0.options
7214 }
7215 }
7216}
7217
7218#[cfg(feature = "conversation-profiles")]
7220#[cfg_attr(docsrs, doc(cfg(feature = "conversation-profiles")))]
7221pub mod conversation_profiles {
7222 use crate::Result;
7223
7224 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
7238
7239 pub(crate) mod client {
7240 use super::super::super::client::ConversationProfiles;
7241 pub struct Factory;
7242 impl crate::ClientFactory for Factory {
7243 type Client = ConversationProfiles;
7244 type Credentials = gaxi::options::Credentials;
7245 async fn build(
7246 self,
7247 config: gaxi::options::ClientConfig,
7248 ) -> crate::ClientBuilderResult<Self::Client> {
7249 Self::Client::new(config).await
7250 }
7251 }
7252 }
7253
7254 #[derive(Clone, Debug)]
7256 pub(crate) struct RequestBuilder<R: std::default::Default> {
7257 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7258 request: R,
7259 options: crate::RequestOptions,
7260 }
7261
7262 impl<R> RequestBuilder<R>
7263 where
7264 R: std::default::Default,
7265 {
7266 pub(crate) fn new(
7267 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7268 ) -> Self {
7269 Self {
7270 stub,
7271 request: R::default(),
7272 options: crate::RequestOptions::default(),
7273 }
7274 }
7275 }
7276
7277 #[derive(Clone, Debug)]
7298 pub struct ListConversationProfiles(
7299 RequestBuilder<crate::model::ListConversationProfilesRequest>,
7300 );
7301
7302 impl ListConversationProfiles {
7303 pub(crate) fn new(
7304 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7305 ) -> Self {
7306 Self(RequestBuilder::new(stub))
7307 }
7308
7309 pub fn with_request<V: Into<crate::model::ListConversationProfilesRequest>>(
7311 mut self,
7312 v: V,
7313 ) -> Self {
7314 self.0.request = v.into();
7315 self
7316 }
7317
7318 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7320 self.0.options = v.into();
7321 self
7322 }
7323
7324 pub async fn send(self) -> Result<crate::model::ListConversationProfilesResponse> {
7326 (*self.0.stub)
7327 .list_conversation_profiles(self.0.request, self.0.options)
7328 .await
7329 .map(crate::Response::into_body)
7330 }
7331
7332 pub fn by_page(
7334 self,
7335 ) -> impl google_cloud_gax::paginator::Paginator<
7336 crate::model::ListConversationProfilesResponse,
7337 crate::Error,
7338 > {
7339 use std::clone::Clone;
7340 let token = self.0.request.page_token.clone();
7341 let execute = move |token: String| {
7342 let mut builder = self.clone();
7343 builder.0.request = builder.0.request.set_page_token(token);
7344 builder.send()
7345 };
7346 google_cloud_gax::paginator::internal::new_paginator(token, execute)
7347 }
7348
7349 pub fn by_item(
7351 self,
7352 ) -> impl google_cloud_gax::paginator::ItemPaginator<
7353 crate::model::ListConversationProfilesResponse,
7354 crate::Error,
7355 > {
7356 use google_cloud_gax::paginator::Paginator;
7357 self.by_page().items()
7358 }
7359
7360 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7364 self.0.request.parent = v.into();
7365 self
7366 }
7367
7368 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
7370 self.0.request.page_size = v.into();
7371 self
7372 }
7373
7374 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
7376 self.0.request.page_token = v.into();
7377 self
7378 }
7379 }
7380
7381 #[doc(hidden)]
7382 impl crate::RequestBuilder for ListConversationProfiles {
7383 fn request_options(&mut self) -> &mut crate::RequestOptions {
7384 &mut self.0.options
7385 }
7386 }
7387
7388 #[derive(Clone, Debug)]
7405 pub struct GetConversationProfile(RequestBuilder<crate::model::GetConversationProfileRequest>);
7406
7407 impl GetConversationProfile {
7408 pub(crate) fn new(
7409 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7410 ) -> Self {
7411 Self(RequestBuilder::new(stub))
7412 }
7413
7414 pub fn with_request<V: Into<crate::model::GetConversationProfileRequest>>(
7416 mut self,
7417 v: V,
7418 ) -> Self {
7419 self.0.request = v.into();
7420 self
7421 }
7422
7423 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7425 self.0.options = v.into();
7426 self
7427 }
7428
7429 pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7431 (*self.0.stub)
7432 .get_conversation_profile(self.0.request, self.0.options)
7433 .await
7434 .map(crate::Response::into_body)
7435 }
7436
7437 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7441 self.0.request.name = v.into();
7442 self
7443 }
7444 }
7445
7446 #[doc(hidden)]
7447 impl crate::RequestBuilder for GetConversationProfile {
7448 fn request_options(&mut self) -> &mut crate::RequestOptions {
7449 &mut self.0.options
7450 }
7451 }
7452
7453 #[derive(Clone, Debug)]
7470 pub struct CreateConversationProfile(
7471 RequestBuilder<crate::model::CreateConversationProfileRequest>,
7472 );
7473
7474 impl CreateConversationProfile {
7475 pub(crate) fn new(
7476 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7477 ) -> Self {
7478 Self(RequestBuilder::new(stub))
7479 }
7480
7481 pub fn with_request<V: Into<crate::model::CreateConversationProfileRequest>>(
7483 mut self,
7484 v: V,
7485 ) -> Self {
7486 self.0.request = v.into();
7487 self
7488 }
7489
7490 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7492 self.0.options = v.into();
7493 self
7494 }
7495
7496 pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7498 (*self.0.stub)
7499 .create_conversation_profile(self.0.request, self.0.options)
7500 .await
7501 .map(crate::Response::into_body)
7502 }
7503
7504 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
7508 self.0.request.parent = v.into();
7509 self
7510 }
7511
7512 pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7516 where
7517 T: std::convert::Into<crate::model::ConversationProfile>,
7518 {
7519 self.0.request.conversation_profile = std::option::Option::Some(v.into());
7520 self
7521 }
7522
7523 pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7527 where
7528 T: std::convert::Into<crate::model::ConversationProfile>,
7529 {
7530 self.0.request.conversation_profile = v.map(|x| x.into());
7531 self
7532 }
7533 }
7534
7535 #[doc(hidden)]
7536 impl crate::RequestBuilder for CreateConversationProfile {
7537 fn request_options(&mut self) -> &mut crate::RequestOptions {
7538 &mut self.0.options
7539 }
7540 }
7541
7542 #[derive(Clone, Debug)]
7559 pub struct UpdateConversationProfile(
7560 RequestBuilder<crate::model::UpdateConversationProfileRequest>,
7561 );
7562
7563 impl UpdateConversationProfile {
7564 pub(crate) fn new(
7565 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7566 ) -> Self {
7567 Self(RequestBuilder::new(stub))
7568 }
7569
7570 pub fn with_request<V: Into<crate::model::UpdateConversationProfileRequest>>(
7572 mut self,
7573 v: V,
7574 ) -> Self {
7575 self.0.request = v.into();
7576 self
7577 }
7578
7579 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7581 self.0.options = v.into();
7582 self
7583 }
7584
7585 pub async fn send(self) -> Result<crate::model::ConversationProfile> {
7587 (*self.0.stub)
7588 .update_conversation_profile(self.0.request, self.0.options)
7589 .await
7590 .map(crate::Response::into_body)
7591 }
7592
7593 pub fn set_conversation_profile<T>(mut self, v: T) -> Self
7597 where
7598 T: std::convert::Into<crate::model::ConversationProfile>,
7599 {
7600 self.0.request.conversation_profile = std::option::Option::Some(v.into());
7601 self
7602 }
7603
7604 pub fn set_or_clear_conversation_profile<T>(mut self, v: std::option::Option<T>) -> Self
7608 where
7609 T: std::convert::Into<crate::model::ConversationProfile>,
7610 {
7611 self.0.request.conversation_profile = v.map(|x| x.into());
7612 self
7613 }
7614
7615 pub fn set_update_mask<T>(mut self, v: T) -> Self
7619 where
7620 T: std::convert::Into<wkt::FieldMask>,
7621 {
7622 self.0.request.update_mask = std::option::Option::Some(v.into());
7623 self
7624 }
7625
7626 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
7630 where
7631 T: std::convert::Into<wkt::FieldMask>,
7632 {
7633 self.0.request.update_mask = v.map(|x| x.into());
7634 self
7635 }
7636 }
7637
7638 #[doc(hidden)]
7639 impl crate::RequestBuilder for UpdateConversationProfile {
7640 fn request_options(&mut self) -> &mut crate::RequestOptions {
7641 &mut self.0.options
7642 }
7643 }
7644
7645 #[derive(Clone, Debug)]
7662 pub struct DeleteConversationProfile(
7663 RequestBuilder<crate::model::DeleteConversationProfileRequest>,
7664 );
7665
7666 impl DeleteConversationProfile {
7667 pub(crate) fn new(
7668 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7669 ) -> Self {
7670 Self(RequestBuilder::new(stub))
7671 }
7672
7673 pub fn with_request<V: Into<crate::model::DeleteConversationProfileRequest>>(
7675 mut self,
7676 v: V,
7677 ) -> Self {
7678 self.0.request = v.into();
7679 self
7680 }
7681
7682 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7684 self.0.options = v.into();
7685 self
7686 }
7687
7688 pub async fn send(self) -> Result<()> {
7690 (*self.0.stub)
7691 .delete_conversation_profile(self.0.request, self.0.options)
7692 .await
7693 .map(crate::Response::into_body)
7694 }
7695
7696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
7700 self.0.request.name = v.into();
7701 self
7702 }
7703 }
7704
7705 #[doc(hidden)]
7706 impl crate::RequestBuilder for DeleteConversationProfile {
7707 fn request_options(&mut self) -> &mut crate::RequestOptions {
7708 &mut self.0.options
7709 }
7710 }
7711
7712 #[derive(Clone, Debug)]
7730 pub struct SetSuggestionFeatureConfig(
7731 RequestBuilder<crate::model::SetSuggestionFeatureConfigRequest>,
7732 );
7733
7734 impl SetSuggestionFeatureConfig {
7735 pub(crate) fn new(
7736 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7737 ) -> Self {
7738 Self(RequestBuilder::new(stub))
7739 }
7740
7741 pub fn with_request<V: Into<crate::model::SetSuggestionFeatureConfigRequest>>(
7743 mut self,
7744 v: V,
7745 ) -> Self {
7746 self.0.request = v.into();
7747 self
7748 }
7749
7750 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7752 self.0.options = v.into();
7753 self
7754 }
7755
7756 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7763 (*self.0.stub)
7764 .set_suggestion_feature_config(self.0.request, self.0.options)
7765 .await
7766 .map(crate::Response::into_body)
7767 }
7768
7769 pub fn poller(
7771 self,
7772 ) -> impl google_cloud_lro::Poller<
7773 crate::model::ConversationProfile,
7774 crate::model::SetSuggestionFeatureConfigOperationMetadata,
7775 > {
7776 type Operation = google_cloud_lro::internal::Operation<
7777 crate::model::ConversationProfile,
7778 crate::model::SetSuggestionFeatureConfigOperationMetadata,
7779 >;
7780 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7781 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7782 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7783 if let Some(ref mut details) = poller_options.tracing {
7784 details.method_name = "google_cloud_dialogflow_v2::client::ConversationProfiles::set_suggestion_feature_config::until_done";
7785 }
7786
7787 let stub = self.0.stub.clone();
7788 let mut options = self.0.options.clone();
7789 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7790 let query = move |name| {
7791 let stub = stub.clone();
7792 let options = options.clone();
7793 async {
7794 let op = GetOperation::new(stub)
7795 .set_name(name)
7796 .with_options(options)
7797 .send()
7798 .await?;
7799 Ok(Operation::new(op))
7800 }
7801 };
7802
7803 let start = move || async {
7804 let op = self.send().await?;
7805 Ok(Operation::new(op))
7806 };
7807
7808 use google_cloud_lro::internal::PollerExt;
7809 {
7810 google_cloud_lro::internal::new_poller(
7811 polling_error_policy,
7812 polling_backoff_policy,
7813 start,
7814 query,
7815 )
7816 }
7817 .with_options(poller_options)
7818 }
7819
7820 pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7824 self.0.request.conversation_profile = v.into();
7825 self
7826 }
7827
7828 pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7832 mut self,
7833 v: T,
7834 ) -> Self {
7835 self.0.request.participant_role = v.into();
7836 self
7837 }
7838
7839 pub fn set_suggestion_feature_config<T>(mut self, v: T) -> Self
7843 where
7844 T: std::convert::Into<
7845 crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7846 >,
7847 {
7848 self.0.request.suggestion_feature_config = std::option::Option::Some(v.into());
7849 self
7850 }
7851
7852 pub fn set_or_clear_suggestion_feature_config<T>(
7856 mut self,
7857 v: std::option::Option<T>,
7858 ) -> Self
7859 where
7860 T: std::convert::Into<
7861 crate::model::human_agent_assistant_config::SuggestionFeatureConfig,
7862 >,
7863 {
7864 self.0.request.suggestion_feature_config = v.map(|x| x.into());
7865 self
7866 }
7867 }
7868
7869 #[doc(hidden)]
7870 impl crate::RequestBuilder for SetSuggestionFeatureConfig {
7871 fn request_options(&mut self) -> &mut crate::RequestOptions {
7872 &mut self.0.options
7873 }
7874 }
7875
7876 #[derive(Clone, Debug)]
7894 pub struct ClearSuggestionFeatureConfig(
7895 RequestBuilder<crate::model::ClearSuggestionFeatureConfigRequest>,
7896 );
7897
7898 impl ClearSuggestionFeatureConfig {
7899 pub(crate) fn new(
7900 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
7901 ) -> Self {
7902 Self(RequestBuilder::new(stub))
7903 }
7904
7905 pub fn with_request<V: Into<crate::model::ClearSuggestionFeatureConfigRequest>>(
7907 mut self,
7908 v: V,
7909 ) -> Self {
7910 self.0.request = v.into();
7911 self
7912 }
7913
7914 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
7916 self.0.options = v.into();
7917 self
7918 }
7919
7920 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
7927 (*self.0.stub)
7928 .clear_suggestion_feature_config(self.0.request, self.0.options)
7929 .await
7930 .map(crate::Response::into_body)
7931 }
7932
7933 pub fn poller(
7935 self,
7936 ) -> impl google_cloud_lro::Poller<
7937 crate::model::ConversationProfile,
7938 crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7939 > {
7940 type Operation = google_cloud_lro::internal::Operation<
7941 crate::model::ConversationProfile,
7942 crate::model::ClearSuggestionFeatureConfigOperationMetadata,
7943 >;
7944 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
7945 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
7946 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
7947 if let Some(ref mut details) = poller_options.tracing {
7948 details.method_name = "google_cloud_dialogflow_v2::client::ConversationProfiles::clear_suggestion_feature_config::until_done";
7949 }
7950
7951 let stub = self.0.stub.clone();
7952 let mut options = self.0.options.clone();
7953 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
7954 let query = move |name| {
7955 let stub = stub.clone();
7956 let options = options.clone();
7957 async {
7958 let op = GetOperation::new(stub)
7959 .set_name(name)
7960 .with_options(options)
7961 .send()
7962 .await?;
7963 Ok(Operation::new(op))
7964 }
7965 };
7966
7967 let start = move || async {
7968 let op = self.send().await?;
7969 Ok(Operation::new(op))
7970 };
7971
7972 use google_cloud_lro::internal::PollerExt;
7973 {
7974 google_cloud_lro::internal::new_poller(
7975 polling_error_policy,
7976 polling_backoff_policy,
7977 start,
7978 query,
7979 )
7980 }
7981 .with_options(poller_options)
7982 }
7983
7984 pub fn set_conversation_profile<T: Into<std::string::String>>(mut self, v: T) -> Self {
7988 self.0.request.conversation_profile = v.into();
7989 self
7990 }
7991
7992 pub fn set_participant_role<T: Into<crate::model::participant::Role>>(
7996 mut self,
7997 v: T,
7998 ) -> Self {
7999 self.0.request.participant_role = v.into();
8000 self
8001 }
8002
8003 pub fn set_suggestion_feature_type<T: Into<crate::model::suggestion_feature::Type>>(
8007 mut self,
8008 v: T,
8009 ) -> Self {
8010 self.0.request.suggestion_feature_type = v.into();
8011 self
8012 }
8013 }
8014
8015 #[doc(hidden)]
8016 impl crate::RequestBuilder for ClearSuggestionFeatureConfig {
8017 fn request_options(&mut self) -> &mut crate::RequestOptions {
8018 &mut self.0.options
8019 }
8020 }
8021
8022 #[derive(Clone, Debug)]
8043 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
8044
8045 impl ListLocations {
8046 pub(crate) fn new(
8047 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8048 ) -> Self {
8049 Self(RequestBuilder::new(stub))
8050 }
8051
8052 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
8054 mut self,
8055 v: V,
8056 ) -> Self {
8057 self.0.request = v.into();
8058 self
8059 }
8060
8061 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8063 self.0.options = v.into();
8064 self
8065 }
8066
8067 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
8069 (*self.0.stub)
8070 .list_locations(self.0.request, self.0.options)
8071 .await
8072 .map(crate::Response::into_body)
8073 }
8074
8075 pub fn by_page(
8077 self,
8078 ) -> impl google_cloud_gax::paginator::Paginator<
8079 google_cloud_location::model::ListLocationsResponse,
8080 crate::Error,
8081 > {
8082 use std::clone::Clone;
8083 let token = self.0.request.page_token.clone();
8084 let execute = move |token: String| {
8085 let mut builder = self.clone();
8086 builder.0.request = builder.0.request.set_page_token(token);
8087 builder.send()
8088 };
8089 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8090 }
8091
8092 pub fn by_item(
8094 self,
8095 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8096 google_cloud_location::model::ListLocationsResponse,
8097 crate::Error,
8098 > {
8099 use google_cloud_gax::paginator::Paginator;
8100 self.by_page().items()
8101 }
8102
8103 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8105 self.0.request.name = v.into();
8106 self
8107 }
8108
8109 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8111 self.0.request.filter = v.into();
8112 self
8113 }
8114
8115 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8117 self.0.request.page_size = v.into();
8118 self
8119 }
8120
8121 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8123 self.0.request.page_token = v.into();
8124 self
8125 }
8126 }
8127
8128 #[doc(hidden)]
8129 impl crate::RequestBuilder for ListLocations {
8130 fn request_options(&mut self) -> &mut crate::RequestOptions {
8131 &mut self.0.options
8132 }
8133 }
8134
8135 #[derive(Clone, Debug)]
8152 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
8153
8154 impl GetLocation {
8155 pub(crate) fn new(
8156 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8157 ) -> Self {
8158 Self(RequestBuilder::new(stub))
8159 }
8160
8161 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
8163 mut self,
8164 v: V,
8165 ) -> Self {
8166 self.0.request = v.into();
8167 self
8168 }
8169
8170 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8172 self.0.options = v.into();
8173 self
8174 }
8175
8176 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
8178 (*self.0.stub)
8179 .get_location(self.0.request, self.0.options)
8180 .await
8181 .map(crate::Response::into_body)
8182 }
8183
8184 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8186 self.0.request.name = v.into();
8187 self
8188 }
8189 }
8190
8191 #[doc(hidden)]
8192 impl crate::RequestBuilder for GetLocation {
8193 fn request_options(&mut self) -> &mut crate::RequestOptions {
8194 &mut self.0.options
8195 }
8196 }
8197
8198 #[derive(Clone, Debug)]
8219 pub struct ListOperations(
8220 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
8221 );
8222
8223 impl ListOperations {
8224 pub(crate) fn new(
8225 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8226 ) -> Self {
8227 Self(RequestBuilder::new(stub))
8228 }
8229
8230 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
8232 mut self,
8233 v: V,
8234 ) -> Self {
8235 self.0.request = v.into();
8236 self
8237 }
8238
8239 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8241 self.0.options = v.into();
8242 self
8243 }
8244
8245 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
8247 (*self.0.stub)
8248 .list_operations(self.0.request, self.0.options)
8249 .await
8250 .map(crate::Response::into_body)
8251 }
8252
8253 pub fn by_page(
8255 self,
8256 ) -> impl google_cloud_gax::paginator::Paginator<
8257 google_cloud_longrunning::model::ListOperationsResponse,
8258 crate::Error,
8259 > {
8260 use std::clone::Clone;
8261 let token = self.0.request.page_token.clone();
8262 let execute = move |token: String| {
8263 let mut builder = self.clone();
8264 builder.0.request = builder.0.request.set_page_token(token);
8265 builder.send()
8266 };
8267 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8268 }
8269
8270 pub fn by_item(
8272 self,
8273 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8274 google_cloud_longrunning::model::ListOperationsResponse,
8275 crate::Error,
8276 > {
8277 use google_cloud_gax::paginator::Paginator;
8278 self.by_page().items()
8279 }
8280
8281 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8283 self.0.request.name = v.into();
8284 self
8285 }
8286
8287 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8289 self.0.request.filter = v.into();
8290 self
8291 }
8292
8293 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8295 self.0.request.page_size = v.into();
8296 self
8297 }
8298
8299 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8301 self.0.request.page_token = v.into();
8302 self
8303 }
8304
8305 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
8307 self.0.request.return_partial_success = v.into();
8308 self
8309 }
8310 }
8311
8312 #[doc(hidden)]
8313 impl crate::RequestBuilder for ListOperations {
8314 fn request_options(&mut self) -> &mut crate::RequestOptions {
8315 &mut self.0.options
8316 }
8317 }
8318
8319 #[derive(Clone, Debug)]
8336 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
8337
8338 impl GetOperation {
8339 pub(crate) fn new(
8340 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8341 ) -> Self {
8342 Self(RequestBuilder::new(stub))
8343 }
8344
8345 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
8347 mut self,
8348 v: V,
8349 ) -> Self {
8350 self.0.request = v.into();
8351 self
8352 }
8353
8354 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8356 self.0.options = v.into();
8357 self
8358 }
8359
8360 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8362 (*self.0.stub)
8363 .get_operation(self.0.request, self.0.options)
8364 .await
8365 .map(crate::Response::into_body)
8366 }
8367
8368 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8370 self.0.request.name = v.into();
8371 self
8372 }
8373 }
8374
8375 #[doc(hidden)]
8376 impl crate::RequestBuilder for GetOperation {
8377 fn request_options(&mut self) -> &mut crate::RequestOptions {
8378 &mut self.0.options
8379 }
8380 }
8381
8382 #[derive(Clone, Debug)]
8399 pub struct CancelOperation(
8400 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
8401 );
8402
8403 impl CancelOperation {
8404 pub(crate) fn new(
8405 stub: std::sync::Arc<dyn super::super::stub::dynamic::ConversationProfiles>,
8406 ) -> Self {
8407 Self(RequestBuilder::new(stub))
8408 }
8409
8410 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
8412 mut self,
8413 v: V,
8414 ) -> Self {
8415 self.0.request = v.into();
8416 self
8417 }
8418
8419 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8421 self.0.options = v.into();
8422 self
8423 }
8424
8425 pub async fn send(self) -> Result<()> {
8427 (*self.0.stub)
8428 .cancel_operation(self.0.request, self.0.options)
8429 .await
8430 .map(crate::Response::into_body)
8431 }
8432
8433 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8435 self.0.request.name = v.into();
8436 self
8437 }
8438 }
8439
8440 #[doc(hidden)]
8441 impl crate::RequestBuilder for CancelOperation {
8442 fn request_options(&mut self) -> &mut crate::RequestOptions {
8443 &mut self.0.options
8444 }
8445 }
8446}
8447
8448#[cfg(feature = "documents")]
8450#[cfg_attr(docsrs, doc(cfg(feature = "documents")))]
8451pub mod documents {
8452 use crate::Result;
8453
8454 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
8468
8469 pub(crate) mod client {
8470 use super::super::super::client::Documents;
8471 pub struct Factory;
8472 impl crate::ClientFactory for Factory {
8473 type Client = Documents;
8474 type Credentials = gaxi::options::Credentials;
8475 async fn build(
8476 self,
8477 config: gaxi::options::ClientConfig,
8478 ) -> crate::ClientBuilderResult<Self::Client> {
8479 Self::Client::new(config).await
8480 }
8481 }
8482 }
8483
8484 #[derive(Clone, Debug)]
8486 pub(crate) struct RequestBuilder<R: std::default::Default> {
8487 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8488 request: R,
8489 options: crate::RequestOptions,
8490 }
8491
8492 impl<R> RequestBuilder<R>
8493 where
8494 R: std::default::Default,
8495 {
8496 pub(crate) fn new(
8497 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8498 ) -> Self {
8499 Self {
8500 stub,
8501 request: R::default(),
8502 options: crate::RequestOptions::default(),
8503 }
8504 }
8505 }
8506
8507 #[derive(Clone, Debug)]
8528 pub struct ListDocuments(RequestBuilder<crate::model::ListDocumentsRequest>);
8529
8530 impl ListDocuments {
8531 pub(crate) fn new(
8532 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8533 ) -> Self {
8534 Self(RequestBuilder::new(stub))
8535 }
8536
8537 pub fn with_request<V: Into<crate::model::ListDocumentsRequest>>(mut self, v: V) -> Self {
8539 self.0.request = v.into();
8540 self
8541 }
8542
8543 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8545 self.0.options = v.into();
8546 self
8547 }
8548
8549 pub async fn send(self) -> Result<crate::model::ListDocumentsResponse> {
8551 (*self.0.stub)
8552 .list_documents(self.0.request, self.0.options)
8553 .await
8554 .map(crate::Response::into_body)
8555 }
8556
8557 pub fn by_page(
8559 self,
8560 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListDocumentsResponse, crate::Error>
8561 {
8562 use std::clone::Clone;
8563 let token = self.0.request.page_token.clone();
8564 let execute = move |token: String| {
8565 let mut builder = self.clone();
8566 builder.0.request = builder.0.request.set_page_token(token);
8567 builder.send()
8568 };
8569 google_cloud_gax::paginator::internal::new_paginator(token, execute)
8570 }
8571
8572 pub fn by_item(
8574 self,
8575 ) -> impl google_cloud_gax::paginator::ItemPaginator<
8576 crate::model::ListDocumentsResponse,
8577 crate::Error,
8578 > {
8579 use google_cloud_gax::paginator::Paginator;
8580 self.by_page().items()
8581 }
8582
8583 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8587 self.0.request.parent = v.into();
8588 self
8589 }
8590
8591 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
8593 self.0.request.page_size = v.into();
8594 self
8595 }
8596
8597 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
8599 self.0.request.page_token = v.into();
8600 self
8601 }
8602
8603 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
8605 self.0.request.filter = v.into();
8606 self
8607 }
8608 }
8609
8610 #[doc(hidden)]
8611 impl crate::RequestBuilder for ListDocuments {
8612 fn request_options(&mut self) -> &mut crate::RequestOptions {
8613 &mut self.0.options
8614 }
8615 }
8616
8617 #[derive(Clone, Debug)]
8634 pub struct GetDocument(RequestBuilder<crate::model::GetDocumentRequest>);
8635
8636 impl GetDocument {
8637 pub(crate) fn new(
8638 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8639 ) -> Self {
8640 Self(RequestBuilder::new(stub))
8641 }
8642
8643 pub fn with_request<V: Into<crate::model::GetDocumentRequest>>(mut self, v: V) -> Self {
8645 self.0.request = v.into();
8646 self
8647 }
8648
8649 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8651 self.0.options = v.into();
8652 self
8653 }
8654
8655 pub async fn send(self) -> Result<crate::model::Document> {
8657 (*self.0.stub)
8658 .get_document(self.0.request, self.0.options)
8659 .await
8660 .map(crate::Response::into_body)
8661 }
8662
8663 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
8667 self.0.request.name = v.into();
8668 self
8669 }
8670 }
8671
8672 #[doc(hidden)]
8673 impl crate::RequestBuilder for GetDocument {
8674 fn request_options(&mut self) -> &mut crate::RequestOptions {
8675 &mut self.0.options
8676 }
8677 }
8678
8679 #[derive(Clone, Debug)]
8697 pub struct CreateDocument(RequestBuilder<crate::model::CreateDocumentRequest>);
8698
8699 impl CreateDocument {
8700 pub(crate) fn new(
8701 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8702 ) -> Self {
8703 Self(RequestBuilder::new(stub))
8704 }
8705
8706 pub fn with_request<V: Into<crate::model::CreateDocumentRequest>>(mut self, v: V) -> Self {
8708 self.0.request = v.into();
8709 self
8710 }
8711
8712 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8714 self.0.options = v.into();
8715 self
8716 }
8717
8718 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8725 (*self.0.stub)
8726 .create_document(self.0.request, self.0.options)
8727 .await
8728 .map(crate::Response::into_body)
8729 }
8730
8731 pub fn poller(
8733 self,
8734 ) -> impl google_cloud_lro::Poller<
8735 crate::model::Document,
8736 crate::model::KnowledgeOperationMetadata,
8737 > {
8738 type Operation = google_cloud_lro::internal::Operation<
8739 crate::model::Document,
8740 crate::model::KnowledgeOperationMetadata,
8741 >;
8742 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8743 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8744 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8745 if let Some(ref mut details) = poller_options.tracing {
8746 details.method_name =
8747 "google_cloud_dialogflow_v2::client::Documents::create_document::until_done";
8748 }
8749
8750 let stub = self.0.stub.clone();
8751 let mut options = self.0.options.clone();
8752 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8753 let query = move |name| {
8754 let stub = stub.clone();
8755 let options = options.clone();
8756 async {
8757 let op = GetOperation::new(stub)
8758 .set_name(name)
8759 .with_options(options)
8760 .send()
8761 .await?;
8762 Ok(Operation::new(op))
8763 }
8764 };
8765
8766 let start = move || async {
8767 let op = self.send().await?;
8768 Ok(Operation::new(op))
8769 };
8770
8771 use google_cloud_lro::internal::PollerExt;
8772 {
8773 google_cloud_lro::internal::new_poller(
8774 polling_error_policy,
8775 polling_backoff_policy,
8776 start,
8777 query,
8778 )
8779 }
8780 .with_options(poller_options)
8781 }
8782
8783 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8787 self.0.request.parent = v.into();
8788 self
8789 }
8790
8791 pub fn set_document<T>(mut self, v: T) -> Self
8795 where
8796 T: std::convert::Into<crate::model::Document>,
8797 {
8798 self.0.request.document = std::option::Option::Some(v.into());
8799 self
8800 }
8801
8802 pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
8806 where
8807 T: std::convert::Into<crate::model::Document>,
8808 {
8809 self.0.request.document = v.map(|x| x.into());
8810 self
8811 }
8812 }
8813
8814 #[doc(hidden)]
8815 impl crate::RequestBuilder for CreateDocument {
8816 fn request_options(&mut self) -> &mut crate::RequestOptions {
8817 &mut self.0.options
8818 }
8819 }
8820
8821 #[derive(Clone, Debug)]
8839 pub struct ImportDocuments(RequestBuilder<crate::model::ImportDocumentsRequest>);
8840
8841 impl ImportDocuments {
8842 pub(crate) fn new(
8843 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
8844 ) -> Self {
8845 Self(RequestBuilder::new(stub))
8846 }
8847
8848 pub fn with_request<V: Into<crate::model::ImportDocumentsRequest>>(mut self, v: V) -> Self {
8850 self.0.request = v.into();
8851 self
8852 }
8853
8854 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
8856 self.0.options = v.into();
8857 self
8858 }
8859
8860 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
8867 (*self.0.stub)
8868 .import_documents(self.0.request, self.0.options)
8869 .await
8870 .map(crate::Response::into_body)
8871 }
8872
8873 pub fn poller(
8875 self,
8876 ) -> impl google_cloud_lro::Poller<
8877 crate::model::ImportDocumentsResponse,
8878 crate::model::KnowledgeOperationMetadata,
8879 > {
8880 type Operation = google_cloud_lro::internal::Operation<
8881 crate::model::ImportDocumentsResponse,
8882 crate::model::KnowledgeOperationMetadata,
8883 >;
8884 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
8885 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
8886 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
8887 if let Some(ref mut details) = poller_options.tracing {
8888 details.method_name =
8889 "google_cloud_dialogflow_v2::client::Documents::import_documents::until_done";
8890 }
8891
8892 let stub = self.0.stub.clone();
8893 let mut options = self.0.options.clone();
8894 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
8895 let query = move |name| {
8896 let stub = stub.clone();
8897 let options = options.clone();
8898 async {
8899 let op = GetOperation::new(stub)
8900 .set_name(name)
8901 .with_options(options)
8902 .send()
8903 .await?;
8904 Ok(Operation::new(op))
8905 }
8906 };
8907
8908 let start = move || async {
8909 let op = self.send().await?;
8910 Ok(Operation::new(op))
8911 };
8912
8913 use google_cloud_lro::internal::PollerExt;
8914 {
8915 google_cloud_lro::internal::new_poller(
8916 polling_error_policy,
8917 polling_backoff_policy,
8918 start,
8919 query,
8920 )
8921 }
8922 .with_options(poller_options)
8923 }
8924
8925 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
8929 self.0.request.parent = v.into();
8930 self
8931 }
8932
8933 pub fn set_document_template<T>(mut self, v: T) -> Self
8937 where
8938 T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8939 {
8940 self.0.request.document_template = std::option::Option::Some(v.into());
8941 self
8942 }
8943
8944 pub fn set_or_clear_document_template<T>(mut self, v: std::option::Option<T>) -> Self
8948 where
8949 T: std::convert::Into<crate::model::ImportDocumentTemplate>,
8950 {
8951 self.0.request.document_template = v.map(|x| x.into());
8952 self
8953 }
8954
8955 pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
8957 self.0.request.import_gcs_custom_metadata = v.into();
8958 self
8959 }
8960
8961 pub fn set_source<T: Into<Option<crate::model::import_documents_request::Source>>>(
8966 mut self,
8967 v: T,
8968 ) -> Self {
8969 self.0.request.source = v.into();
8970 self
8971 }
8972
8973 pub fn set_gcs_source<T: std::convert::Into<std::boxed::Box<crate::model::GcsSources>>>(
8979 mut self,
8980 v: T,
8981 ) -> Self {
8982 self.0.request = self.0.request.set_gcs_source(v);
8983 self
8984 }
8985 }
8986
8987 #[doc(hidden)]
8988 impl crate::RequestBuilder for ImportDocuments {
8989 fn request_options(&mut self) -> &mut crate::RequestOptions {
8990 &mut self.0.options
8991 }
8992 }
8993
8994 #[derive(Clone, Debug)]
9012 pub struct DeleteDocument(RequestBuilder<crate::model::DeleteDocumentRequest>);
9013
9014 impl DeleteDocument {
9015 pub(crate) fn new(
9016 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9017 ) -> Self {
9018 Self(RequestBuilder::new(stub))
9019 }
9020
9021 pub fn with_request<V: Into<crate::model::DeleteDocumentRequest>>(mut self, v: V) -> Self {
9023 self.0.request = v.into();
9024 self
9025 }
9026
9027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9029 self.0.options = v.into();
9030 self
9031 }
9032
9033 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9040 (*self.0.stub)
9041 .delete_document(self.0.request, self.0.options)
9042 .await
9043 .map(crate::Response::into_body)
9044 }
9045
9046 pub fn poller(
9048 self,
9049 ) -> impl google_cloud_lro::Poller<(), crate::model::KnowledgeOperationMetadata> {
9050 type Operation = google_cloud_lro::internal::Operation<
9051 wkt::Empty,
9052 crate::model::KnowledgeOperationMetadata,
9053 >;
9054 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9055 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9056 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9057 if let Some(ref mut details) = poller_options.tracing {
9058 details.method_name =
9059 "google_cloud_dialogflow_v2::client::Documents::delete_document::until_done";
9060 }
9061
9062 let stub = self.0.stub.clone();
9063 let mut options = self.0.options.clone();
9064 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9065 let query = move |name| {
9066 let stub = stub.clone();
9067 let options = options.clone();
9068 async {
9069 let op = GetOperation::new(stub)
9070 .set_name(name)
9071 .with_options(options)
9072 .send()
9073 .await?;
9074 Ok(Operation::new(op))
9075 }
9076 };
9077
9078 let start = move || async {
9079 let op = self.send().await?;
9080 Ok(Operation::new(op))
9081 };
9082
9083 use google_cloud_lro::internal::PollerExt;
9084 {
9085 google_cloud_lro::internal::new_unit_response_poller(
9086 polling_error_policy,
9087 polling_backoff_policy,
9088 start,
9089 query,
9090 )
9091 }
9092 .with_options(poller_options)
9093 }
9094
9095 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9099 self.0.request.name = v.into();
9100 self
9101 }
9102 }
9103
9104 #[doc(hidden)]
9105 impl crate::RequestBuilder for DeleteDocument {
9106 fn request_options(&mut self) -> &mut crate::RequestOptions {
9107 &mut self.0.options
9108 }
9109 }
9110
9111 #[derive(Clone, Debug)]
9129 pub struct UpdateDocument(RequestBuilder<crate::model::UpdateDocumentRequest>);
9130
9131 impl UpdateDocument {
9132 pub(crate) fn new(
9133 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9134 ) -> Self {
9135 Self(RequestBuilder::new(stub))
9136 }
9137
9138 pub fn with_request<V: Into<crate::model::UpdateDocumentRequest>>(mut self, v: V) -> Self {
9140 self.0.request = v.into();
9141 self
9142 }
9143
9144 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9146 self.0.options = v.into();
9147 self
9148 }
9149
9150 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9157 (*self.0.stub)
9158 .update_document(self.0.request, self.0.options)
9159 .await
9160 .map(crate::Response::into_body)
9161 }
9162
9163 pub fn poller(
9165 self,
9166 ) -> impl google_cloud_lro::Poller<
9167 crate::model::Document,
9168 crate::model::KnowledgeOperationMetadata,
9169 > {
9170 type Operation = google_cloud_lro::internal::Operation<
9171 crate::model::Document,
9172 crate::model::KnowledgeOperationMetadata,
9173 >;
9174 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9175 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9176 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9177 if let Some(ref mut details) = poller_options.tracing {
9178 details.method_name =
9179 "google_cloud_dialogflow_v2::client::Documents::update_document::until_done";
9180 }
9181
9182 let stub = self.0.stub.clone();
9183 let mut options = self.0.options.clone();
9184 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9185 let query = move |name| {
9186 let stub = stub.clone();
9187 let options = options.clone();
9188 async {
9189 let op = GetOperation::new(stub)
9190 .set_name(name)
9191 .with_options(options)
9192 .send()
9193 .await?;
9194 Ok(Operation::new(op))
9195 }
9196 };
9197
9198 let start = move || async {
9199 let op = self.send().await?;
9200 Ok(Operation::new(op))
9201 };
9202
9203 use google_cloud_lro::internal::PollerExt;
9204 {
9205 google_cloud_lro::internal::new_poller(
9206 polling_error_policy,
9207 polling_backoff_policy,
9208 start,
9209 query,
9210 )
9211 }
9212 .with_options(poller_options)
9213 }
9214
9215 pub fn set_document<T>(mut self, v: T) -> Self
9219 where
9220 T: std::convert::Into<crate::model::Document>,
9221 {
9222 self.0.request.document = std::option::Option::Some(v.into());
9223 self
9224 }
9225
9226 pub fn set_or_clear_document<T>(mut self, v: std::option::Option<T>) -> Self
9230 where
9231 T: std::convert::Into<crate::model::Document>,
9232 {
9233 self.0.request.document = v.map(|x| x.into());
9234 self
9235 }
9236
9237 pub fn set_update_mask<T>(mut self, v: T) -> Self
9239 where
9240 T: std::convert::Into<wkt::FieldMask>,
9241 {
9242 self.0.request.update_mask = std::option::Option::Some(v.into());
9243 self
9244 }
9245
9246 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
9248 where
9249 T: std::convert::Into<wkt::FieldMask>,
9250 {
9251 self.0.request.update_mask = v.map(|x| x.into());
9252 self
9253 }
9254 }
9255
9256 #[doc(hidden)]
9257 impl crate::RequestBuilder for UpdateDocument {
9258 fn request_options(&mut self) -> &mut crate::RequestOptions {
9259 &mut self.0.options
9260 }
9261 }
9262
9263 #[derive(Clone, Debug)]
9281 pub struct ReloadDocument(RequestBuilder<crate::model::ReloadDocumentRequest>);
9282
9283 impl ReloadDocument {
9284 pub(crate) fn new(
9285 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9286 ) -> Self {
9287 Self(RequestBuilder::new(stub))
9288 }
9289
9290 pub fn with_request<V: Into<crate::model::ReloadDocumentRequest>>(mut self, v: V) -> Self {
9292 self.0.request = v.into();
9293 self
9294 }
9295
9296 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9298 self.0.options = v.into();
9299 self
9300 }
9301
9302 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9309 (*self.0.stub)
9310 .reload_document(self.0.request, self.0.options)
9311 .await
9312 .map(crate::Response::into_body)
9313 }
9314
9315 pub fn poller(
9317 self,
9318 ) -> impl google_cloud_lro::Poller<
9319 crate::model::Document,
9320 crate::model::KnowledgeOperationMetadata,
9321 > {
9322 type Operation = google_cloud_lro::internal::Operation<
9323 crate::model::Document,
9324 crate::model::KnowledgeOperationMetadata,
9325 >;
9326 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9327 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9328 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9329 if let Some(ref mut details) = poller_options.tracing {
9330 details.method_name =
9331 "google_cloud_dialogflow_v2::client::Documents::reload_document::until_done";
9332 }
9333
9334 let stub = self.0.stub.clone();
9335 let mut options = self.0.options.clone();
9336 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9337 let query = move |name| {
9338 let stub = stub.clone();
9339 let options = options.clone();
9340 async {
9341 let op = GetOperation::new(stub)
9342 .set_name(name)
9343 .with_options(options)
9344 .send()
9345 .await?;
9346 Ok(Operation::new(op))
9347 }
9348 };
9349
9350 let start = move || async {
9351 let op = self.send().await?;
9352 Ok(Operation::new(op))
9353 };
9354
9355 use google_cloud_lro::internal::PollerExt;
9356 {
9357 google_cloud_lro::internal::new_poller(
9358 polling_error_policy,
9359 polling_backoff_policy,
9360 start,
9361 query,
9362 )
9363 }
9364 .with_options(poller_options)
9365 }
9366
9367 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9371 self.0.request.name = v.into();
9372 self
9373 }
9374
9375 pub fn set_import_gcs_custom_metadata<T: Into<bool>>(mut self, v: T) -> Self {
9377 self.0.request.import_gcs_custom_metadata = v.into();
9378 self
9379 }
9380
9381 pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9383 self.0.request.smart_messaging_partial_update = v.into();
9384 self
9385 }
9386
9387 pub fn set_source<T: Into<Option<crate::model::reload_document_request::Source>>>(
9392 mut self,
9393 v: T,
9394 ) -> Self {
9395 self.0.request.source = v.into();
9396 self
9397 }
9398
9399 pub fn set_content_uri<T: std::convert::Into<std::string::String>>(mut self, v: T) -> Self {
9405 self.0.request = self.0.request.set_content_uri(v);
9406 self
9407 }
9408 }
9409
9410 #[doc(hidden)]
9411 impl crate::RequestBuilder for ReloadDocument {
9412 fn request_options(&mut self) -> &mut crate::RequestOptions {
9413 &mut self.0.options
9414 }
9415 }
9416
9417 #[derive(Clone, Debug)]
9435 pub struct ExportDocument(RequestBuilder<crate::model::ExportDocumentRequest>);
9436
9437 impl ExportDocument {
9438 pub(crate) fn new(
9439 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9440 ) -> Self {
9441 Self(RequestBuilder::new(stub))
9442 }
9443
9444 pub fn with_request<V: Into<crate::model::ExportDocumentRequest>>(mut self, v: V) -> Self {
9446 self.0.request = v.into();
9447 self
9448 }
9449
9450 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9452 self.0.options = v.into();
9453 self
9454 }
9455
9456 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9463 (*self.0.stub)
9464 .export_document(self.0.request, self.0.options)
9465 .await
9466 .map(crate::Response::into_body)
9467 }
9468
9469 pub fn poller(
9471 self,
9472 ) -> impl google_cloud_lro::Poller<
9473 crate::model::Document,
9474 crate::model::KnowledgeOperationMetadata,
9475 > {
9476 type Operation = google_cloud_lro::internal::Operation<
9477 crate::model::Document,
9478 crate::model::KnowledgeOperationMetadata,
9479 >;
9480 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
9481 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
9482 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
9483 if let Some(ref mut details) = poller_options.tracing {
9484 details.method_name =
9485 "google_cloud_dialogflow_v2::client::Documents::export_document::until_done";
9486 }
9487
9488 let stub = self.0.stub.clone();
9489 let mut options = self.0.options.clone();
9490 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
9491 let query = move |name| {
9492 let stub = stub.clone();
9493 let options = options.clone();
9494 async {
9495 let op = GetOperation::new(stub)
9496 .set_name(name)
9497 .with_options(options)
9498 .send()
9499 .await?;
9500 Ok(Operation::new(op))
9501 }
9502 };
9503
9504 let start = move || async {
9505 let op = self.send().await?;
9506 Ok(Operation::new(op))
9507 };
9508
9509 use google_cloud_lro::internal::PollerExt;
9510 {
9511 google_cloud_lro::internal::new_poller(
9512 polling_error_policy,
9513 polling_backoff_policy,
9514 start,
9515 query,
9516 )
9517 }
9518 .with_options(poller_options)
9519 }
9520
9521 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9525 self.0.request.name = v.into();
9526 self
9527 }
9528
9529 pub fn set_export_full_content<T: Into<bool>>(mut self, v: T) -> Self {
9531 self.0.request.export_full_content = v.into();
9532 self
9533 }
9534
9535 pub fn set_smart_messaging_partial_update<T: Into<bool>>(mut self, v: T) -> Self {
9537 self.0.request.smart_messaging_partial_update = v.into();
9538 self
9539 }
9540
9541 pub fn set_destination<
9546 T: Into<Option<crate::model::export_document_request::Destination>>,
9547 >(
9548 mut self,
9549 v: T,
9550 ) -> Self {
9551 self.0.request.destination = v.into();
9552 self
9553 }
9554
9555 pub fn set_gcs_destination<
9561 T: std::convert::Into<std::boxed::Box<crate::model::GcsDestination>>,
9562 >(
9563 mut self,
9564 v: T,
9565 ) -> Self {
9566 self.0.request = self.0.request.set_gcs_destination(v);
9567 self
9568 }
9569 }
9570
9571 #[doc(hidden)]
9572 impl crate::RequestBuilder for ExportDocument {
9573 fn request_options(&mut self) -> &mut crate::RequestOptions {
9574 &mut self.0.options
9575 }
9576 }
9577
9578 #[derive(Clone, Debug)]
9599 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
9600
9601 impl ListLocations {
9602 pub(crate) fn new(
9603 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9604 ) -> Self {
9605 Self(RequestBuilder::new(stub))
9606 }
9607
9608 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
9610 mut self,
9611 v: V,
9612 ) -> Self {
9613 self.0.request = v.into();
9614 self
9615 }
9616
9617 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9619 self.0.options = v.into();
9620 self
9621 }
9622
9623 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
9625 (*self.0.stub)
9626 .list_locations(self.0.request, self.0.options)
9627 .await
9628 .map(crate::Response::into_body)
9629 }
9630
9631 pub fn by_page(
9633 self,
9634 ) -> impl google_cloud_gax::paginator::Paginator<
9635 google_cloud_location::model::ListLocationsResponse,
9636 crate::Error,
9637 > {
9638 use std::clone::Clone;
9639 let token = self.0.request.page_token.clone();
9640 let execute = move |token: String| {
9641 let mut builder = self.clone();
9642 builder.0.request = builder.0.request.set_page_token(token);
9643 builder.send()
9644 };
9645 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9646 }
9647
9648 pub fn by_item(
9650 self,
9651 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9652 google_cloud_location::model::ListLocationsResponse,
9653 crate::Error,
9654 > {
9655 use google_cloud_gax::paginator::Paginator;
9656 self.by_page().items()
9657 }
9658
9659 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9661 self.0.request.name = v.into();
9662 self
9663 }
9664
9665 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9667 self.0.request.filter = v.into();
9668 self
9669 }
9670
9671 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9673 self.0.request.page_size = v.into();
9674 self
9675 }
9676
9677 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9679 self.0.request.page_token = v.into();
9680 self
9681 }
9682 }
9683
9684 #[doc(hidden)]
9685 impl crate::RequestBuilder for ListLocations {
9686 fn request_options(&mut self) -> &mut crate::RequestOptions {
9687 &mut self.0.options
9688 }
9689 }
9690
9691 #[derive(Clone, Debug)]
9708 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
9709
9710 impl GetLocation {
9711 pub(crate) fn new(
9712 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9713 ) -> Self {
9714 Self(RequestBuilder::new(stub))
9715 }
9716
9717 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
9719 mut self,
9720 v: V,
9721 ) -> Self {
9722 self.0.request = v.into();
9723 self
9724 }
9725
9726 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9728 self.0.options = v.into();
9729 self
9730 }
9731
9732 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
9734 (*self.0.stub)
9735 .get_location(self.0.request, self.0.options)
9736 .await
9737 .map(crate::Response::into_body)
9738 }
9739
9740 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9742 self.0.request.name = v.into();
9743 self
9744 }
9745 }
9746
9747 #[doc(hidden)]
9748 impl crate::RequestBuilder for GetLocation {
9749 fn request_options(&mut self) -> &mut crate::RequestOptions {
9750 &mut self.0.options
9751 }
9752 }
9753
9754 #[derive(Clone, Debug)]
9775 pub struct ListOperations(
9776 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
9777 );
9778
9779 impl ListOperations {
9780 pub(crate) fn new(
9781 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9782 ) -> Self {
9783 Self(RequestBuilder::new(stub))
9784 }
9785
9786 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
9788 mut self,
9789 v: V,
9790 ) -> Self {
9791 self.0.request = v.into();
9792 self
9793 }
9794
9795 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9797 self.0.options = v.into();
9798 self
9799 }
9800
9801 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
9803 (*self.0.stub)
9804 .list_operations(self.0.request, self.0.options)
9805 .await
9806 .map(crate::Response::into_body)
9807 }
9808
9809 pub fn by_page(
9811 self,
9812 ) -> impl google_cloud_gax::paginator::Paginator<
9813 google_cloud_longrunning::model::ListOperationsResponse,
9814 crate::Error,
9815 > {
9816 use std::clone::Clone;
9817 let token = self.0.request.page_token.clone();
9818 let execute = move |token: String| {
9819 let mut builder = self.clone();
9820 builder.0.request = builder.0.request.set_page_token(token);
9821 builder.send()
9822 };
9823 google_cloud_gax::paginator::internal::new_paginator(token, execute)
9824 }
9825
9826 pub fn by_item(
9828 self,
9829 ) -> impl google_cloud_gax::paginator::ItemPaginator<
9830 google_cloud_longrunning::model::ListOperationsResponse,
9831 crate::Error,
9832 > {
9833 use google_cloud_gax::paginator::Paginator;
9834 self.by_page().items()
9835 }
9836
9837 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9839 self.0.request.name = v.into();
9840 self
9841 }
9842
9843 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
9845 self.0.request.filter = v.into();
9846 self
9847 }
9848
9849 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
9851 self.0.request.page_size = v.into();
9852 self
9853 }
9854
9855 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
9857 self.0.request.page_token = v.into();
9858 self
9859 }
9860
9861 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
9863 self.0.request.return_partial_success = v.into();
9864 self
9865 }
9866 }
9867
9868 #[doc(hidden)]
9869 impl crate::RequestBuilder for ListOperations {
9870 fn request_options(&mut self) -> &mut crate::RequestOptions {
9871 &mut self.0.options
9872 }
9873 }
9874
9875 #[derive(Clone, Debug)]
9892 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
9893
9894 impl GetOperation {
9895 pub(crate) fn new(
9896 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9897 ) -> Self {
9898 Self(RequestBuilder::new(stub))
9899 }
9900
9901 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
9903 mut self,
9904 v: V,
9905 ) -> Self {
9906 self.0.request = v.into();
9907 self
9908 }
9909
9910 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9912 self.0.options = v.into();
9913 self
9914 }
9915
9916 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
9918 (*self.0.stub)
9919 .get_operation(self.0.request, self.0.options)
9920 .await
9921 .map(crate::Response::into_body)
9922 }
9923
9924 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9926 self.0.request.name = v.into();
9927 self
9928 }
9929 }
9930
9931 #[doc(hidden)]
9932 impl crate::RequestBuilder for GetOperation {
9933 fn request_options(&mut self) -> &mut crate::RequestOptions {
9934 &mut self.0.options
9935 }
9936 }
9937
9938 #[derive(Clone, Debug)]
9955 pub struct CancelOperation(
9956 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
9957 );
9958
9959 impl CancelOperation {
9960 pub(crate) fn new(
9961 stub: std::sync::Arc<dyn super::super::stub::dynamic::Documents>,
9962 ) -> Self {
9963 Self(RequestBuilder::new(stub))
9964 }
9965
9966 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
9968 mut self,
9969 v: V,
9970 ) -> Self {
9971 self.0.request = v.into();
9972 self
9973 }
9974
9975 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
9977 self.0.options = v.into();
9978 self
9979 }
9980
9981 pub async fn send(self) -> Result<()> {
9983 (*self.0.stub)
9984 .cancel_operation(self.0.request, self.0.options)
9985 .await
9986 .map(crate::Response::into_body)
9987 }
9988
9989 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
9991 self.0.request.name = v.into();
9992 self
9993 }
9994 }
9995
9996 #[doc(hidden)]
9997 impl crate::RequestBuilder for CancelOperation {
9998 fn request_options(&mut self) -> &mut crate::RequestOptions {
9999 &mut self.0.options
10000 }
10001 }
10002}
10003
10004#[cfg(feature = "encryption-spec-service")]
10006#[cfg_attr(docsrs, doc(cfg(feature = "encryption-spec-service")))]
10007pub mod encryption_spec_service {
10008 use crate::Result;
10009
10010 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10024
10025 pub(crate) mod client {
10026 use super::super::super::client::EncryptionSpecService;
10027 pub struct Factory;
10028 impl crate::ClientFactory for Factory {
10029 type Client = EncryptionSpecService;
10030 type Credentials = gaxi::options::Credentials;
10031 async fn build(
10032 self,
10033 config: gaxi::options::ClientConfig,
10034 ) -> crate::ClientBuilderResult<Self::Client> {
10035 Self::Client::new(config).await
10036 }
10037 }
10038 }
10039
10040 #[derive(Clone, Debug)]
10042 pub(crate) struct RequestBuilder<R: std::default::Default> {
10043 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10044 request: R,
10045 options: crate::RequestOptions,
10046 }
10047
10048 impl<R> RequestBuilder<R>
10049 where
10050 R: std::default::Default,
10051 {
10052 pub(crate) fn new(
10053 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10054 ) -> Self {
10055 Self {
10056 stub,
10057 request: R::default(),
10058 options: crate::RequestOptions::default(),
10059 }
10060 }
10061 }
10062
10063 #[derive(Clone, Debug)]
10080 pub struct GetEncryptionSpec(RequestBuilder<crate::model::GetEncryptionSpecRequest>);
10081
10082 impl GetEncryptionSpec {
10083 pub(crate) fn new(
10084 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10085 ) -> Self {
10086 Self(RequestBuilder::new(stub))
10087 }
10088
10089 pub fn with_request<V: Into<crate::model::GetEncryptionSpecRequest>>(
10091 mut self,
10092 v: V,
10093 ) -> Self {
10094 self.0.request = v.into();
10095 self
10096 }
10097
10098 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10100 self.0.options = v.into();
10101 self
10102 }
10103
10104 pub async fn send(self) -> Result<crate::model::EncryptionSpec> {
10106 (*self.0.stub)
10107 .get_encryption_spec(self.0.request, self.0.options)
10108 .await
10109 .map(crate::Response::into_body)
10110 }
10111
10112 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10116 self.0.request.name = v.into();
10117 self
10118 }
10119 }
10120
10121 #[doc(hidden)]
10122 impl crate::RequestBuilder for GetEncryptionSpec {
10123 fn request_options(&mut self) -> &mut crate::RequestOptions {
10124 &mut self.0.options
10125 }
10126 }
10127
10128 #[derive(Clone, Debug)]
10146 pub struct InitializeEncryptionSpec(
10147 RequestBuilder<crate::model::InitializeEncryptionSpecRequest>,
10148 );
10149
10150 impl InitializeEncryptionSpec {
10151 pub(crate) fn new(
10152 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10153 ) -> Self {
10154 Self(RequestBuilder::new(stub))
10155 }
10156
10157 pub fn with_request<V: Into<crate::model::InitializeEncryptionSpecRequest>>(
10159 mut self,
10160 v: V,
10161 ) -> Self {
10162 self.0.request = v.into();
10163 self
10164 }
10165
10166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10168 self.0.options = v.into();
10169 self
10170 }
10171
10172 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10179 (*self.0.stub)
10180 .initialize_encryption_spec(self.0.request, self.0.options)
10181 .await
10182 .map(crate::Response::into_body)
10183 }
10184
10185 pub fn poller(
10187 self,
10188 ) -> impl google_cloud_lro::Poller<
10189 crate::model::InitializeEncryptionSpecResponse,
10190 crate::model::InitializeEncryptionSpecMetadata,
10191 > {
10192 type Operation = google_cloud_lro::internal::Operation<
10193 crate::model::InitializeEncryptionSpecResponse,
10194 crate::model::InitializeEncryptionSpecMetadata,
10195 >;
10196 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
10197 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
10198 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
10199 if let Some(ref mut details) = poller_options.tracing {
10200 details.method_name = "google_cloud_dialogflow_v2::client::EncryptionSpecService::initialize_encryption_spec::until_done";
10201 }
10202
10203 let stub = self.0.stub.clone();
10204 let mut options = self.0.options.clone();
10205 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
10206 let query = move |name| {
10207 let stub = stub.clone();
10208 let options = options.clone();
10209 async {
10210 let op = GetOperation::new(stub)
10211 .set_name(name)
10212 .with_options(options)
10213 .send()
10214 .await?;
10215 Ok(Operation::new(op))
10216 }
10217 };
10218
10219 let start = move || async {
10220 let op = self.send().await?;
10221 Ok(Operation::new(op))
10222 };
10223
10224 use google_cloud_lro::internal::PollerExt;
10225 {
10226 google_cloud_lro::internal::new_poller(
10227 polling_error_policy,
10228 polling_backoff_policy,
10229 start,
10230 query,
10231 )
10232 }
10233 .with_options(poller_options)
10234 }
10235
10236 pub fn set_encryption_spec<T>(mut self, v: T) -> Self
10240 where
10241 T: std::convert::Into<crate::model::EncryptionSpec>,
10242 {
10243 self.0.request.encryption_spec = std::option::Option::Some(v.into());
10244 self
10245 }
10246
10247 pub fn set_or_clear_encryption_spec<T>(mut self, v: std::option::Option<T>) -> Self
10251 where
10252 T: std::convert::Into<crate::model::EncryptionSpec>,
10253 {
10254 self.0.request.encryption_spec = v.map(|x| x.into());
10255 self
10256 }
10257 }
10258
10259 #[doc(hidden)]
10260 impl crate::RequestBuilder for InitializeEncryptionSpec {
10261 fn request_options(&mut self) -> &mut crate::RequestOptions {
10262 &mut self.0.options
10263 }
10264 }
10265
10266 #[derive(Clone, Debug)]
10287 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
10288
10289 impl ListLocations {
10290 pub(crate) fn new(
10291 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10292 ) -> Self {
10293 Self(RequestBuilder::new(stub))
10294 }
10295
10296 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
10298 mut self,
10299 v: V,
10300 ) -> Self {
10301 self.0.request = v.into();
10302 self
10303 }
10304
10305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10307 self.0.options = v.into();
10308 self
10309 }
10310
10311 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
10313 (*self.0.stub)
10314 .list_locations(self.0.request, self.0.options)
10315 .await
10316 .map(crate::Response::into_body)
10317 }
10318
10319 pub fn by_page(
10321 self,
10322 ) -> impl google_cloud_gax::paginator::Paginator<
10323 google_cloud_location::model::ListLocationsResponse,
10324 crate::Error,
10325 > {
10326 use std::clone::Clone;
10327 let token = self.0.request.page_token.clone();
10328 let execute = move |token: String| {
10329 let mut builder = self.clone();
10330 builder.0.request = builder.0.request.set_page_token(token);
10331 builder.send()
10332 };
10333 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10334 }
10335
10336 pub fn by_item(
10338 self,
10339 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10340 google_cloud_location::model::ListLocationsResponse,
10341 crate::Error,
10342 > {
10343 use google_cloud_gax::paginator::Paginator;
10344 self.by_page().items()
10345 }
10346
10347 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10349 self.0.request.name = v.into();
10350 self
10351 }
10352
10353 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10355 self.0.request.filter = v.into();
10356 self
10357 }
10358
10359 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10361 self.0.request.page_size = v.into();
10362 self
10363 }
10364
10365 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10367 self.0.request.page_token = v.into();
10368 self
10369 }
10370 }
10371
10372 #[doc(hidden)]
10373 impl crate::RequestBuilder for ListLocations {
10374 fn request_options(&mut self) -> &mut crate::RequestOptions {
10375 &mut self.0.options
10376 }
10377 }
10378
10379 #[derive(Clone, Debug)]
10396 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
10397
10398 impl GetLocation {
10399 pub(crate) fn new(
10400 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10401 ) -> Self {
10402 Self(RequestBuilder::new(stub))
10403 }
10404
10405 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
10407 mut self,
10408 v: V,
10409 ) -> Self {
10410 self.0.request = v.into();
10411 self
10412 }
10413
10414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10416 self.0.options = v.into();
10417 self
10418 }
10419
10420 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
10422 (*self.0.stub)
10423 .get_location(self.0.request, self.0.options)
10424 .await
10425 .map(crate::Response::into_body)
10426 }
10427
10428 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10430 self.0.request.name = v.into();
10431 self
10432 }
10433 }
10434
10435 #[doc(hidden)]
10436 impl crate::RequestBuilder for GetLocation {
10437 fn request_options(&mut self) -> &mut crate::RequestOptions {
10438 &mut self.0.options
10439 }
10440 }
10441
10442 #[derive(Clone, Debug)]
10463 pub struct ListOperations(
10464 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
10465 );
10466
10467 impl ListOperations {
10468 pub(crate) fn new(
10469 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10470 ) -> Self {
10471 Self(RequestBuilder::new(stub))
10472 }
10473
10474 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
10476 mut self,
10477 v: V,
10478 ) -> Self {
10479 self.0.request = v.into();
10480 self
10481 }
10482
10483 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10485 self.0.options = v.into();
10486 self
10487 }
10488
10489 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
10491 (*self.0.stub)
10492 .list_operations(self.0.request, self.0.options)
10493 .await
10494 .map(crate::Response::into_body)
10495 }
10496
10497 pub fn by_page(
10499 self,
10500 ) -> impl google_cloud_gax::paginator::Paginator<
10501 google_cloud_longrunning::model::ListOperationsResponse,
10502 crate::Error,
10503 > {
10504 use std::clone::Clone;
10505 let token = self.0.request.page_token.clone();
10506 let execute = move |token: String| {
10507 let mut builder = self.clone();
10508 builder.0.request = builder.0.request.set_page_token(token);
10509 builder.send()
10510 };
10511 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10512 }
10513
10514 pub fn by_item(
10516 self,
10517 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10518 google_cloud_longrunning::model::ListOperationsResponse,
10519 crate::Error,
10520 > {
10521 use google_cloud_gax::paginator::Paginator;
10522 self.by_page().items()
10523 }
10524
10525 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10527 self.0.request.name = v.into();
10528 self
10529 }
10530
10531 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
10533 self.0.request.filter = v.into();
10534 self
10535 }
10536
10537 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10539 self.0.request.page_size = v.into();
10540 self
10541 }
10542
10543 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10545 self.0.request.page_token = v.into();
10546 self
10547 }
10548
10549 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
10551 self.0.request.return_partial_success = v.into();
10552 self
10553 }
10554 }
10555
10556 #[doc(hidden)]
10557 impl crate::RequestBuilder for ListOperations {
10558 fn request_options(&mut self) -> &mut crate::RequestOptions {
10559 &mut self.0.options
10560 }
10561 }
10562
10563 #[derive(Clone, Debug)]
10580 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
10581
10582 impl GetOperation {
10583 pub(crate) fn new(
10584 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10585 ) -> Self {
10586 Self(RequestBuilder::new(stub))
10587 }
10588
10589 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
10591 mut self,
10592 v: V,
10593 ) -> Self {
10594 self.0.request = v.into();
10595 self
10596 }
10597
10598 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10600 self.0.options = v.into();
10601 self
10602 }
10603
10604 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
10606 (*self.0.stub)
10607 .get_operation(self.0.request, self.0.options)
10608 .await
10609 .map(crate::Response::into_body)
10610 }
10611
10612 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10614 self.0.request.name = v.into();
10615 self
10616 }
10617 }
10618
10619 #[doc(hidden)]
10620 impl crate::RequestBuilder for GetOperation {
10621 fn request_options(&mut self) -> &mut crate::RequestOptions {
10622 &mut self.0.options
10623 }
10624 }
10625
10626 #[derive(Clone, Debug)]
10643 pub struct CancelOperation(
10644 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
10645 );
10646
10647 impl CancelOperation {
10648 pub(crate) fn new(
10649 stub: std::sync::Arc<dyn super::super::stub::dynamic::EncryptionSpecService>,
10650 ) -> Self {
10651 Self(RequestBuilder::new(stub))
10652 }
10653
10654 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
10656 mut self,
10657 v: V,
10658 ) -> Self {
10659 self.0.request = v.into();
10660 self
10661 }
10662
10663 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10665 self.0.options = v.into();
10666 self
10667 }
10668
10669 pub async fn send(self) -> Result<()> {
10671 (*self.0.stub)
10672 .cancel_operation(self.0.request, self.0.options)
10673 .await
10674 .map(crate::Response::into_body)
10675 }
10676
10677 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10679 self.0.request.name = v.into();
10680 self
10681 }
10682 }
10683
10684 #[doc(hidden)]
10685 impl crate::RequestBuilder for CancelOperation {
10686 fn request_options(&mut self) -> &mut crate::RequestOptions {
10687 &mut self.0.options
10688 }
10689 }
10690}
10691
10692#[cfg(feature = "entity-types")]
10694#[cfg_attr(docsrs, doc(cfg(feature = "entity-types")))]
10695pub mod entity_types {
10696 use crate::Result;
10697
10698 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
10712
10713 pub(crate) mod client {
10714 use super::super::super::client::EntityTypes;
10715 pub struct Factory;
10716 impl crate::ClientFactory for Factory {
10717 type Client = EntityTypes;
10718 type Credentials = gaxi::options::Credentials;
10719 async fn build(
10720 self,
10721 config: gaxi::options::ClientConfig,
10722 ) -> crate::ClientBuilderResult<Self::Client> {
10723 Self::Client::new(config).await
10724 }
10725 }
10726 }
10727
10728 #[derive(Clone, Debug)]
10730 pub(crate) struct RequestBuilder<R: std::default::Default> {
10731 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10732 request: R,
10733 options: crate::RequestOptions,
10734 }
10735
10736 impl<R> RequestBuilder<R>
10737 where
10738 R: std::default::Default,
10739 {
10740 pub(crate) fn new(
10741 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10742 ) -> Self {
10743 Self {
10744 stub,
10745 request: R::default(),
10746 options: crate::RequestOptions::default(),
10747 }
10748 }
10749 }
10750
10751 #[derive(Clone, Debug)]
10772 pub struct ListEntityTypes(RequestBuilder<crate::model::ListEntityTypesRequest>);
10773
10774 impl ListEntityTypes {
10775 pub(crate) fn new(
10776 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10777 ) -> Self {
10778 Self(RequestBuilder::new(stub))
10779 }
10780
10781 pub fn with_request<V: Into<crate::model::ListEntityTypesRequest>>(mut self, v: V) -> Self {
10783 self.0.request = v.into();
10784 self
10785 }
10786
10787 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10789 self.0.options = v.into();
10790 self
10791 }
10792
10793 pub async fn send(self) -> Result<crate::model::ListEntityTypesResponse> {
10795 (*self.0.stub)
10796 .list_entity_types(self.0.request, self.0.options)
10797 .await
10798 .map(crate::Response::into_body)
10799 }
10800
10801 pub fn by_page(
10803 self,
10804 ) -> impl google_cloud_gax::paginator::Paginator<
10805 crate::model::ListEntityTypesResponse,
10806 crate::Error,
10807 > {
10808 use std::clone::Clone;
10809 let token = self.0.request.page_token.clone();
10810 let execute = move |token: String| {
10811 let mut builder = self.clone();
10812 builder.0.request = builder.0.request.set_page_token(token);
10813 builder.send()
10814 };
10815 google_cloud_gax::paginator::internal::new_paginator(token, execute)
10816 }
10817
10818 pub fn by_item(
10820 self,
10821 ) -> impl google_cloud_gax::paginator::ItemPaginator<
10822 crate::model::ListEntityTypesResponse,
10823 crate::Error,
10824 > {
10825 use google_cloud_gax::paginator::Paginator;
10826 self.by_page().items()
10827 }
10828
10829 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10833 self.0.request.parent = v.into();
10834 self
10835 }
10836
10837 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10839 self.0.request.language_code = v.into();
10840 self
10841 }
10842
10843 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
10845 self.0.request.page_size = v.into();
10846 self
10847 }
10848
10849 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
10851 self.0.request.page_token = v.into();
10852 self
10853 }
10854 }
10855
10856 #[doc(hidden)]
10857 impl crate::RequestBuilder for ListEntityTypes {
10858 fn request_options(&mut self) -> &mut crate::RequestOptions {
10859 &mut self.0.options
10860 }
10861 }
10862
10863 #[derive(Clone, Debug)]
10880 pub struct GetEntityType(RequestBuilder<crate::model::GetEntityTypeRequest>);
10881
10882 impl GetEntityType {
10883 pub(crate) fn new(
10884 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10885 ) -> Self {
10886 Self(RequestBuilder::new(stub))
10887 }
10888
10889 pub fn with_request<V: Into<crate::model::GetEntityTypeRequest>>(mut self, v: V) -> Self {
10891 self.0.request = v.into();
10892 self
10893 }
10894
10895 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10897 self.0.options = v.into();
10898 self
10899 }
10900
10901 pub async fn send(self) -> Result<crate::model::EntityType> {
10903 (*self.0.stub)
10904 .get_entity_type(self.0.request, self.0.options)
10905 .await
10906 .map(crate::Response::into_body)
10907 }
10908
10909 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
10913 self.0.request.name = v.into();
10914 self
10915 }
10916
10917 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
10919 self.0.request.language_code = v.into();
10920 self
10921 }
10922 }
10923
10924 #[doc(hidden)]
10925 impl crate::RequestBuilder for GetEntityType {
10926 fn request_options(&mut self) -> &mut crate::RequestOptions {
10927 &mut self.0.options
10928 }
10929 }
10930
10931 #[derive(Clone, Debug)]
10948 pub struct CreateEntityType(RequestBuilder<crate::model::CreateEntityTypeRequest>);
10949
10950 impl CreateEntityType {
10951 pub(crate) fn new(
10952 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
10953 ) -> Self {
10954 Self(RequestBuilder::new(stub))
10955 }
10956
10957 pub fn with_request<V: Into<crate::model::CreateEntityTypeRequest>>(
10959 mut self,
10960 v: V,
10961 ) -> Self {
10962 self.0.request = v.into();
10963 self
10964 }
10965
10966 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
10968 self.0.options = v.into();
10969 self
10970 }
10971
10972 pub async fn send(self) -> Result<crate::model::EntityType> {
10974 (*self.0.stub)
10975 .create_entity_type(self.0.request, self.0.options)
10976 .await
10977 .map(crate::Response::into_body)
10978 }
10979
10980 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
10984 self.0.request.parent = v.into();
10985 self
10986 }
10987
10988 pub fn set_entity_type<T>(mut self, v: T) -> Self
10992 where
10993 T: std::convert::Into<crate::model::EntityType>,
10994 {
10995 self.0.request.entity_type = std::option::Option::Some(v.into());
10996 self
10997 }
10998
10999 pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
11003 where
11004 T: std::convert::Into<crate::model::EntityType>,
11005 {
11006 self.0.request.entity_type = v.map(|x| x.into());
11007 self
11008 }
11009
11010 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11012 self.0.request.language_code = v.into();
11013 self
11014 }
11015 }
11016
11017 #[doc(hidden)]
11018 impl crate::RequestBuilder for CreateEntityType {
11019 fn request_options(&mut self) -> &mut crate::RequestOptions {
11020 &mut self.0.options
11021 }
11022 }
11023
11024 #[derive(Clone, Debug)]
11041 pub struct UpdateEntityType(RequestBuilder<crate::model::UpdateEntityTypeRequest>);
11042
11043 impl UpdateEntityType {
11044 pub(crate) fn new(
11045 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11046 ) -> Self {
11047 Self(RequestBuilder::new(stub))
11048 }
11049
11050 pub fn with_request<V: Into<crate::model::UpdateEntityTypeRequest>>(
11052 mut self,
11053 v: V,
11054 ) -> Self {
11055 self.0.request = v.into();
11056 self
11057 }
11058
11059 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11061 self.0.options = v.into();
11062 self
11063 }
11064
11065 pub async fn send(self) -> Result<crate::model::EntityType> {
11067 (*self.0.stub)
11068 .update_entity_type(self.0.request, self.0.options)
11069 .await
11070 .map(crate::Response::into_body)
11071 }
11072
11073 pub fn set_entity_type<T>(mut self, v: T) -> Self
11077 where
11078 T: std::convert::Into<crate::model::EntityType>,
11079 {
11080 self.0.request.entity_type = std::option::Option::Some(v.into());
11081 self
11082 }
11083
11084 pub fn set_or_clear_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
11088 where
11089 T: std::convert::Into<crate::model::EntityType>,
11090 {
11091 self.0.request.entity_type = v.map(|x| x.into());
11092 self
11093 }
11094
11095 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11097 self.0.request.language_code = v.into();
11098 self
11099 }
11100
11101 pub fn set_update_mask<T>(mut self, v: T) -> Self
11103 where
11104 T: std::convert::Into<wkt::FieldMask>,
11105 {
11106 self.0.request.update_mask = std::option::Option::Some(v.into());
11107 self
11108 }
11109
11110 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11112 where
11113 T: std::convert::Into<wkt::FieldMask>,
11114 {
11115 self.0.request.update_mask = v.map(|x| x.into());
11116 self
11117 }
11118 }
11119
11120 #[doc(hidden)]
11121 impl crate::RequestBuilder for UpdateEntityType {
11122 fn request_options(&mut self) -> &mut crate::RequestOptions {
11123 &mut self.0.options
11124 }
11125 }
11126
11127 #[derive(Clone, Debug)]
11144 pub struct DeleteEntityType(RequestBuilder<crate::model::DeleteEntityTypeRequest>);
11145
11146 impl DeleteEntityType {
11147 pub(crate) fn new(
11148 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11149 ) -> Self {
11150 Self(RequestBuilder::new(stub))
11151 }
11152
11153 pub fn with_request<V: Into<crate::model::DeleteEntityTypeRequest>>(
11155 mut self,
11156 v: V,
11157 ) -> Self {
11158 self.0.request = v.into();
11159 self
11160 }
11161
11162 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11164 self.0.options = v.into();
11165 self
11166 }
11167
11168 pub async fn send(self) -> Result<()> {
11170 (*self.0.stub)
11171 .delete_entity_type(self.0.request, self.0.options)
11172 .await
11173 .map(crate::Response::into_body)
11174 }
11175
11176 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
11180 self.0.request.name = v.into();
11181 self
11182 }
11183 }
11184
11185 #[doc(hidden)]
11186 impl crate::RequestBuilder for DeleteEntityType {
11187 fn request_options(&mut self) -> &mut crate::RequestOptions {
11188 &mut self.0.options
11189 }
11190 }
11191
11192 #[derive(Clone, Debug)]
11210 pub struct BatchUpdateEntityTypes(RequestBuilder<crate::model::BatchUpdateEntityTypesRequest>);
11211
11212 impl BatchUpdateEntityTypes {
11213 pub(crate) fn new(
11214 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11215 ) -> Self {
11216 Self(RequestBuilder::new(stub))
11217 }
11218
11219 pub fn with_request<V: Into<crate::model::BatchUpdateEntityTypesRequest>>(
11221 mut self,
11222 v: V,
11223 ) -> Self {
11224 self.0.request = v.into();
11225 self
11226 }
11227
11228 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11230 self.0.options = v.into();
11231 self
11232 }
11233
11234 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11241 (*self.0.stub)
11242 .batch_update_entity_types(self.0.request, self.0.options)
11243 .await
11244 .map(crate::Response::into_body)
11245 }
11246
11247 pub fn poller(
11249 self,
11250 ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateEntityTypesResponse, wkt::Struct>
11251 {
11252 type Operation = google_cloud_lro::internal::Operation<
11253 crate::model::BatchUpdateEntityTypesResponse,
11254 wkt::Struct,
11255 >;
11256 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11257 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11258 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11259 if let Some(ref mut details) = poller_options.tracing {
11260 details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_update_entity_types::until_done";
11261 }
11262
11263 let stub = self.0.stub.clone();
11264 let mut options = self.0.options.clone();
11265 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11266 let query = move |name| {
11267 let stub = stub.clone();
11268 let options = options.clone();
11269 async {
11270 let op = GetOperation::new(stub)
11271 .set_name(name)
11272 .with_options(options)
11273 .send()
11274 .await?;
11275 Ok(Operation::new(op))
11276 }
11277 };
11278
11279 let start = move || async {
11280 let op = self.send().await?;
11281 Ok(Operation::new(op))
11282 };
11283
11284 use google_cloud_lro::internal::PollerExt;
11285 {
11286 google_cloud_lro::internal::new_poller(
11287 polling_error_policy,
11288 polling_backoff_policy,
11289 start,
11290 query,
11291 )
11292 }
11293 .with_options(poller_options)
11294 }
11295
11296 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11300 self.0.request.parent = v.into();
11301 self
11302 }
11303
11304 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11306 self.0.request.language_code = v.into();
11307 self
11308 }
11309
11310 pub fn set_update_mask<T>(mut self, v: T) -> Self
11312 where
11313 T: std::convert::Into<wkt::FieldMask>,
11314 {
11315 self.0.request.update_mask = std::option::Option::Some(v.into());
11316 self
11317 }
11318
11319 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11321 where
11322 T: std::convert::Into<wkt::FieldMask>,
11323 {
11324 self.0.request.update_mask = v.map(|x| x.into());
11325 self
11326 }
11327
11328 pub fn set_entity_type_batch<
11333 T: Into<Option<crate::model::batch_update_entity_types_request::EntityTypeBatch>>,
11334 >(
11335 mut self,
11336 v: T,
11337 ) -> Self {
11338 self.0.request.entity_type_batch = v.into();
11339 self
11340 }
11341
11342 pub fn set_entity_type_batch_uri<T: std::convert::Into<std::string::String>>(
11348 mut self,
11349 v: T,
11350 ) -> Self {
11351 self.0.request = self.0.request.set_entity_type_batch_uri(v);
11352 self
11353 }
11354
11355 pub fn set_entity_type_batch_inline<
11361 T: std::convert::Into<std::boxed::Box<crate::model::EntityTypeBatch>>,
11362 >(
11363 mut self,
11364 v: T,
11365 ) -> Self {
11366 self.0.request = self.0.request.set_entity_type_batch_inline(v);
11367 self
11368 }
11369 }
11370
11371 #[doc(hidden)]
11372 impl crate::RequestBuilder for BatchUpdateEntityTypes {
11373 fn request_options(&mut self) -> &mut crate::RequestOptions {
11374 &mut self.0.options
11375 }
11376 }
11377
11378 #[derive(Clone, Debug)]
11396 pub struct BatchDeleteEntityTypes(RequestBuilder<crate::model::BatchDeleteEntityTypesRequest>);
11397
11398 impl BatchDeleteEntityTypes {
11399 pub(crate) fn new(
11400 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11401 ) -> Self {
11402 Self(RequestBuilder::new(stub))
11403 }
11404
11405 pub fn with_request<V: Into<crate::model::BatchDeleteEntityTypesRequest>>(
11407 mut self,
11408 v: V,
11409 ) -> Self {
11410 self.0.request = v.into();
11411 self
11412 }
11413
11414 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11416 self.0.options = v.into();
11417 self
11418 }
11419
11420 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11427 (*self.0.stub)
11428 .batch_delete_entity_types(self.0.request, self.0.options)
11429 .await
11430 .map(crate::Response::into_body)
11431 }
11432
11433 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11435 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11436 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11437 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11438 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11439 if let Some(ref mut details) = poller_options.tracing {
11440 details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_delete_entity_types::until_done";
11441 }
11442
11443 let stub = self.0.stub.clone();
11444 let mut options = self.0.options.clone();
11445 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11446 let query = move |name| {
11447 let stub = stub.clone();
11448 let options = options.clone();
11449 async {
11450 let op = GetOperation::new(stub)
11451 .set_name(name)
11452 .with_options(options)
11453 .send()
11454 .await?;
11455 Ok(Operation::new(op))
11456 }
11457 };
11458
11459 let start = move || async {
11460 let op = self.send().await?;
11461 Ok(Operation::new(op))
11462 };
11463
11464 use google_cloud_lro::internal::PollerExt;
11465 {
11466 google_cloud_lro::internal::new_unit_response_poller(
11467 polling_error_policy,
11468 polling_backoff_policy,
11469 start,
11470 query,
11471 )
11472 }
11473 .with_options(poller_options)
11474 }
11475
11476 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11480 self.0.request.parent = v.into();
11481 self
11482 }
11483
11484 pub fn set_entity_type_names<T, V>(mut self, v: T) -> Self
11488 where
11489 T: std::iter::IntoIterator<Item = V>,
11490 V: std::convert::Into<std::string::String>,
11491 {
11492 use std::iter::Iterator;
11493 self.0.request.entity_type_names = v.into_iter().map(|i| i.into()).collect();
11494 self
11495 }
11496 }
11497
11498 #[doc(hidden)]
11499 impl crate::RequestBuilder for BatchDeleteEntityTypes {
11500 fn request_options(&mut self) -> &mut crate::RequestOptions {
11501 &mut self.0.options
11502 }
11503 }
11504
11505 #[derive(Clone, Debug)]
11523 pub struct BatchCreateEntities(RequestBuilder<crate::model::BatchCreateEntitiesRequest>);
11524
11525 impl BatchCreateEntities {
11526 pub(crate) fn new(
11527 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11528 ) -> Self {
11529 Self(RequestBuilder::new(stub))
11530 }
11531
11532 pub fn with_request<V: Into<crate::model::BatchCreateEntitiesRequest>>(
11534 mut self,
11535 v: V,
11536 ) -> Self {
11537 self.0.request = v.into();
11538 self
11539 }
11540
11541 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11543 self.0.options = v.into();
11544 self
11545 }
11546
11547 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11554 (*self.0.stub)
11555 .batch_create_entities(self.0.request, self.0.options)
11556 .await
11557 .map(crate::Response::into_body)
11558 }
11559
11560 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11562 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11563 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11564 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11565 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11566 if let Some(ref mut details) = poller_options.tracing {
11567 details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_create_entities::until_done";
11568 }
11569
11570 let stub = self.0.stub.clone();
11571 let mut options = self.0.options.clone();
11572 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11573 let query = move |name| {
11574 let stub = stub.clone();
11575 let options = options.clone();
11576 async {
11577 let op = GetOperation::new(stub)
11578 .set_name(name)
11579 .with_options(options)
11580 .send()
11581 .await?;
11582 Ok(Operation::new(op))
11583 }
11584 };
11585
11586 let start = move || async {
11587 let op = self.send().await?;
11588 Ok(Operation::new(op))
11589 };
11590
11591 use google_cloud_lro::internal::PollerExt;
11592 {
11593 google_cloud_lro::internal::new_unit_response_poller(
11594 polling_error_policy,
11595 polling_backoff_policy,
11596 start,
11597 query,
11598 )
11599 }
11600 .with_options(poller_options)
11601 }
11602
11603 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11607 self.0.request.parent = v.into();
11608 self
11609 }
11610
11611 pub fn set_entities<T, V>(mut self, v: T) -> Self
11615 where
11616 T: std::iter::IntoIterator<Item = V>,
11617 V: std::convert::Into<crate::model::entity_type::Entity>,
11618 {
11619 use std::iter::Iterator;
11620 self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11621 self
11622 }
11623
11624 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11626 self.0.request.language_code = v.into();
11627 self
11628 }
11629 }
11630
11631 #[doc(hidden)]
11632 impl crate::RequestBuilder for BatchCreateEntities {
11633 fn request_options(&mut self) -> &mut crate::RequestOptions {
11634 &mut self.0.options
11635 }
11636 }
11637
11638 #[derive(Clone, Debug)]
11656 pub struct BatchUpdateEntities(RequestBuilder<crate::model::BatchUpdateEntitiesRequest>);
11657
11658 impl BatchUpdateEntities {
11659 pub(crate) fn new(
11660 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11661 ) -> Self {
11662 Self(RequestBuilder::new(stub))
11663 }
11664
11665 pub fn with_request<V: Into<crate::model::BatchUpdateEntitiesRequest>>(
11667 mut self,
11668 v: V,
11669 ) -> Self {
11670 self.0.request = v.into();
11671 self
11672 }
11673
11674 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11676 self.0.options = v.into();
11677 self
11678 }
11679
11680 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11687 (*self.0.stub)
11688 .batch_update_entities(self.0.request, self.0.options)
11689 .await
11690 .map(crate::Response::into_body)
11691 }
11692
11693 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11695 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11696 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11697 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11698 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11699 if let Some(ref mut details) = poller_options.tracing {
11700 details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_update_entities::until_done";
11701 }
11702
11703 let stub = self.0.stub.clone();
11704 let mut options = self.0.options.clone();
11705 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11706 let query = move |name| {
11707 let stub = stub.clone();
11708 let options = options.clone();
11709 async {
11710 let op = GetOperation::new(stub)
11711 .set_name(name)
11712 .with_options(options)
11713 .send()
11714 .await?;
11715 Ok(Operation::new(op))
11716 }
11717 };
11718
11719 let start = move || async {
11720 let op = self.send().await?;
11721 Ok(Operation::new(op))
11722 };
11723
11724 use google_cloud_lro::internal::PollerExt;
11725 {
11726 google_cloud_lro::internal::new_unit_response_poller(
11727 polling_error_policy,
11728 polling_backoff_policy,
11729 start,
11730 query,
11731 )
11732 }
11733 .with_options(poller_options)
11734 }
11735
11736 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11740 self.0.request.parent = v.into();
11741 self
11742 }
11743
11744 pub fn set_entities<T, V>(mut self, v: T) -> Self
11748 where
11749 T: std::iter::IntoIterator<Item = V>,
11750 V: std::convert::Into<crate::model::entity_type::Entity>,
11751 {
11752 use std::iter::Iterator;
11753 self.0.request.entities = v.into_iter().map(|i| i.into()).collect();
11754 self
11755 }
11756
11757 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11759 self.0.request.language_code = v.into();
11760 self
11761 }
11762
11763 pub fn set_update_mask<T>(mut self, v: T) -> Self
11765 where
11766 T: std::convert::Into<wkt::FieldMask>,
11767 {
11768 self.0.request.update_mask = std::option::Option::Some(v.into());
11769 self
11770 }
11771
11772 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
11774 where
11775 T: std::convert::Into<wkt::FieldMask>,
11776 {
11777 self.0.request.update_mask = v.map(|x| x.into());
11778 self
11779 }
11780 }
11781
11782 #[doc(hidden)]
11783 impl crate::RequestBuilder for BatchUpdateEntities {
11784 fn request_options(&mut self) -> &mut crate::RequestOptions {
11785 &mut self.0.options
11786 }
11787 }
11788
11789 #[derive(Clone, Debug)]
11807 pub struct BatchDeleteEntities(RequestBuilder<crate::model::BatchDeleteEntitiesRequest>);
11808
11809 impl BatchDeleteEntities {
11810 pub(crate) fn new(
11811 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11812 ) -> Self {
11813 Self(RequestBuilder::new(stub))
11814 }
11815
11816 pub fn with_request<V: Into<crate::model::BatchDeleteEntitiesRequest>>(
11818 mut self,
11819 v: V,
11820 ) -> Self {
11821 self.0.request = v.into();
11822 self
11823 }
11824
11825 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11827 self.0.options = v.into();
11828 self
11829 }
11830
11831 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
11838 (*self.0.stub)
11839 .batch_delete_entities(self.0.request, self.0.options)
11840 .await
11841 .map(crate::Response::into_body)
11842 }
11843
11844 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
11846 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
11847 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
11848 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
11849 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
11850 if let Some(ref mut details) = poller_options.tracing {
11851 details.method_name = "google_cloud_dialogflow_v2::client::EntityTypes::batch_delete_entities::until_done";
11852 }
11853
11854 let stub = self.0.stub.clone();
11855 let mut options = self.0.options.clone();
11856 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
11857 let query = move |name| {
11858 let stub = stub.clone();
11859 let options = options.clone();
11860 async {
11861 let op = GetOperation::new(stub)
11862 .set_name(name)
11863 .with_options(options)
11864 .send()
11865 .await?;
11866 Ok(Operation::new(op))
11867 }
11868 };
11869
11870 let start = move || async {
11871 let op = self.send().await?;
11872 Ok(Operation::new(op))
11873 };
11874
11875 use google_cloud_lro::internal::PollerExt;
11876 {
11877 google_cloud_lro::internal::new_unit_response_poller(
11878 polling_error_policy,
11879 polling_backoff_policy,
11880 start,
11881 query,
11882 )
11883 }
11884 .with_options(poller_options)
11885 }
11886
11887 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
11891 self.0.request.parent = v.into();
11892 self
11893 }
11894
11895 pub fn set_entity_values<T, V>(mut self, v: T) -> Self
11899 where
11900 T: std::iter::IntoIterator<Item = V>,
11901 V: std::convert::Into<std::string::String>,
11902 {
11903 use std::iter::Iterator;
11904 self.0.request.entity_values = v.into_iter().map(|i| i.into()).collect();
11905 self
11906 }
11907
11908 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
11910 self.0.request.language_code = v.into();
11911 self
11912 }
11913 }
11914
11915 #[doc(hidden)]
11916 impl crate::RequestBuilder for BatchDeleteEntities {
11917 fn request_options(&mut self) -> &mut crate::RequestOptions {
11918 &mut self.0.options
11919 }
11920 }
11921
11922 #[derive(Clone, Debug)]
11943 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
11944
11945 impl ListLocations {
11946 pub(crate) fn new(
11947 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
11948 ) -> Self {
11949 Self(RequestBuilder::new(stub))
11950 }
11951
11952 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
11954 mut self,
11955 v: V,
11956 ) -> Self {
11957 self.0.request = v.into();
11958 self
11959 }
11960
11961 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
11963 self.0.options = v.into();
11964 self
11965 }
11966
11967 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
11969 (*self.0.stub)
11970 .list_locations(self.0.request, self.0.options)
11971 .await
11972 .map(crate::Response::into_body)
11973 }
11974
11975 pub fn by_page(
11977 self,
11978 ) -> impl google_cloud_gax::paginator::Paginator<
11979 google_cloud_location::model::ListLocationsResponse,
11980 crate::Error,
11981 > {
11982 use std::clone::Clone;
11983 let token = self.0.request.page_token.clone();
11984 let execute = move |token: String| {
11985 let mut builder = self.clone();
11986 builder.0.request = builder.0.request.set_page_token(token);
11987 builder.send()
11988 };
11989 google_cloud_gax::paginator::internal::new_paginator(token, execute)
11990 }
11991
11992 pub fn by_item(
11994 self,
11995 ) -> impl google_cloud_gax::paginator::ItemPaginator<
11996 google_cloud_location::model::ListLocationsResponse,
11997 crate::Error,
11998 > {
11999 use google_cloud_gax::paginator::Paginator;
12000 self.by_page().items()
12001 }
12002
12003 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12005 self.0.request.name = v.into();
12006 self
12007 }
12008
12009 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12011 self.0.request.filter = v.into();
12012 self
12013 }
12014
12015 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12017 self.0.request.page_size = v.into();
12018 self
12019 }
12020
12021 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12023 self.0.request.page_token = v.into();
12024 self
12025 }
12026 }
12027
12028 #[doc(hidden)]
12029 impl crate::RequestBuilder for ListLocations {
12030 fn request_options(&mut self) -> &mut crate::RequestOptions {
12031 &mut self.0.options
12032 }
12033 }
12034
12035 #[derive(Clone, Debug)]
12052 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
12053
12054 impl GetLocation {
12055 pub(crate) fn new(
12056 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12057 ) -> Self {
12058 Self(RequestBuilder::new(stub))
12059 }
12060
12061 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
12063 mut self,
12064 v: V,
12065 ) -> Self {
12066 self.0.request = v.into();
12067 self
12068 }
12069
12070 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12072 self.0.options = v.into();
12073 self
12074 }
12075
12076 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
12078 (*self.0.stub)
12079 .get_location(self.0.request, self.0.options)
12080 .await
12081 .map(crate::Response::into_body)
12082 }
12083
12084 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12086 self.0.request.name = v.into();
12087 self
12088 }
12089 }
12090
12091 #[doc(hidden)]
12092 impl crate::RequestBuilder for GetLocation {
12093 fn request_options(&mut self) -> &mut crate::RequestOptions {
12094 &mut self.0.options
12095 }
12096 }
12097
12098 #[derive(Clone, Debug)]
12119 pub struct ListOperations(
12120 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
12121 );
12122
12123 impl ListOperations {
12124 pub(crate) fn new(
12125 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12126 ) -> Self {
12127 Self(RequestBuilder::new(stub))
12128 }
12129
12130 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
12132 mut self,
12133 v: V,
12134 ) -> Self {
12135 self.0.request = v.into();
12136 self
12137 }
12138
12139 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12141 self.0.options = v.into();
12142 self
12143 }
12144
12145 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
12147 (*self.0.stub)
12148 .list_operations(self.0.request, self.0.options)
12149 .await
12150 .map(crate::Response::into_body)
12151 }
12152
12153 pub fn by_page(
12155 self,
12156 ) -> impl google_cloud_gax::paginator::Paginator<
12157 google_cloud_longrunning::model::ListOperationsResponse,
12158 crate::Error,
12159 > {
12160 use std::clone::Clone;
12161 let token = self.0.request.page_token.clone();
12162 let execute = move |token: String| {
12163 let mut builder = self.clone();
12164 builder.0.request = builder.0.request.set_page_token(token);
12165 builder.send()
12166 };
12167 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12168 }
12169
12170 pub fn by_item(
12172 self,
12173 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12174 google_cloud_longrunning::model::ListOperationsResponse,
12175 crate::Error,
12176 > {
12177 use google_cloud_gax::paginator::Paginator;
12178 self.by_page().items()
12179 }
12180
12181 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12183 self.0.request.name = v.into();
12184 self
12185 }
12186
12187 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
12189 self.0.request.filter = v.into();
12190 self
12191 }
12192
12193 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12195 self.0.request.page_size = v.into();
12196 self
12197 }
12198
12199 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12201 self.0.request.page_token = v.into();
12202 self
12203 }
12204
12205 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
12207 self.0.request.return_partial_success = v.into();
12208 self
12209 }
12210 }
12211
12212 #[doc(hidden)]
12213 impl crate::RequestBuilder for ListOperations {
12214 fn request_options(&mut self) -> &mut crate::RequestOptions {
12215 &mut self.0.options
12216 }
12217 }
12218
12219 #[derive(Clone, Debug)]
12236 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
12237
12238 impl GetOperation {
12239 pub(crate) fn new(
12240 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12241 ) -> Self {
12242 Self(RequestBuilder::new(stub))
12243 }
12244
12245 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
12247 mut self,
12248 v: V,
12249 ) -> Self {
12250 self.0.request = v.into();
12251 self
12252 }
12253
12254 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12256 self.0.options = v.into();
12257 self
12258 }
12259
12260 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
12262 (*self.0.stub)
12263 .get_operation(self.0.request, self.0.options)
12264 .await
12265 .map(crate::Response::into_body)
12266 }
12267
12268 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12270 self.0.request.name = v.into();
12271 self
12272 }
12273 }
12274
12275 #[doc(hidden)]
12276 impl crate::RequestBuilder for GetOperation {
12277 fn request_options(&mut self) -> &mut crate::RequestOptions {
12278 &mut self.0.options
12279 }
12280 }
12281
12282 #[derive(Clone, Debug)]
12299 pub struct CancelOperation(
12300 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
12301 );
12302
12303 impl CancelOperation {
12304 pub(crate) fn new(
12305 stub: std::sync::Arc<dyn super::super::stub::dynamic::EntityTypes>,
12306 ) -> Self {
12307 Self(RequestBuilder::new(stub))
12308 }
12309
12310 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
12312 mut self,
12313 v: V,
12314 ) -> Self {
12315 self.0.request = v.into();
12316 self
12317 }
12318
12319 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12321 self.0.options = v.into();
12322 self
12323 }
12324
12325 pub async fn send(self) -> Result<()> {
12327 (*self.0.stub)
12328 .cancel_operation(self.0.request, self.0.options)
12329 .await
12330 .map(crate::Response::into_body)
12331 }
12332
12333 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12335 self.0.request.name = v.into();
12336 self
12337 }
12338 }
12339
12340 #[doc(hidden)]
12341 impl crate::RequestBuilder for CancelOperation {
12342 fn request_options(&mut self) -> &mut crate::RequestOptions {
12343 &mut self.0.options
12344 }
12345 }
12346}
12347
12348#[cfg(feature = "environments")]
12350#[cfg_attr(docsrs, doc(cfg(feature = "environments")))]
12351pub mod environments {
12352 use crate::Result;
12353
12354 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
12368
12369 pub(crate) mod client {
12370 use super::super::super::client::Environments;
12371 pub struct Factory;
12372 impl crate::ClientFactory for Factory {
12373 type Client = Environments;
12374 type Credentials = gaxi::options::Credentials;
12375 async fn build(
12376 self,
12377 config: gaxi::options::ClientConfig,
12378 ) -> crate::ClientBuilderResult<Self::Client> {
12379 Self::Client::new(config).await
12380 }
12381 }
12382 }
12383
12384 #[derive(Clone, Debug)]
12386 pub(crate) struct RequestBuilder<R: std::default::Default> {
12387 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12388 request: R,
12389 options: crate::RequestOptions,
12390 }
12391
12392 impl<R> RequestBuilder<R>
12393 where
12394 R: std::default::Default,
12395 {
12396 pub(crate) fn new(
12397 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12398 ) -> Self {
12399 Self {
12400 stub,
12401 request: R::default(),
12402 options: crate::RequestOptions::default(),
12403 }
12404 }
12405 }
12406
12407 #[derive(Clone, Debug)]
12428 pub struct ListEnvironments(RequestBuilder<crate::model::ListEnvironmentsRequest>);
12429
12430 impl ListEnvironments {
12431 pub(crate) fn new(
12432 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12433 ) -> Self {
12434 Self(RequestBuilder::new(stub))
12435 }
12436
12437 pub fn with_request<V: Into<crate::model::ListEnvironmentsRequest>>(
12439 mut self,
12440 v: V,
12441 ) -> Self {
12442 self.0.request = v.into();
12443 self
12444 }
12445
12446 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12448 self.0.options = v.into();
12449 self
12450 }
12451
12452 pub async fn send(self) -> Result<crate::model::ListEnvironmentsResponse> {
12454 (*self.0.stub)
12455 .list_environments(self.0.request, self.0.options)
12456 .await
12457 .map(crate::Response::into_body)
12458 }
12459
12460 pub fn by_page(
12462 self,
12463 ) -> impl google_cloud_gax::paginator::Paginator<
12464 crate::model::ListEnvironmentsResponse,
12465 crate::Error,
12466 > {
12467 use std::clone::Clone;
12468 let token = self.0.request.page_token.clone();
12469 let execute = move |token: String| {
12470 let mut builder = self.clone();
12471 builder.0.request = builder.0.request.set_page_token(token);
12472 builder.send()
12473 };
12474 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12475 }
12476
12477 pub fn by_item(
12479 self,
12480 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12481 crate::model::ListEnvironmentsResponse,
12482 crate::Error,
12483 > {
12484 use google_cloud_gax::paginator::Paginator;
12485 self.by_page().items()
12486 }
12487
12488 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12492 self.0.request.parent = v.into();
12493 self
12494 }
12495
12496 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12498 self.0.request.page_size = v.into();
12499 self
12500 }
12501
12502 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12504 self.0.request.page_token = v.into();
12505 self
12506 }
12507 }
12508
12509 #[doc(hidden)]
12510 impl crate::RequestBuilder for ListEnvironments {
12511 fn request_options(&mut self) -> &mut crate::RequestOptions {
12512 &mut self.0.options
12513 }
12514 }
12515
12516 #[derive(Clone, Debug)]
12533 pub struct GetEnvironment(RequestBuilder<crate::model::GetEnvironmentRequest>);
12534
12535 impl GetEnvironment {
12536 pub(crate) fn new(
12537 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12538 ) -> Self {
12539 Self(RequestBuilder::new(stub))
12540 }
12541
12542 pub fn with_request<V: Into<crate::model::GetEnvironmentRequest>>(mut self, v: V) -> Self {
12544 self.0.request = v.into();
12545 self
12546 }
12547
12548 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12550 self.0.options = v.into();
12551 self
12552 }
12553
12554 pub async fn send(self) -> Result<crate::model::Environment> {
12556 (*self.0.stub)
12557 .get_environment(self.0.request, self.0.options)
12558 .await
12559 .map(crate::Response::into_body)
12560 }
12561
12562 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12566 self.0.request.name = v.into();
12567 self
12568 }
12569 }
12570
12571 #[doc(hidden)]
12572 impl crate::RequestBuilder for GetEnvironment {
12573 fn request_options(&mut self) -> &mut crate::RequestOptions {
12574 &mut self.0.options
12575 }
12576 }
12577
12578 #[derive(Clone, Debug)]
12595 pub struct CreateEnvironment(RequestBuilder<crate::model::CreateEnvironmentRequest>);
12596
12597 impl CreateEnvironment {
12598 pub(crate) fn new(
12599 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12600 ) -> Self {
12601 Self(RequestBuilder::new(stub))
12602 }
12603
12604 pub fn with_request<V: Into<crate::model::CreateEnvironmentRequest>>(
12606 mut self,
12607 v: V,
12608 ) -> Self {
12609 self.0.request = v.into();
12610 self
12611 }
12612
12613 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12615 self.0.options = v.into();
12616 self
12617 }
12618
12619 pub async fn send(self) -> Result<crate::model::Environment> {
12621 (*self.0.stub)
12622 .create_environment(self.0.request, self.0.options)
12623 .await
12624 .map(crate::Response::into_body)
12625 }
12626
12627 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12631 self.0.request.parent = v.into();
12632 self
12633 }
12634
12635 pub fn set_environment<T>(mut self, v: T) -> Self
12639 where
12640 T: std::convert::Into<crate::model::Environment>,
12641 {
12642 self.0.request.environment = std::option::Option::Some(v.into());
12643 self
12644 }
12645
12646 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12650 where
12651 T: std::convert::Into<crate::model::Environment>,
12652 {
12653 self.0.request.environment = v.map(|x| x.into());
12654 self
12655 }
12656
12657 pub fn set_environment_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
12661 self.0.request.environment_id = v.into();
12662 self
12663 }
12664 }
12665
12666 #[doc(hidden)]
12667 impl crate::RequestBuilder for CreateEnvironment {
12668 fn request_options(&mut self) -> &mut crate::RequestOptions {
12669 &mut self.0.options
12670 }
12671 }
12672
12673 #[derive(Clone, Debug)]
12690 pub struct UpdateEnvironment(RequestBuilder<crate::model::UpdateEnvironmentRequest>);
12691
12692 impl UpdateEnvironment {
12693 pub(crate) fn new(
12694 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12695 ) -> Self {
12696 Self(RequestBuilder::new(stub))
12697 }
12698
12699 pub fn with_request<V: Into<crate::model::UpdateEnvironmentRequest>>(
12701 mut self,
12702 v: V,
12703 ) -> Self {
12704 self.0.request = v.into();
12705 self
12706 }
12707
12708 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12710 self.0.options = v.into();
12711 self
12712 }
12713
12714 pub async fn send(self) -> Result<crate::model::Environment> {
12716 (*self.0.stub)
12717 .update_environment(self.0.request, self.0.options)
12718 .await
12719 .map(crate::Response::into_body)
12720 }
12721
12722 pub fn set_environment<T>(mut self, v: T) -> Self
12726 where
12727 T: std::convert::Into<crate::model::Environment>,
12728 {
12729 self.0.request.environment = std::option::Option::Some(v.into());
12730 self
12731 }
12732
12733 pub fn set_or_clear_environment<T>(mut self, v: std::option::Option<T>) -> Self
12737 where
12738 T: std::convert::Into<crate::model::Environment>,
12739 {
12740 self.0.request.environment = v.map(|x| x.into());
12741 self
12742 }
12743
12744 pub fn set_update_mask<T>(mut self, v: T) -> Self
12748 where
12749 T: std::convert::Into<wkt::FieldMask>,
12750 {
12751 self.0.request.update_mask = std::option::Option::Some(v.into());
12752 self
12753 }
12754
12755 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
12759 where
12760 T: std::convert::Into<wkt::FieldMask>,
12761 {
12762 self.0.request.update_mask = v.map(|x| x.into());
12763 self
12764 }
12765
12766 pub fn set_allow_load_to_draft_and_discard_changes<T: Into<bool>>(mut self, v: T) -> Self {
12768 self.0.request.allow_load_to_draft_and_discard_changes = v.into();
12769 self
12770 }
12771 }
12772
12773 #[doc(hidden)]
12774 impl crate::RequestBuilder for UpdateEnvironment {
12775 fn request_options(&mut self) -> &mut crate::RequestOptions {
12776 &mut self.0.options
12777 }
12778 }
12779
12780 #[derive(Clone, Debug)]
12797 pub struct DeleteEnvironment(RequestBuilder<crate::model::DeleteEnvironmentRequest>);
12798
12799 impl DeleteEnvironment {
12800 pub(crate) fn new(
12801 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12802 ) -> Self {
12803 Self(RequestBuilder::new(stub))
12804 }
12805
12806 pub fn with_request<V: Into<crate::model::DeleteEnvironmentRequest>>(
12808 mut self,
12809 v: V,
12810 ) -> Self {
12811 self.0.request = v.into();
12812 self
12813 }
12814
12815 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12817 self.0.options = v.into();
12818 self
12819 }
12820
12821 pub async fn send(self) -> Result<()> {
12823 (*self.0.stub)
12824 .delete_environment(self.0.request, self.0.options)
12825 .await
12826 .map(crate::Response::into_body)
12827 }
12828
12829 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
12833 self.0.request.name = v.into();
12834 self
12835 }
12836 }
12837
12838 #[doc(hidden)]
12839 impl crate::RequestBuilder for DeleteEnvironment {
12840 fn request_options(&mut self) -> &mut crate::RequestOptions {
12841 &mut self.0.options
12842 }
12843 }
12844
12845 #[derive(Clone, Debug)]
12866 pub struct GetEnvironmentHistory(RequestBuilder<crate::model::GetEnvironmentHistoryRequest>);
12867
12868 impl GetEnvironmentHistory {
12869 pub(crate) fn new(
12870 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12871 ) -> Self {
12872 Self(RequestBuilder::new(stub))
12873 }
12874
12875 pub fn with_request<V: Into<crate::model::GetEnvironmentHistoryRequest>>(
12877 mut self,
12878 v: V,
12879 ) -> Self {
12880 self.0.request = v.into();
12881 self
12882 }
12883
12884 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12886 self.0.options = v.into();
12887 self
12888 }
12889
12890 pub async fn send(self) -> Result<crate::model::EnvironmentHistory> {
12892 (*self.0.stub)
12893 .get_environment_history(self.0.request, self.0.options)
12894 .await
12895 .map(crate::Response::into_body)
12896 }
12897
12898 pub fn by_page(
12900 self,
12901 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::EnvironmentHistory, crate::Error>
12902 {
12903 use std::clone::Clone;
12904 let token = self.0.request.page_token.clone();
12905 let execute = move |token: String| {
12906 let mut builder = self.clone();
12907 builder.0.request = builder.0.request.set_page_token(token);
12908 builder.send()
12909 };
12910 google_cloud_gax::paginator::internal::new_paginator(token, execute)
12911 }
12912
12913 pub fn by_item(
12915 self,
12916 ) -> impl google_cloud_gax::paginator::ItemPaginator<
12917 crate::model::EnvironmentHistory,
12918 crate::Error,
12919 > {
12920 use google_cloud_gax::paginator::Paginator;
12921 self.by_page().items()
12922 }
12923
12924 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
12928 self.0.request.parent = v.into();
12929 self
12930 }
12931
12932 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
12934 self.0.request.page_size = v.into();
12935 self
12936 }
12937
12938 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
12940 self.0.request.page_token = v.into();
12941 self
12942 }
12943 }
12944
12945 #[doc(hidden)]
12946 impl crate::RequestBuilder for GetEnvironmentHistory {
12947 fn request_options(&mut self) -> &mut crate::RequestOptions {
12948 &mut self.0.options
12949 }
12950 }
12951
12952 #[derive(Clone, Debug)]
12973 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
12974
12975 impl ListLocations {
12976 pub(crate) fn new(
12977 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
12978 ) -> Self {
12979 Self(RequestBuilder::new(stub))
12980 }
12981
12982 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
12984 mut self,
12985 v: V,
12986 ) -> Self {
12987 self.0.request = v.into();
12988 self
12989 }
12990
12991 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
12993 self.0.options = v.into();
12994 self
12995 }
12996
12997 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
12999 (*self.0.stub)
13000 .list_locations(self.0.request, self.0.options)
13001 .await
13002 .map(crate::Response::into_body)
13003 }
13004
13005 pub fn by_page(
13007 self,
13008 ) -> impl google_cloud_gax::paginator::Paginator<
13009 google_cloud_location::model::ListLocationsResponse,
13010 crate::Error,
13011 > {
13012 use std::clone::Clone;
13013 let token = self.0.request.page_token.clone();
13014 let execute = move |token: String| {
13015 let mut builder = self.clone();
13016 builder.0.request = builder.0.request.set_page_token(token);
13017 builder.send()
13018 };
13019 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13020 }
13021
13022 pub fn by_item(
13024 self,
13025 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13026 google_cloud_location::model::ListLocationsResponse,
13027 crate::Error,
13028 > {
13029 use google_cloud_gax::paginator::Paginator;
13030 self.by_page().items()
13031 }
13032
13033 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13035 self.0.request.name = v.into();
13036 self
13037 }
13038
13039 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13041 self.0.request.filter = v.into();
13042 self
13043 }
13044
13045 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13047 self.0.request.page_size = v.into();
13048 self
13049 }
13050
13051 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13053 self.0.request.page_token = v.into();
13054 self
13055 }
13056 }
13057
13058 #[doc(hidden)]
13059 impl crate::RequestBuilder for ListLocations {
13060 fn request_options(&mut self) -> &mut crate::RequestOptions {
13061 &mut self.0.options
13062 }
13063 }
13064
13065 #[derive(Clone, Debug)]
13082 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13083
13084 impl GetLocation {
13085 pub(crate) fn new(
13086 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13087 ) -> Self {
13088 Self(RequestBuilder::new(stub))
13089 }
13090
13091 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13093 mut self,
13094 v: V,
13095 ) -> Self {
13096 self.0.request = v.into();
13097 self
13098 }
13099
13100 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13102 self.0.options = v.into();
13103 self
13104 }
13105
13106 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13108 (*self.0.stub)
13109 .get_location(self.0.request, self.0.options)
13110 .await
13111 .map(crate::Response::into_body)
13112 }
13113
13114 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13116 self.0.request.name = v.into();
13117 self
13118 }
13119 }
13120
13121 #[doc(hidden)]
13122 impl crate::RequestBuilder for GetLocation {
13123 fn request_options(&mut self) -> &mut crate::RequestOptions {
13124 &mut self.0.options
13125 }
13126 }
13127
13128 #[derive(Clone, Debug)]
13149 pub struct ListOperations(
13150 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13151 );
13152
13153 impl ListOperations {
13154 pub(crate) fn new(
13155 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13156 ) -> Self {
13157 Self(RequestBuilder::new(stub))
13158 }
13159
13160 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13162 mut self,
13163 v: V,
13164 ) -> Self {
13165 self.0.request = v.into();
13166 self
13167 }
13168
13169 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13171 self.0.options = v.into();
13172 self
13173 }
13174
13175 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13177 (*self.0.stub)
13178 .list_operations(self.0.request, self.0.options)
13179 .await
13180 .map(crate::Response::into_body)
13181 }
13182
13183 pub fn by_page(
13185 self,
13186 ) -> impl google_cloud_gax::paginator::Paginator<
13187 google_cloud_longrunning::model::ListOperationsResponse,
13188 crate::Error,
13189 > {
13190 use std::clone::Clone;
13191 let token = self.0.request.page_token.clone();
13192 let execute = move |token: String| {
13193 let mut builder = self.clone();
13194 builder.0.request = builder.0.request.set_page_token(token);
13195 builder.send()
13196 };
13197 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13198 }
13199
13200 pub fn by_item(
13202 self,
13203 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13204 google_cloud_longrunning::model::ListOperationsResponse,
13205 crate::Error,
13206 > {
13207 use google_cloud_gax::paginator::Paginator;
13208 self.by_page().items()
13209 }
13210
13211 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13213 self.0.request.name = v.into();
13214 self
13215 }
13216
13217 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13219 self.0.request.filter = v.into();
13220 self
13221 }
13222
13223 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13225 self.0.request.page_size = v.into();
13226 self
13227 }
13228
13229 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13231 self.0.request.page_token = v.into();
13232 self
13233 }
13234
13235 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13237 self.0.request.return_partial_success = v.into();
13238 self
13239 }
13240 }
13241
13242 #[doc(hidden)]
13243 impl crate::RequestBuilder for ListOperations {
13244 fn request_options(&mut self) -> &mut crate::RequestOptions {
13245 &mut self.0.options
13246 }
13247 }
13248
13249 #[derive(Clone, Debug)]
13266 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13267
13268 impl GetOperation {
13269 pub(crate) fn new(
13270 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13271 ) -> Self {
13272 Self(RequestBuilder::new(stub))
13273 }
13274
13275 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13277 mut self,
13278 v: V,
13279 ) -> Self {
13280 self.0.request = v.into();
13281 self
13282 }
13283
13284 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13286 self.0.options = v.into();
13287 self
13288 }
13289
13290 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13292 (*self.0.stub)
13293 .get_operation(self.0.request, self.0.options)
13294 .await
13295 .map(crate::Response::into_body)
13296 }
13297
13298 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13300 self.0.request.name = v.into();
13301 self
13302 }
13303 }
13304
13305 #[doc(hidden)]
13306 impl crate::RequestBuilder for GetOperation {
13307 fn request_options(&mut self) -> &mut crate::RequestOptions {
13308 &mut self.0.options
13309 }
13310 }
13311
13312 #[derive(Clone, Debug)]
13329 pub struct CancelOperation(
13330 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13331 );
13332
13333 impl CancelOperation {
13334 pub(crate) fn new(
13335 stub: std::sync::Arc<dyn super::super::stub::dynamic::Environments>,
13336 ) -> Self {
13337 Self(RequestBuilder::new(stub))
13338 }
13339
13340 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13342 mut self,
13343 v: V,
13344 ) -> Self {
13345 self.0.request = v.into();
13346 self
13347 }
13348
13349 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13351 self.0.options = v.into();
13352 self
13353 }
13354
13355 pub async fn send(self) -> Result<()> {
13357 (*self.0.stub)
13358 .cancel_operation(self.0.request, self.0.options)
13359 .await
13360 .map(crate::Response::into_body)
13361 }
13362
13363 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13365 self.0.request.name = v.into();
13366 self
13367 }
13368 }
13369
13370 #[doc(hidden)]
13371 impl crate::RequestBuilder for CancelOperation {
13372 fn request_options(&mut self) -> &mut crate::RequestOptions {
13373 &mut self.0.options
13374 }
13375 }
13376}
13377
13378#[cfg(feature = "fulfillments")]
13380#[cfg_attr(docsrs, doc(cfg(feature = "fulfillments")))]
13381pub mod fulfillments {
13382 use crate::Result;
13383
13384 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
13398
13399 pub(crate) mod client {
13400 use super::super::super::client::Fulfillments;
13401 pub struct Factory;
13402 impl crate::ClientFactory for Factory {
13403 type Client = Fulfillments;
13404 type Credentials = gaxi::options::Credentials;
13405 async fn build(
13406 self,
13407 config: gaxi::options::ClientConfig,
13408 ) -> crate::ClientBuilderResult<Self::Client> {
13409 Self::Client::new(config).await
13410 }
13411 }
13412 }
13413
13414 #[derive(Clone, Debug)]
13416 pub(crate) struct RequestBuilder<R: std::default::Default> {
13417 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13418 request: R,
13419 options: crate::RequestOptions,
13420 }
13421
13422 impl<R> RequestBuilder<R>
13423 where
13424 R: std::default::Default,
13425 {
13426 pub(crate) fn new(
13427 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13428 ) -> Self {
13429 Self {
13430 stub,
13431 request: R::default(),
13432 options: crate::RequestOptions::default(),
13433 }
13434 }
13435 }
13436
13437 #[derive(Clone, Debug)]
13454 pub struct GetFulfillment(RequestBuilder<crate::model::GetFulfillmentRequest>);
13455
13456 impl GetFulfillment {
13457 pub(crate) fn new(
13458 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13459 ) -> Self {
13460 Self(RequestBuilder::new(stub))
13461 }
13462
13463 pub fn with_request<V: Into<crate::model::GetFulfillmentRequest>>(mut self, v: V) -> Self {
13465 self.0.request = v.into();
13466 self
13467 }
13468
13469 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13471 self.0.options = v.into();
13472 self
13473 }
13474
13475 pub async fn send(self) -> Result<crate::model::Fulfillment> {
13477 (*self.0.stub)
13478 .get_fulfillment(self.0.request, self.0.options)
13479 .await
13480 .map(crate::Response::into_body)
13481 }
13482
13483 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13487 self.0.request.name = v.into();
13488 self
13489 }
13490 }
13491
13492 #[doc(hidden)]
13493 impl crate::RequestBuilder for GetFulfillment {
13494 fn request_options(&mut self) -> &mut crate::RequestOptions {
13495 &mut self.0.options
13496 }
13497 }
13498
13499 #[derive(Clone, Debug)]
13516 pub struct UpdateFulfillment(RequestBuilder<crate::model::UpdateFulfillmentRequest>);
13517
13518 impl UpdateFulfillment {
13519 pub(crate) fn new(
13520 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13521 ) -> Self {
13522 Self(RequestBuilder::new(stub))
13523 }
13524
13525 pub fn with_request<V: Into<crate::model::UpdateFulfillmentRequest>>(
13527 mut self,
13528 v: V,
13529 ) -> Self {
13530 self.0.request = v.into();
13531 self
13532 }
13533
13534 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13536 self.0.options = v.into();
13537 self
13538 }
13539
13540 pub async fn send(self) -> Result<crate::model::Fulfillment> {
13542 (*self.0.stub)
13543 .update_fulfillment(self.0.request, self.0.options)
13544 .await
13545 .map(crate::Response::into_body)
13546 }
13547
13548 pub fn set_fulfillment<T>(mut self, v: T) -> Self
13552 where
13553 T: std::convert::Into<crate::model::Fulfillment>,
13554 {
13555 self.0.request.fulfillment = std::option::Option::Some(v.into());
13556 self
13557 }
13558
13559 pub fn set_or_clear_fulfillment<T>(mut self, v: std::option::Option<T>) -> Self
13563 where
13564 T: std::convert::Into<crate::model::Fulfillment>,
13565 {
13566 self.0.request.fulfillment = v.map(|x| x.into());
13567 self
13568 }
13569
13570 pub fn set_update_mask<T>(mut self, v: T) -> Self
13574 where
13575 T: std::convert::Into<wkt::FieldMask>,
13576 {
13577 self.0.request.update_mask = std::option::Option::Some(v.into());
13578 self
13579 }
13580
13581 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
13585 where
13586 T: std::convert::Into<wkt::FieldMask>,
13587 {
13588 self.0.request.update_mask = v.map(|x| x.into());
13589 self
13590 }
13591 }
13592
13593 #[doc(hidden)]
13594 impl crate::RequestBuilder for UpdateFulfillment {
13595 fn request_options(&mut self) -> &mut crate::RequestOptions {
13596 &mut self.0.options
13597 }
13598 }
13599
13600 #[derive(Clone, Debug)]
13621 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
13622
13623 impl ListLocations {
13624 pub(crate) fn new(
13625 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13626 ) -> Self {
13627 Self(RequestBuilder::new(stub))
13628 }
13629
13630 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
13632 mut self,
13633 v: V,
13634 ) -> Self {
13635 self.0.request = v.into();
13636 self
13637 }
13638
13639 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13641 self.0.options = v.into();
13642 self
13643 }
13644
13645 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
13647 (*self.0.stub)
13648 .list_locations(self.0.request, self.0.options)
13649 .await
13650 .map(crate::Response::into_body)
13651 }
13652
13653 pub fn by_page(
13655 self,
13656 ) -> impl google_cloud_gax::paginator::Paginator<
13657 google_cloud_location::model::ListLocationsResponse,
13658 crate::Error,
13659 > {
13660 use std::clone::Clone;
13661 let token = self.0.request.page_token.clone();
13662 let execute = move |token: String| {
13663 let mut builder = self.clone();
13664 builder.0.request = builder.0.request.set_page_token(token);
13665 builder.send()
13666 };
13667 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13668 }
13669
13670 pub fn by_item(
13672 self,
13673 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13674 google_cloud_location::model::ListLocationsResponse,
13675 crate::Error,
13676 > {
13677 use google_cloud_gax::paginator::Paginator;
13678 self.by_page().items()
13679 }
13680
13681 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13683 self.0.request.name = v.into();
13684 self
13685 }
13686
13687 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13689 self.0.request.filter = v.into();
13690 self
13691 }
13692
13693 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13695 self.0.request.page_size = v.into();
13696 self
13697 }
13698
13699 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13701 self.0.request.page_token = v.into();
13702 self
13703 }
13704 }
13705
13706 #[doc(hidden)]
13707 impl crate::RequestBuilder for ListLocations {
13708 fn request_options(&mut self) -> &mut crate::RequestOptions {
13709 &mut self.0.options
13710 }
13711 }
13712
13713 #[derive(Clone, Debug)]
13730 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
13731
13732 impl GetLocation {
13733 pub(crate) fn new(
13734 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13735 ) -> Self {
13736 Self(RequestBuilder::new(stub))
13737 }
13738
13739 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
13741 mut self,
13742 v: V,
13743 ) -> Self {
13744 self.0.request = v.into();
13745 self
13746 }
13747
13748 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13750 self.0.options = v.into();
13751 self
13752 }
13753
13754 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
13756 (*self.0.stub)
13757 .get_location(self.0.request, self.0.options)
13758 .await
13759 .map(crate::Response::into_body)
13760 }
13761
13762 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13764 self.0.request.name = v.into();
13765 self
13766 }
13767 }
13768
13769 #[doc(hidden)]
13770 impl crate::RequestBuilder for GetLocation {
13771 fn request_options(&mut self) -> &mut crate::RequestOptions {
13772 &mut self.0.options
13773 }
13774 }
13775
13776 #[derive(Clone, Debug)]
13797 pub struct ListOperations(
13798 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
13799 );
13800
13801 impl ListOperations {
13802 pub(crate) fn new(
13803 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13804 ) -> Self {
13805 Self(RequestBuilder::new(stub))
13806 }
13807
13808 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
13810 mut self,
13811 v: V,
13812 ) -> Self {
13813 self.0.request = v.into();
13814 self
13815 }
13816
13817 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13819 self.0.options = v.into();
13820 self
13821 }
13822
13823 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
13825 (*self.0.stub)
13826 .list_operations(self.0.request, self.0.options)
13827 .await
13828 .map(crate::Response::into_body)
13829 }
13830
13831 pub fn by_page(
13833 self,
13834 ) -> impl google_cloud_gax::paginator::Paginator<
13835 google_cloud_longrunning::model::ListOperationsResponse,
13836 crate::Error,
13837 > {
13838 use std::clone::Clone;
13839 let token = self.0.request.page_token.clone();
13840 let execute = move |token: String| {
13841 let mut builder = self.clone();
13842 builder.0.request = builder.0.request.set_page_token(token);
13843 builder.send()
13844 };
13845 google_cloud_gax::paginator::internal::new_paginator(token, execute)
13846 }
13847
13848 pub fn by_item(
13850 self,
13851 ) -> impl google_cloud_gax::paginator::ItemPaginator<
13852 google_cloud_longrunning::model::ListOperationsResponse,
13853 crate::Error,
13854 > {
13855 use google_cloud_gax::paginator::Paginator;
13856 self.by_page().items()
13857 }
13858
13859 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13861 self.0.request.name = v.into();
13862 self
13863 }
13864
13865 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
13867 self.0.request.filter = v.into();
13868 self
13869 }
13870
13871 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
13873 self.0.request.page_size = v.into();
13874 self
13875 }
13876
13877 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
13879 self.0.request.page_token = v.into();
13880 self
13881 }
13882
13883 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
13885 self.0.request.return_partial_success = v.into();
13886 self
13887 }
13888 }
13889
13890 #[doc(hidden)]
13891 impl crate::RequestBuilder for ListOperations {
13892 fn request_options(&mut self) -> &mut crate::RequestOptions {
13893 &mut self.0.options
13894 }
13895 }
13896
13897 #[derive(Clone, Debug)]
13914 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
13915
13916 impl GetOperation {
13917 pub(crate) fn new(
13918 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13919 ) -> Self {
13920 Self(RequestBuilder::new(stub))
13921 }
13922
13923 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
13925 mut self,
13926 v: V,
13927 ) -> Self {
13928 self.0.request = v.into();
13929 self
13930 }
13931
13932 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13934 self.0.options = v.into();
13935 self
13936 }
13937
13938 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
13940 (*self.0.stub)
13941 .get_operation(self.0.request, self.0.options)
13942 .await
13943 .map(crate::Response::into_body)
13944 }
13945
13946 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
13948 self.0.request.name = v.into();
13949 self
13950 }
13951 }
13952
13953 #[doc(hidden)]
13954 impl crate::RequestBuilder for GetOperation {
13955 fn request_options(&mut self) -> &mut crate::RequestOptions {
13956 &mut self.0.options
13957 }
13958 }
13959
13960 #[derive(Clone, Debug)]
13977 pub struct CancelOperation(
13978 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
13979 );
13980
13981 impl CancelOperation {
13982 pub(crate) fn new(
13983 stub: std::sync::Arc<dyn super::super::stub::dynamic::Fulfillments>,
13984 ) -> Self {
13985 Self(RequestBuilder::new(stub))
13986 }
13987
13988 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
13990 mut self,
13991 v: V,
13992 ) -> Self {
13993 self.0.request = v.into();
13994 self
13995 }
13996
13997 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
13999 self.0.options = v.into();
14000 self
14001 }
14002
14003 pub async fn send(self) -> Result<()> {
14005 (*self.0.stub)
14006 .cancel_operation(self.0.request, self.0.options)
14007 .await
14008 .map(crate::Response::into_body)
14009 }
14010
14011 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14013 self.0.request.name = v.into();
14014 self
14015 }
14016 }
14017
14018 #[doc(hidden)]
14019 impl crate::RequestBuilder for CancelOperation {
14020 fn request_options(&mut self) -> &mut crate::RequestOptions {
14021 &mut self.0.options
14022 }
14023 }
14024}
14025
14026#[cfg(feature = "generators")]
14028#[cfg_attr(docsrs, doc(cfg(feature = "generators")))]
14029pub mod generators {
14030 use crate::Result;
14031
14032 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14046
14047 pub(crate) mod client {
14048 use super::super::super::client::Generators;
14049 pub struct Factory;
14050 impl crate::ClientFactory for Factory {
14051 type Client = Generators;
14052 type Credentials = gaxi::options::Credentials;
14053 async fn build(
14054 self,
14055 config: gaxi::options::ClientConfig,
14056 ) -> crate::ClientBuilderResult<Self::Client> {
14057 Self::Client::new(config).await
14058 }
14059 }
14060 }
14061
14062 #[derive(Clone, Debug)]
14064 pub(crate) struct RequestBuilder<R: std::default::Default> {
14065 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14066 request: R,
14067 options: crate::RequestOptions,
14068 }
14069
14070 impl<R> RequestBuilder<R>
14071 where
14072 R: std::default::Default,
14073 {
14074 pub(crate) fn new(
14075 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14076 ) -> Self {
14077 Self {
14078 stub,
14079 request: R::default(),
14080 options: crate::RequestOptions::default(),
14081 }
14082 }
14083 }
14084
14085 #[derive(Clone, Debug)]
14102 pub struct CreateGenerator(RequestBuilder<crate::model::CreateGeneratorRequest>);
14103
14104 impl CreateGenerator {
14105 pub(crate) fn new(
14106 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14107 ) -> Self {
14108 Self(RequestBuilder::new(stub))
14109 }
14110
14111 pub fn with_request<V: Into<crate::model::CreateGeneratorRequest>>(mut self, v: V) -> Self {
14113 self.0.request = v.into();
14114 self
14115 }
14116
14117 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14119 self.0.options = v.into();
14120 self
14121 }
14122
14123 pub async fn send(self) -> Result<crate::model::Generator> {
14125 (*self.0.stub)
14126 .create_generator(self.0.request, self.0.options)
14127 .await
14128 .map(crate::Response::into_body)
14129 }
14130
14131 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14135 self.0.request.parent = v.into();
14136 self
14137 }
14138
14139 pub fn set_generator<T>(mut self, v: T) -> Self
14143 where
14144 T: std::convert::Into<crate::model::Generator>,
14145 {
14146 self.0.request.generator = std::option::Option::Some(v.into());
14147 self
14148 }
14149
14150 pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14154 where
14155 T: std::convert::Into<crate::model::Generator>,
14156 {
14157 self.0.request.generator = v.map(|x| x.into());
14158 self
14159 }
14160
14161 pub fn set_generator_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
14163 self.0.request.generator_id = v.into();
14164 self
14165 }
14166 }
14167
14168 #[doc(hidden)]
14169 impl crate::RequestBuilder for CreateGenerator {
14170 fn request_options(&mut self) -> &mut crate::RequestOptions {
14171 &mut self.0.options
14172 }
14173 }
14174
14175 #[derive(Clone, Debug)]
14192 pub struct GetGenerator(RequestBuilder<crate::model::GetGeneratorRequest>);
14193
14194 impl GetGenerator {
14195 pub(crate) fn new(
14196 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14197 ) -> Self {
14198 Self(RequestBuilder::new(stub))
14199 }
14200
14201 pub fn with_request<V: Into<crate::model::GetGeneratorRequest>>(mut self, v: V) -> Self {
14203 self.0.request = v.into();
14204 self
14205 }
14206
14207 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14209 self.0.options = v.into();
14210 self
14211 }
14212
14213 pub async fn send(self) -> Result<crate::model::Generator> {
14215 (*self.0.stub)
14216 .get_generator(self.0.request, self.0.options)
14217 .await
14218 .map(crate::Response::into_body)
14219 }
14220
14221 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14225 self.0.request.name = v.into();
14226 self
14227 }
14228 }
14229
14230 #[doc(hidden)]
14231 impl crate::RequestBuilder for GetGenerator {
14232 fn request_options(&mut self) -> &mut crate::RequestOptions {
14233 &mut self.0.options
14234 }
14235 }
14236
14237 #[derive(Clone, Debug)]
14258 pub struct ListGenerators(RequestBuilder<crate::model::ListGeneratorsRequest>);
14259
14260 impl ListGenerators {
14261 pub(crate) fn new(
14262 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14263 ) -> Self {
14264 Self(RequestBuilder::new(stub))
14265 }
14266
14267 pub fn with_request<V: Into<crate::model::ListGeneratorsRequest>>(mut self, v: V) -> Self {
14269 self.0.request = v.into();
14270 self
14271 }
14272
14273 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14275 self.0.options = v.into();
14276 self
14277 }
14278
14279 pub async fn send(self) -> Result<crate::model::ListGeneratorsResponse> {
14281 (*self.0.stub)
14282 .list_generators(self.0.request, self.0.options)
14283 .await
14284 .map(crate::Response::into_body)
14285 }
14286
14287 pub fn by_page(
14289 self,
14290 ) -> impl google_cloud_gax::paginator::Paginator<
14291 crate::model::ListGeneratorsResponse,
14292 crate::Error,
14293 > {
14294 use std::clone::Clone;
14295 let token = self.0.request.page_token.clone();
14296 let execute = move |token: String| {
14297 let mut builder = self.clone();
14298 builder.0.request = builder.0.request.set_page_token(token);
14299 builder.send()
14300 };
14301 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14302 }
14303
14304 pub fn by_item(
14306 self,
14307 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14308 crate::model::ListGeneratorsResponse,
14309 crate::Error,
14310 > {
14311 use google_cloud_gax::paginator::Paginator;
14312 self.by_page().items()
14313 }
14314
14315 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
14319 self.0.request.parent = v.into();
14320 self
14321 }
14322
14323 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14325 self.0.request.page_size = v.into();
14326 self
14327 }
14328
14329 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14331 self.0.request.page_token = v.into();
14332 self
14333 }
14334 }
14335
14336 #[doc(hidden)]
14337 impl crate::RequestBuilder for ListGenerators {
14338 fn request_options(&mut self) -> &mut crate::RequestOptions {
14339 &mut self.0.options
14340 }
14341 }
14342
14343 #[derive(Clone, Debug)]
14360 pub struct DeleteGenerator(RequestBuilder<crate::model::DeleteGeneratorRequest>);
14361
14362 impl DeleteGenerator {
14363 pub(crate) fn new(
14364 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14365 ) -> Self {
14366 Self(RequestBuilder::new(stub))
14367 }
14368
14369 pub fn with_request<V: Into<crate::model::DeleteGeneratorRequest>>(mut self, v: V) -> Self {
14371 self.0.request = v.into();
14372 self
14373 }
14374
14375 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14377 self.0.options = v.into();
14378 self
14379 }
14380
14381 pub async fn send(self) -> Result<()> {
14383 (*self.0.stub)
14384 .delete_generator(self.0.request, self.0.options)
14385 .await
14386 .map(crate::Response::into_body)
14387 }
14388
14389 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14393 self.0.request.name = v.into();
14394 self
14395 }
14396 }
14397
14398 #[doc(hidden)]
14399 impl crate::RequestBuilder for DeleteGenerator {
14400 fn request_options(&mut self) -> &mut crate::RequestOptions {
14401 &mut self.0.options
14402 }
14403 }
14404
14405 #[derive(Clone, Debug)]
14422 pub struct UpdateGenerator(RequestBuilder<crate::model::UpdateGeneratorRequest>);
14423
14424 impl UpdateGenerator {
14425 pub(crate) fn new(
14426 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14427 ) -> Self {
14428 Self(RequestBuilder::new(stub))
14429 }
14430
14431 pub fn with_request<V: Into<crate::model::UpdateGeneratorRequest>>(mut self, v: V) -> Self {
14433 self.0.request = v.into();
14434 self
14435 }
14436
14437 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14439 self.0.options = v.into();
14440 self
14441 }
14442
14443 pub async fn send(self) -> Result<crate::model::Generator> {
14445 (*self.0.stub)
14446 .update_generator(self.0.request, self.0.options)
14447 .await
14448 .map(crate::Response::into_body)
14449 }
14450
14451 pub fn set_generator<T>(mut self, v: T) -> Self
14455 where
14456 T: std::convert::Into<crate::model::Generator>,
14457 {
14458 self.0.request.generator = std::option::Option::Some(v.into());
14459 self
14460 }
14461
14462 pub fn set_or_clear_generator<T>(mut self, v: std::option::Option<T>) -> Self
14466 where
14467 T: std::convert::Into<crate::model::Generator>,
14468 {
14469 self.0.request.generator = v.map(|x| x.into());
14470 self
14471 }
14472
14473 pub fn set_update_mask<T>(mut self, v: T) -> Self
14475 where
14476 T: std::convert::Into<wkt::FieldMask>,
14477 {
14478 self.0.request.update_mask = std::option::Option::Some(v.into());
14479 self
14480 }
14481
14482 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
14484 where
14485 T: std::convert::Into<wkt::FieldMask>,
14486 {
14487 self.0.request.update_mask = v.map(|x| x.into());
14488 self
14489 }
14490 }
14491
14492 #[doc(hidden)]
14493 impl crate::RequestBuilder for UpdateGenerator {
14494 fn request_options(&mut self) -> &mut crate::RequestOptions {
14495 &mut self.0.options
14496 }
14497 }
14498
14499 #[derive(Clone, Debug)]
14520 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
14521
14522 impl ListLocations {
14523 pub(crate) fn new(
14524 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14525 ) -> Self {
14526 Self(RequestBuilder::new(stub))
14527 }
14528
14529 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
14531 mut self,
14532 v: V,
14533 ) -> Self {
14534 self.0.request = v.into();
14535 self
14536 }
14537
14538 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14540 self.0.options = v.into();
14541 self
14542 }
14543
14544 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
14546 (*self.0.stub)
14547 .list_locations(self.0.request, self.0.options)
14548 .await
14549 .map(crate::Response::into_body)
14550 }
14551
14552 pub fn by_page(
14554 self,
14555 ) -> impl google_cloud_gax::paginator::Paginator<
14556 google_cloud_location::model::ListLocationsResponse,
14557 crate::Error,
14558 > {
14559 use std::clone::Clone;
14560 let token = self.0.request.page_token.clone();
14561 let execute = move |token: String| {
14562 let mut builder = self.clone();
14563 builder.0.request = builder.0.request.set_page_token(token);
14564 builder.send()
14565 };
14566 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14567 }
14568
14569 pub fn by_item(
14571 self,
14572 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14573 google_cloud_location::model::ListLocationsResponse,
14574 crate::Error,
14575 > {
14576 use google_cloud_gax::paginator::Paginator;
14577 self.by_page().items()
14578 }
14579
14580 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14582 self.0.request.name = v.into();
14583 self
14584 }
14585
14586 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14588 self.0.request.filter = v.into();
14589 self
14590 }
14591
14592 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14594 self.0.request.page_size = v.into();
14595 self
14596 }
14597
14598 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14600 self.0.request.page_token = v.into();
14601 self
14602 }
14603 }
14604
14605 #[doc(hidden)]
14606 impl crate::RequestBuilder for ListLocations {
14607 fn request_options(&mut self) -> &mut crate::RequestOptions {
14608 &mut self.0.options
14609 }
14610 }
14611
14612 #[derive(Clone, Debug)]
14629 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
14630
14631 impl GetLocation {
14632 pub(crate) fn new(
14633 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14634 ) -> Self {
14635 Self(RequestBuilder::new(stub))
14636 }
14637
14638 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
14640 mut self,
14641 v: V,
14642 ) -> Self {
14643 self.0.request = v.into();
14644 self
14645 }
14646
14647 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14649 self.0.options = v.into();
14650 self
14651 }
14652
14653 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
14655 (*self.0.stub)
14656 .get_location(self.0.request, self.0.options)
14657 .await
14658 .map(crate::Response::into_body)
14659 }
14660
14661 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14663 self.0.request.name = v.into();
14664 self
14665 }
14666 }
14667
14668 #[doc(hidden)]
14669 impl crate::RequestBuilder for GetLocation {
14670 fn request_options(&mut self) -> &mut crate::RequestOptions {
14671 &mut self.0.options
14672 }
14673 }
14674
14675 #[derive(Clone, Debug)]
14696 pub struct ListOperations(
14697 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
14698 );
14699
14700 impl ListOperations {
14701 pub(crate) fn new(
14702 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14703 ) -> Self {
14704 Self(RequestBuilder::new(stub))
14705 }
14706
14707 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
14709 mut self,
14710 v: V,
14711 ) -> Self {
14712 self.0.request = v.into();
14713 self
14714 }
14715
14716 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14718 self.0.options = v.into();
14719 self
14720 }
14721
14722 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
14724 (*self.0.stub)
14725 .list_operations(self.0.request, self.0.options)
14726 .await
14727 .map(crate::Response::into_body)
14728 }
14729
14730 pub fn by_page(
14732 self,
14733 ) -> impl google_cloud_gax::paginator::Paginator<
14734 google_cloud_longrunning::model::ListOperationsResponse,
14735 crate::Error,
14736 > {
14737 use std::clone::Clone;
14738 let token = self.0.request.page_token.clone();
14739 let execute = move |token: String| {
14740 let mut builder = self.clone();
14741 builder.0.request = builder.0.request.set_page_token(token);
14742 builder.send()
14743 };
14744 google_cloud_gax::paginator::internal::new_paginator(token, execute)
14745 }
14746
14747 pub fn by_item(
14749 self,
14750 ) -> impl google_cloud_gax::paginator::ItemPaginator<
14751 google_cloud_longrunning::model::ListOperationsResponse,
14752 crate::Error,
14753 > {
14754 use google_cloud_gax::paginator::Paginator;
14755 self.by_page().items()
14756 }
14757
14758 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14760 self.0.request.name = v.into();
14761 self
14762 }
14763
14764 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
14766 self.0.request.filter = v.into();
14767 self
14768 }
14769
14770 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
14772 self.0.request.page_size = v.into();
14773 self
14774 }
14775
14776 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
14778 self.0.request.page_token = v.into();
14779 self
14780 }
14781
14782 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
14784 self.0.request.return_partial_success = v.into();
14785 self
14786 }
14787 }
14788
14789 #[doc(hidden)]
14790 impl crate::RequestBuilder for ListOperations {
14791 fn request_options(&mut self) -> &mut crate::RequestOptions {
14792 &mut self.0.options
14793 }
14794 }
14795
14796 #[derive(Clone, Debug)]
14813 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
14814
14815 impl GetOperation {
14816 pub(crate) fn new(
14817 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14818 ) -> Self {
14819 Self(RequestBuilder::new(stub))
14820 }
14821
14822 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
14824 mut self,
14825 v: V,
14826 ) -> Self {
14827 self.0.request = v.into();
14828 self
14829 }
14830
14831 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14833 self.0.options = v.into();
14834 self
14835 }
14836
14837 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
14839 (*self.0.stub)
14840 .get_operation(self.0.request, self.0.options)
14841 .await
14842 .map(crate::Response::into_body)
14843 }
14844
14845 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14847 self.0.request.name = v.into();
14848 self
14849 }
14850 }
14851
14852 #[doc(hidden)]
14853 impl crate::RequestBuilder for GetOperation {
14854 fn request_options(&mut self) -> &mut crate::RequestOptions {
14855 &mut self.0.options
14856 }
14857 }
14858
14859 #[derive(Clone, Debug)]
14876 pub struct CancelOperation(
14877 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
14878 );
14879
14880 impl CancelOperation {
14881 pub(crate) fn new(
14882 stub: std::sync::Arc<dyn super::super::stub::dynamic::Generators>,
14883 ) -> Self {
14884 Self(RequestBuilder::new(stub))
14885 }
14886
14887 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
14889 mut self,
14890 v: V,
14891 ) -> Self {
14892 self.0.request = v.into();
14893 self
14894 }
14895
14896 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
14898 self.0.options = v.into();
14899 self
14900 }
14901
14902 pub async fn send(self) -> Result<()> {
14904 (*self.0.stub)
14905 .cancel_operation(self.0.request, self.0.options)
14906 .await
14907 .map(crate::Response::into_body)
14908 }
14909
14910 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
14912 self.0.request.name = v.into();
14913 self
14914 }
14915 }
14916
14917 #[doc(hidden)]
14918 impl crate::RequestBuilder for CancelOperation {
14919 fn request_options(&mut self) -> &mut crate::RequestOptions {
14920 &mut self.0.options
14921 }
14922 }
14923}
14924
14925#[cfg(feature = "generator-evaluations")]
14927#[cfg_attr(docsrs, doc(cfg(feature = "generator-evaluations")))]
14928pub mod generator_evaluations {
14929 use crate::Result;
14930
14931 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
14945
14946 pub(crate) mod client {
14947 use super::super::super::client::GeneratorEvaluations;
14948 pub struct Factory;
14949 impl crate::ClientFactory for Factory {
14950 type Client = GeneratorEvaluations;
14951 type Credentials = gaxi::options::Credentials;
14952 async fn build(
14953 self,
14954 config: gaxi::options::ClientConfig,
14955 ) -> crate::ClientBuilderResult<Self::Client> {
14956 Self::Client::new(config).await
14957 }
14958 }
14959 }
14960
14961 #[derive(Clone, Debug)]
14963 pub(crate) struct RequestBuilder<R: std::default::Default> {
14964 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14965 request: R,
14966 options: crate::RequestOptions,
14967 }
14968
14969 impl<R> RequestBuilder<R>
14970 where
14971 R: std::default::Default,
14972 {
14973 pub(crate) fn new(
14974 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
14975 ) -> Self {
14976 Self {
14977 stub,
14978 request: R::default(),
14979 options: crate::RequestOptions::default(),
14980 }
14981 }
14982 }
14983
14984 #[derive(Clone, Debug)]
15002 pub struct CreateGeneratorEvaluation(
15003 RequestBuilder<crate::model::CreateGeneratorEvaluationRequest>,
15004 );
15005
15006 impl CreateGeneratorEvaluation {
15007 pub(crate) fn new(
15008 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15009 ) -> Self {
15010 Self(RequestBuilder::new(stub))
15011 }
15012
15013 pub fn with_request<V: Into<crate::model::CreateGeneratorEvaluationRequest>>(
15015 mut self,
15016 v: V,
15017 ) -> Self {
15018 self.0.request = v.into();
15019 self
15020 }
15021
15022 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15024 self.0.options = v.into();
15025 self
15026 }
15027
15028 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15035 (*self.0.stub)
15036 .create_generator_evaluation(self.0.request, self.0.options)
15037 .await
15038 .map(crate::Response::into_body)
15039 }
15040
15041 pub fn poller(
15043 self,
15044 ) -> impl google_cloud_lro::Poller<
15045 crate::model::GeneratorEvaluation,
15046 crate::model::GeneratorEvaluationOperationMetadata,
15047 > {
15048 type Operation = google_cloud_lro::internal::Operation<
15049 crate::model::GeneratorEvaluation,
15050 crate::model::GeneratorEvaluationOperationMetadata,
15051 >;
15052 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
15053 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
15054 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
15055 if let Some(ref mut details) = poller_options.tracing {
15056 details.method_name = "google_cloud_dialogflow_v2::client::GeneratorEvaluations::create_generator_evaluation::until_done";
15057 }
15058
15059 let stub = self.0.stub.clone();
15060 let mut options = self.0.options.clone();
15061 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
15062 let query = move |name| {
15063 let stub = stub.clone();
15064 let options = options.clone();
15065 async {
15066 let op = GetOperation::new(stub)
15067 .set_name(name)
15068 .with_options(options)
15069 .send()
15070 .await?;
15071 Ok(Operation::new(op))
15072 }
15073 };
15074
15075 let start = move || async {
15076 let op = self.send().await?;
15077 Ok(Operation::new(op))
15078 };
15079
15080 use google_cloud_lro::internal::PollerExt;
15081 {
15082 google_cloud_lro::internal::new_poller(
15083 polling_error_policy,
15084 polling_backoff_policy,
15085 start,
15086 query,
15087 )
15088 }
15089 .with_options(poller_options)
15090 }
15091
15092 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15096 self.0.request.parent = v.into();
15097 self
15098 }
15099
15100 pub fn set_generator_evaluation<T>(mut self, v: T) -> Self
15104 where
15105 T: std::convert::Into<crate::model::GeneratorEvaluation>,
15106 {
15107 self.0.request.generator_evaluation = std::option::Option::Some(v.into());
15108 self
15109 }
15110
15111 pub fn set_or_clear_generator_evaluation<T>(mut self, v: std::option::Option<T>) -> Self
15115 where
15116 T: std::convert::Into<crate::model::GeneratorEvaluation>,
15117 {
15118 self.0.request.generator_evaluation = v.map(|x| x.into());
15119 self
15120 }
15121 }
15122
15123 #[doc(hidden)]
15124 impl crate::RequestBuilder for CreateGeneratorEvaluation {
15125 fn request_options(&mut self) -> &mut crate::RequestOptions {
15126 &mut self.0.options
15127 }
15128 }
15129
15130 #[derive(Clone, Debug)]
15147 pub struct GetGeneratorEvaluation(RequestBuilder<crate::model::GetGeneratorEvaluationRequest>);
15148
15149 impl GetGeneratorEvaluation {
15150 pub(crate) fn new(
15151 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15152 ) -> Self {
15153 Self(RequestBuilder::new(stub))
15154 }
15155
15156 pub fn with_request<V: Into<crate::model::GetGeneratorEvaluationRequest>>(
15158 mut self,
15159 v: V,
15160 ) -> Self {
15161 self.0.request = v.into();
15162 self
15163 }
15164
15165 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15167 self.0.options = v.into();
15168 self
15169 }
15170
15171 pub async fn send(self) -> Result<crate::model::GeneratorEvaluation> {
15173 (*self.0.stub)
15174 .get_generator_evaluation(self.0.request, self.0.options)
15175 .await
15176 .map(crate::Response::into_body)
15177 }
15178
15179 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15183 self.0.request.name = v.into();
15184 self
15185 }
15186 }
15187
15188 #[doc(hidden)]
15189 impl crate::RequestBuilder for GetGeneratorEvaluation {
15190 fn request_options(&mut self) -> &mut crate::RequestOptions {
15191 &mut self.0.options
15192 }
15193 }
15194
15195 #[derive(Clone, Debug)]
15216 pub struct ListGeneratorEvaluations(
15217 RequestBuilder<crate::model::ListGeneratorEvaluationsRequest>,
15218 );
15219
15220 impl ListGeneratorEvaluations {
15221 pub(crate) fn new(
15222 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15223 ) -> Self {
15224 Self(RequestBuilder::new(stub))
15225 }
15226
15227 pub fn with_request<V: Into<crate::model::ListGeneratorEvaluationsRequest>>(
15229 mut self,
15230 v: V,
15231 ) -> Self {
15232 self.0.request = v.into();
15233 self
15234 }
15235
15236 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15238 self.0.options = v.into();
15239 self
15240 }
15241
15242 pub async fn send(self) -> Result<crate::model::ListGeneratorEvaluationsResponse> {
15244 (*self.0.stub)
15245 .list_generator_evaluations(self.0.request, self.0.options)
15246 .await
15247 .map(crate::Response::into_body)
15248 }
15249
15250 pub fn by_page(
15252 self,
15253 ) -> impl google_cloud_gax::paginator::Paginator<
15254 crate::model::ListGeneratorEvaluationsResponse,
15255 crate::Error,
15256 > {
15257 use std::clone::Clone;
15258 let token = self.0.request.page_token.clone();
15259 let execute = move |token: String| {
15260 let mut builder = self.clone();
15261 builder.0.request = builder.0.request.set_page_token(token);
15262 builder.send()
15263 };
15264 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15265 }
15266
15267 pub fn by_item(
15269 self,
15270 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15271 crate::model::ListGeneratorEvaluationsResponse,
15272 crate::Error,
15273 > {
15274 use google_cloud_gax::paginator::Paginator;
15275 self.by_page().items()
15276 }
15277
15278 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15282 self.0.request.parent = v.into();
15283 self
15284 }
15285
15286 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15288 self.0.request.page_size = v.into();
15289 self
15290 }
15291
15292 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15294 self.0.request.page_token = v.into();
15295 self
15296 }
15297 }
15298
15299 #[doc(hidden)]
15300 impl crate::RequestBuilder for ListGeneratorEvaluations {
15301 fn request_options(&mut self) -> &mut crate::RequestOptions {
15302 &mut self.0.options
15303 }
15304 }
15305
15306 #[derive(Clone, Debug)]
15323 pub struct DeleteGeneratorEvaluation(
15324 RequestBuilder<crate::model::DeleteGeneratorEvaluationRequest>,
15325 );
15326
15327 impl DeleteGeneratorEvaluation {
15328 pub(crate) fn new(
15329 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15330 ) -> Self {
15331 Self(RequestBuilder::new(stub))
15332 }
15333
15334 pub fn with_request<V: Into<crate::model::DeleteGeneratorEvaluationRequest>>(
15336 mut self,
15337 v: V,
15338 ) -> Self {
15339 self.0.request = v.into();
15340 self
15341 }
15342
15343 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15345 self.0.options = v.into();
15346 self
15347 }
15348
15349 pub async fn send(self) -> Result<()> {
15351 (*self.0.stub)
15352 .delete_generator_evaluation(self.0.request, self.0.options)
15353 .await
15354 .map(crate::Response::into_body)
15355 }
15356
15357 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15361 self.0.request.name = v.into();
15362 self
15363 }
15364 }
15365
15366 #[doc(hidden)]
15367 impl crate::RequestBuilder for DeleteGeneratorEvaluation {
15368 fn request_options(&mut self) -> &mut crate::RequestOptions {
15369 &mut self.0.options
15370 }
15371 }
15372
15373 #[derive(Clone, Debug)]
15394 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
15395
15396 impl ListLocations {
15397 pub(crate) fn new(
15398 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15399 ) -> Self {
15400 Self(RequestBuilder::new(stub))
15401 }
15402
15403 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
15405 mut self,
15406 v: V,
15407 ) -> Self {
15408 self.0.request = v.into();
15409 self
15410 }
15411
15412 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15414 self.0.options = v.into();
15415 self
15416 }
15417
15418 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
15420 (*self.0.stub)
15421 .list_locations(self.0.request, self.0.options)
15422 .await
15423 .map(crate::Response::into_body)
15424 }
15425
15426 pub fn by_page(
15428 self,
15429 ) -> impl google_cloud_gax::paginator::Paginator<
15430 google_cloud_location::model::ListLocationsResponse,
15431 crate::Error,
15432 > {
15433 use std::clone::Clone;
15434 let token = self.0.request.page_token.clone();
15435 let execute = move |token: String| {
15436 let mut builder = self.clone();
15437 builder.0.request = builder.0.request.set_page_token(token);
15438 builder.send()
15439 };
15440 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15441 }
15442
15443 pub fn by_item(
15445 self,
15446 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15447 google_cloud_location::model::ListLocationsResponse,
15448 crate::Error,
15449 > {
15450 use google_cloud_gax::paginator::Paginator;
15451 self.by_page().items()
15452 }
15453
15454 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15456 self.0.request.name = v.into();
15457 self
15458 }
15459
15460 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15462 self.0.request.filter = v.into();
15463 self
15464 }
15465
15466 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15468 self.0.request.page_size = v.into();
15469 self
15470 }
15471
15472 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15474 self.0.request.page_token = v.into();
15475 self
15476 }
15477 }
15478
15479 #[doc(hidden)]
15480 impl crate::RequestBuilder for ListLocations {
15481 fn request_options(&mut self) -> &mut crate::RequestOptions {
15482 &mut self.0.options
15483 }
15484 }
15485
15486 #[derive(Clone, Debug)]
15503 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
15504
15505 impl GetLocation {
15506 pub(crate) fn new(
15507 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15508 ) -> Self {
15509 Self(RequestBuilder::new(stub))
15510 }
15511
15512 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
15514 mut self,
15515 v: V,
15516 ) -> Self {
15517 self.0.request = v.into();
15518 self
15519 }
15520
15521 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15523 self.0.options = v.into();
15524 self
15525 }
15526
15527 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
15529 (*self.0.stub)
15530 .get_location(self.0.request, self.0.options)
15531 .await
15532 .map(crate::Response::into_body)
15533 }
15534
15535 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15537 self.0.request.name = v.into();
15538 self
15539 }
15540 }
15541
15542 #[doc(hidden)]
15543 impl crate::RequestBuilder for GetLocation {
15544 fn request_options(&mut self) -> &mut crate::RequestOptions {
15545 &mut self.0.options
15546 }
15547 }
15548
15549 #[derive(Clone, Debug)]
15570 pub struct ListOperations(
15571 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
15572 );
15573
15574 impl ListOperations {
15575 pub(crate) fn new(
15576 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15577 ) -> Self {
15578 Self(RequestBuilder::new(stub))
15579 }
15580
15581 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
15583 mut self,
15584 v: V,
15585 ) -> Self {
15586 self.0.request = v.into();
15587 self
15588 }
15589
15590 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15592 self.0.options = v.into();
15593 self
15594 }
15595
15596 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
15598 (*self.0.stub)
15599 .list_operations(self.0.request, self.0.options)
15600 .await
15601 .map(crate::Response::into_body)
15602 }
15603
15604 pub fn by_page(
15606 self,
15607 ) -> impl google_cloud_gax::paginator::Paginator<
15608 google_cloud_longrunning::model::ListOperationsResponse,
15609 crate::Error,
15610 > {
15611 use std::clone::Clone;
15612 let token = self.0.request.page_token.clone();
15613 let execute = move |token: String| {
15614 let mut builder = self.clone();
15615 builder.0.request = builder.0.request.set_page_token(token);
15616 builder.send()
15617 };
15618 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15619 }
15620
15621 pub fn by_item(
15623 self,
15624 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15625 google_cloud_longrunning::model::ListOperationsResponse,
15626 crate::Error,
15627 > {
15628 use google_cloud_gax::paginator::Paginator;
15629 self.by_page().items()
15630 }
15631
15632 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15634 self.0.request.name = v.into();
15635 self
15636 }
15637
15638 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
15640 self.0.request.filter = v.into();
15641 self
15642 }
15643
15644 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15646 self.0.request.page_size = v.into();
15647 self
15648 }
15649
15650 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15652 self.0.request.page_token = v.into();
15653 self
15654 }
15655
15656 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
15658 self.0.request.return_partial_success = v.into();
15659 self
15660 }
15661 }
15662
15663 #[doc(hidden)]
15664 impl crate::RequestBuilder for ListOperations {
15665 fn request_options(&mut self) -> &mut crate::RequestOptions {
15666 &mut self.0.options
15667 }
15668 }
15669
15670 #[derive(Clone, Debug)]
15687 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
15688
15689 impl GetOperation {
15690 pub(crate) fn new(
15691 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15692 ) -> Self {
15693 Self(RequestBuilder::new(stub))
15694 }
15695
15696 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
15698 mut self,
15699 v: V,
15700 ) -> Self {
15701 self.0.request = v.into();
15702 self
15703 }
15704
15705 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15707 self.0.options = v.into();
15708 self
15709 }
15710
15711 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
15713 (*self.0.stub)
15714 .get_operation(self.0.request, self.0.options)
15715 .await
15716 .map(crate::Response::into_body)
15717 }
15718
15719 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15721 self.0.request.name = v.into();
15722 self
15723 }
15724 }
15725
15726 #[doc(hidden)]
15727 impl crate::RequestBuilder for GetOperation {
15728 fn request_options(&mut self) -> &mut crate::RequestOptions {
15729 &mut self.0.options
15730 }
15731 }
15732
15733 #[derive(Clone, Debug)]
15750 pub struct CancelOperation(
15751 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
15752 );
15753
15754 impl CancelOperation {
15755 pub(crate) fn new(
15756 stub: std::sync::Arc<dyn super::super::stub::dynamic::GeneratorEvaluations>,
15757 ) -> Self {
15758 Self(RequestBuilder::new(stub))
15759 }
15760
15761 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
15763 mut self,
15764 v: V,
15765 ) -> Self {
15766 self.0.request = v.into();
15767 self
15768 }
15769
15770 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15772 self.0.options = v.into();
15773 self
15774 }
15775
15776 pub async fn send(self) -> Result<()> {
15778 (*self.0.stub)
15779 .cancel_operation(self.0.request, self.0.options)
15780 .await
15781 .map(crate::Response::into_body)
15782 }
15783
15784 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
15786 self.0.request.name = v.into();
15787 self
15788 }
15789 }
15790
15791 #[doc(hidden)]
15792 impl crate::RequestBuilder for CancelOperation {
15793 fn request_options(&mut self) -> &mut crate::RequestOptions {
15794 &mut self.0.options
15795 }
15796 }
15797}
15798
15799#[cfg(feature = "intents")]
15801#[cfg_attr(docsrs, doc(cfg(feature = "intents")))]
15802pub mod intents {
15803 use crate::Result;
15804
15805 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
15819
15820 pub(crate) mod client {
15821 use super::super::super::client::Intents;
15822 pub struct Factory;
15823 impl crate::ClientFactory for Factory {
15824 type Client = Intents;
15825 type Credentials = gaxi::options::Credentials;
15826 async fn build(
15827 self,
15828 config: gaxi::options::ClientConfig,
15829 ) -> crate::ClientBuilderResult<Self::Client> {
15830 Self::Client::new(config).await
15831 }
15832 }
15833 }
15834
15835 #[derive(Clone, Debug)]
15837 pub(crate) struct RequestBuilder<R: std::default::Default> {
15838 stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>,
15839 request: R,
15840 options: crate::RequestOptions,
15841 }
15842
15843 impl<R> RequestBuilder<R>
15844 where
15845 R: std::default::Default,
15846 {
15847 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15848 Self {
15849 stub,
15850 request: R::default(),
15851 options: crate::RequestOptions::default(),
15852 }
15853 }
15854 }
15855
15856 #[derive(Clone, Debug)]
15877 pub struct ListIntents(RequestBuilder<crate::model::ListIntentsRequest>);
15878
15879 impl ListIntents {
15880 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15881 Self(RequestBuilder::new(stub))
15882 }
15883
15884 pub fn with_request<V: Into<crate::model::ListIntentsRequest>>(mut self, v: V) -> Self {
15886 self.0.request = v.into();
15887 self
15888 }
15889
15890 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
15892 self.0.options = v.into();
15893 self
15894 }
15895
15896 pub async fn send(self) -> Result<crate::model::ListIntentsResponse> {
15898 (*self.0.stub)
15899 .list_intents(self.0.request, self.0.options)
15900 .await
15901 .map(crate::Response::into_body)
15902 }
15903
15904 pub fn by_page(
15906 self,
15907 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListIntentsResponse, crate::Error>
15908 {
15909 use std::clone::Clone;
15910 let token = self.0.request.page_token.clone();
15911 let execute = move |token: String| {
15912 let mut builder = self.clone();
15913 builder.0.request = builder.0.request.set_page_token(token);
15914 builder.send()
15915 };
15916 google_cloud_gax::paginator::internal::new_paginator(token, execute)
15917 }
15918
15919 pub fn by_item(
15921 self,
15922 ) -> impl google_cloud_gax::paginator::ItemPaginator<
15923 crate::model::ListIntentsResponse,
15924 crate::Error,
15925 > {
15926 use google_cloud_gax::paginator::Paginator;
15927 self.by_page().items()
15928 }
15929
15930 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
15934 self.0.request.parent = v.into();
15935 self
15936 }
15937
15938 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
15940 self.0.request.language_code = v.into();
15941 self
15942 }
15943
15944 pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
15946 self.0.request.intent_view = v.into();
15947 self
15948 }
15949
15950 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
15952 self.0.request.page_size = v.into();
15953 self
15954 }
15955
15956 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
15958 self.0.request.page_token = v.into();
15959 self
15960 }
15961 }
15962
15963 #[doc(hidden)]
15964 impl crate::RequestBuilder for ListIntents {
15965 fn request_options(&mut self) -> &mut crate::RequestOptions {
15966 &mut self.0.options
15967 }
15968 }
15969
15970 #[derive(Clone, Debug)]
15987 pub struct GetIntent(RequestBuilder<crate::model::GetIntentRequest>);
15988
15989 impl GetIntent {
15990 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
15991 Self(RequestBuilder::new(stub))
15992 }
15993
15994 pub fn with_request<V: Into<crate::model::GetIntentRequest>>(mut self, v: V) -> Self {
15996 self.0.request = v.into();
15997 self
15998 }
15999
16000 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16002 self.0.options = v.into();
16003 self
16004 }
16005
16006 pub async fn send(self) -> Result<crate::model::Intent> {
16008 (*self.0.stub)
16009 .get_intent(self.0.request, self.0.options)
16010 .await
16011 .map(crate::Response::into_body)
16012 }
16013
16014 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16018 self.0.request.name = v.into();
16019 self
16020 }
16021
16022 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16024 self.0.request.language_code = v.into();
16025 self
16026 }
16027
16028 pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16030 self.0.request.intent_view = v.into();
16031 self
16032 }
16033 }
16034
16035 #[doc(hidden)]
16036 impl crate::RequestBuilder for GetIntent {
16037 fn request_options(&mut self) -> &mut crate::RequestOptions {
16038 &mut self.0.options
16039 }
16040 }
16041
16042 #[derive(Clone, Debug)]
16059 pub struct CreateIntent(RequestBuilder<crate::model::CreateIntentRequest>);
16060
16061 impl CreateIntent {
16062 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16063 Self(RequestBuilder::new(stub))
16064 }
16065
16066 pub fn with_request<V: Into<crate::model::CreateIntentRequest>>(mut self, v: V) -> Self {
16068 self.0.request = v.into();
16069 self
16070 }
16071
16072 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16074 self.0.options = v.into();
16075 self
16076 }
16077
16078 pub async fn send(self) -> Result<crate::model::Intent> {
16080 (*self.0.stub)
16081 .create_intent(self.0.request, self.0.options)
16082 .await
16083 .map(crate::Response::into_body)
16084 }
16085
16086 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16090 self.0.request.parent = v.into();
16091 self
16092 }
16093
16094 pub fn set_intent<T>(mut self, v: T) -> Self
16098 where
16099 T: std::convert::Into<crate::model::Intent>,
16100 {
16101 self.0.request.intent = std::option::Option::Some(v.into());
16102 self
16103 }
16104
16105 pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
16109 where
16110 T: std::convert::Into<crate::model::Intent>,
16111 {
16112 self.0.request.intent = v.map(|x| x.into());
16113 self
16114 }
16115
16116 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16118 self.0.request.language_code = v.into();
16119 self
16120 }
16121
16122 pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16124 self.0.request.intent_view = v.into();
16125 self
16126 }
16127 }
16128
16129 #[doc(hidden)]
16130 impl crate::RequestBuilder for CreateIntent {
16131 fn request_options(&mut self) -> &mut crate::RequestOptions {
16132 &mut self.0.options
16133 }
16134 }
16135
16136 #[derive(Clone, Debug)]
16153 pub struct UpdateIntent(RequestBuilder<crate::model::UpdateIntentRequest>);
16154
16155 impl UpdateIntent {
16156 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16157 Self(RequestBuilder::new(stub))
16158 }
16159
16160 pub fn with_request<V: Into<crate::model::UpdateIntentRequest>>(mut self, v: V) -> Self {
16162 self.0.request = v.into();
16163 self
16164 }
16165
16166 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16168 self.0.options = v.into();
16169 self
16170 }
16171
16172 pub async fn send(self) -> Result<crate::model::Intent> {
16174 (*self.0.stub)
16175 .update_intent(self.0.request, self.0.options)
16176 .await
16177 .map(crate::Response::into_body)
16178 }
16179
16180 pub fn set_intent<T>(mut self, v: T) -> Self
16184 where
16185 T: std::convert::Into<crate::model::Intent>,
16186 {
16187 self.0.request.intent = std::option::Option::Some(v.into());
16188 self
16189 }
16190
16191 pub fn set_or_clear_intent<T>(mut self, v: std::option::Option<T>) -> Self
16195 where
16196 T: std::convert::Into<crate::model::Intent>,
16197 {
16198 self.0.request.intent = v.map(|x| x.into());
16199 self
16200 }
16201
16202 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16204 self.0.request.language_code = v.into();
16205 self
16206 }
16207
16208 pub fn set_update_mask<T>(mut self, v: T) -> Self
16210 where
16211 T: std::convert::Into<wkt::FieldMask>,
16212 {
16213 self.0.request.update_mask = std::option::Option::Some(v.into());
16214 self
16215 }
16216
16217 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16219 where
16220 T: std::convert::Into<wkt::FieldMask>,
16221 {
16222 self.0.request.update_mask = v.map(|x| x.into());
16223 self
16224 }
16225
16226 pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16228 self.0.request.intent_view = v.into();
16229 self
16230 }
16231 }
16232
16233 #[doc(hidden)]
16234 impl crate::RequestBuilder for UpdateIntent {
16235 fn request_options(&mut self) -> &mut crate::RequestOptions {
16236 &mut self.0.options
16237 }
16238 }
16239
16240 #[derive(Clone, Debug)]
16257 pub struct DeleteIntent(RequestBuilder<crate::model::DeleteIntentRequest>);
16258
16259 impl DeleteIntent {
16260 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16261 Self(RequestBuilder::new(stub))
16262 }
16263
16264 pub fn with_request<V: Into<crate::model::DeleteIntentRequest>>(mut self, v: V) -> Self {
16266 self.0.request = v.into();
16267 self
16268 }
16269
16270 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16272 self.0.options = v.into();
16273 self
16274 }
16275
16276 pub async fn send(self) -> Result<()> {
16278 (*self.0.stub)
16279 .delete_intent(self.0.request, self.0.options)
16280 .await
16281 .map(crate::Response::into_body)
16282 }
16283
16284 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16288 self.0.request.name = v.into();
16289 self
16290 }
16291 }
16292
16293 #[doc(hidden)]
16294 impl crate::RequestBuilder for DeleteIntent {
16295 fn request_options(&mut self) -> &mut crate::RequestOptions {
16296 &mut self.0.options
16297 }
16298 }
16299
16300 #[derive(Clone, Debug)]
16318 pub struct BatchUpdateIntents(RequestBuilder<crate::model::BatchUpdateIntentsRequest>);
16319
16320 impl BatchUpdateIntents {
16321 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16322 Self(RequestBuilder::new(stub))
16323 }
16324
16325 pub fn with_request<V: Into<crate::model::BatchUpdateIntentsRequest>>(
16327 mut self,
16328 v: V,
16329 ) -> Self {
16330 self.0.request = v.into();
16331 self
16332 }
16333
16334 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16336 self.0.options = v.into();
16337 self
16338 }
16339
16340 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16347 (*self.0.stub)
16348 .batch_update_intents(self.0.request, self.0.options)
16349 .await
16350 .map(crate::Response::into_body)
16351 }
16352
16353 pub fn poller(
16355 self,
16356 ) -> impl google_cloud_lro::Poller<crate::model::BatchUpdateIntentsResponse, wkt::Struct>
16357 {
16358 type Operation = google_cloud_lro::internal::Operation<
16359 crate::model::BatchUpdateIntentsResponse,
16360 wkt::Struct,
16361 >;
16362 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16363 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16364 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16365 if let Some(ref mut details) = poller_options.tracing {
16366 details.method_name =
16367 "google_cloud_dialogflow_v2::client::Intents::batch_update_intents::until_done";
16368 }
16369
16370 let stub = self.0.stub.clone();
16371 let mut options = self.0.options.clone();
16372 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16373 let query = move |name| {
16374 let stub = stub.clone();
16375 let options = options.clone();
16376 async {
16377 let op = GetOperation::new(stub)
16378 .set_name(name)
16379 .with_options(options)
16380 .send()
16381 .await?;
16382 Ok(Operation::new(op))
16383 }
16384 };
16385
16386 let start = move || async {
16387 let op = self.send().await?;
16388 Ok(Operation::new(op))
16389 };
16390
16391 use google_cloud_lro::internal::PollerExt;
16392 {
16393 google_cloud_lro::internal::new_poller(
16394 polling_error_policy,
16395 polling_backoff_policy,
16396 start,
16397 query,
16398 )
16399 }
16400 .with_options(poller_options)
16401 }
16402
16403 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16407 self.0.request.parent = v.into();
16408 self
16409 }
16410
16411 pub fn set_language_code<T: Into<std::string::String>>(mut self, v: T) -> Self {
16413 self.0.request.language_code = v.into();
16414 self
16415 }
16416
16417 pub fn set_update_mask<T>(mut self, v: T) -> Self
16419 where
16420 T: std::convert::Into<wkt::FieldMask>,
16421 {
16422 self.0.request.update_mask = std::option::Option::Some(v.into());
16423 self
16424 }
16425
16426 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
16428 where
16429 T: std::convert::Into<wkt::FieldMask>,
16430 {
16431 self.0.request.update_mask = v.map(|x| x.into());
16432 self
16433 }
16434
16435 pub fn set_intent_view<T: Into<crate::model::IntentView>>(mut self, v: T) -> Self {
16437 self.0.request.intent_view = v.into();
16438 self
16439 }
16440
16441 pub fn set_intent_batch<
16446 T: Into<Option<crate::model::batch_update_intents_request::IntentBatch>>,
16447 >(
16448 mut self,
16449 v: T,
16450 ) -> Self {
16451 self.0.request.intent_batch = v.into();
16452 self
16453 }
16454
16455 pub fn set_intent_batch_uri<T: std::convert::Into<std::string::String>>(
16461 mut self,
16462 v: T,
16463 ) -> Self {
16464 self.0.request = self.0.request.set_intent_batch_uri(v);
16465 self
16466 }
16467
16468 pub fn set_intent_batch_inline<
16474 T: std::convert::Into<std::boxed::Box<crate::model::IntentBatch>>,
16475 >(
16476 mut self,
16477 v: T,
16478 ) -> Self {
16479 self.0.request = self.0.request.set_intent_batch_inline(v);
16480 self
16481 }
16482 }
16483
16484 #[doc(hidden)]
16485 impl crate::RequestBuilder for BatchUpdateIntents {
16486 fn request_options(&mut self) -> &mut crate::RequestOptions {
16487 &mut self.0.options
16488 }
16489 }
16490
16491 #[derive(Clone, Debug)]
16509 pub struct BatchDeleteIntents(RequestBuilder<crate::model::BatchDeleteIntentsRequest>);
16510
16511 impl BatchDeleteIntents {
16512 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16513 Self(RequestBuilder::new(stub))
16514 }
16515
16516 pub fn with_request<V: Into<crate::model::BatchDeleteIntentsRequest>>(
16518 mut self,
16519 v: V,
16520 ) -> Self {
16521 self.0.request = v.into();
16522 self
16523 }
16524
16525 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16527 self.0.options = v.into();
16528 self
16529 }
16530
16531 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16538 (*self.0.stub)
16539 .batch_delete_intents(self.0.request, self.0.options)
16540 .await
16541 .map(crate::Response::into_body)
16542 }
16543
16544 pub fn poller(self) -> impl google_cloud_lro::Poller<(), wkt::Struct> {
16546 type Operation = google_cloud_lro::internal::Operation<wkt::Empty, wkt::Struct>;
16547 let polling_error_policy = self.0.stub.get_polling_error_policy(&self.0.options);
16548 let polling_backoff_policy = self.0.stub.get_polling_backoff_policy(&self.0.options);
16549 let mut poller_options = self.0.stub.get_poller_options(&self.0.options);
16550 if let Some(ref mut details) = poller_options.tracing {
16551 details.method_name =
16552 "google_cloud_dialogflow_v2::client::Intents::batch_delete_intents::until_done";
16553 }
16554
16555 let stub = self.0.stub.clone();
16556 let mut options = self.0.options.clone();
16557 options.set_retry_policy(google_cloud_gax::retry_policy::NeverRetry);
16558 let query = move |name| {
16559 let stub = stub.clone();
16560 let options = options.clone();
16561 async {
16562 let op = GetOperation::new(stub)
16563 .set_name(name)
16564 .with_options(options)
16565 .send()
16566 .await?;
16567 Ok(Operation::new(op))
16568 }
16569 };
16570
16571 let start = move || async {
16572 let op = self.send().await?;
16573 Ok(Operation::new(op))
16574 };
16575
16576 use google_cloud_lro::internal::PollerExt;
16577 {
16578 google_cloud_lro::internal::new_unit_response_poller(
16579 polling_error_policy,
16580 polling_backoff_policy,
16581 start,
16582 query,
16583 )
16584 }
16585 .with_options(poller_options)
16586 }
16587
16588 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
16592 self.0.request.parent = v.into();
16593 self
16594 }
16595
16596 pub fn set_intents<T, V>(mut self, v: T) -> Self
16600 where
16601 T: std::iter::IntoIterator<Item = V>,
16602 V: std::convert::Into<crate::model::Intent>,
16603 {
16604 use std::iter::Iterator;
16605 self.0.request.intents = v.into_iter().map(|i| i.into()).collect();
16606 self
16607 }
16608 }
16609
16610 #[doc(hidden)]
16611 impl crate::RequestBuilder for BatchDeleteIntents {
16612 fn request_options(&mut self) -> &mut crate::RequestOptions {
16613 &mut self.0.options
16614 }
16615 }
16616
16617 #[derive(Clone, Debug)]
16638 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
16639
16640 impl ListLocations {
16641 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16642 Self(RequestBuilder::new(stub))
16643 }
16644
16645 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
16647 mut self,
16648 v: V,
16649 ) -> Self {
16650 self.0.request = v.into();
16651 self
16652 }
16653
16654 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16656 self.0.options = v.into();
16657 self
16658 }
16659
16660 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
16662 (*self.0.stub)
16663 .list_locations(self.0.request, self.0.options)
16664 .await
16665 .map(crate::Response::into_body)
16666 }
16667
16668 pub fn by_page(
16670 self,
16671 ) -> impl google_cloud_gax::paginator::Paginator<
16672 google_cloud_location::model::ListLocationsResponse,
16673 crate::Error,
16674 > {
16675 use std::clone::Clone;
16676 let token = self.0.request.page_token.clone();
16677 let execute = move |token: String| {
16678 let mut builder = self.clone();
16679 builder.0.request = builder.0.request.set_page_token(token);
16680 builder.send()
16681 };
16682 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16683 }
16684
16685 pub fn by_item(
16687 self,
16688 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16689 google_cloud_location::model::ListLocationsResponse,
16690 crate::Error,
16691 > {
16692 use google_cloud_gax::paginator::Paginator;
16693 self.by_page().items()
16694 }
16695
16696 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16698 self.0.request.name = v.into();
16699 self
16700 }
16701
16702 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16704 self.0.request.filter = v.into();
16705 self
16706 }
16707
16708 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16710 self.0.request.page_size = v.into();
16711 self
16712 }
16713
16714 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16716 self.0.request.page_token = v.into();
16717 self
16718 }
16719 }
16720
16721 #[doc(hidden)]
16722 impl crate::RequestBuilder for ListLocations {
16723 fn request_options(&mut self) -> &mut crate::RequestOptions {
16724 &mut self.0.options
16725 }
16726 }
16727
16728 #[derive(Clone, Debug)]
16745 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
16746
16747 impl GetLocation {
16748 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16749 Self(RequestBuilder::new(stub))
16750 }
16751
16752 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
16754 mut self,
16755 v: V,
16756 ) -> Self {
16757 self.0.request = v.into();
16758 self
16759 }
16760
16761 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16763 self.0.options = v.into();
16764 self
16765 }
16766
16767 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
16769 (*self.0.stub)
16770 .get_location(self.0.request, self.0.options)
16771 .await
16772 .map(crate::Response::into_body)
16773 }
16774
16775 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16777 self.0.request.name = v.into();
16778 self
16779 }
16780 }
16781
16782 #[doc(hidden)]
16783 impl crate::RequestBuilder for GetLocation {
16784 fn request_options(&mut self) -> &mut crate::RequestOptions {
16785 &mut self.0.options
16786 }
16787 }
16788
16789 #[derive(Clone, Debug)]
16810 pub struct ListOperations(
16811 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
16812 );
16813
16814 impl ListOperations {
16815 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16816 Self(RequestBuilder::new(stub))
16817 }
16818
16819 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
16821 mut self,
16822 v: V,
16823 ) -> Self {
16824 self.0.request = v.into();
16825 self
16826 }
16827
16828 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16830 self.0.options = v.into();
16831 self
16832 }
16833
16834 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
16836 (*self.0.stub)
16837 .list_operations(self.0.request, self.0.options)
16838 .await
16839 .map(crate::Response::into_body)
16840 }
16841
16842 pub fn by_page(
16844 self,
16845 ) -> impl google_cloud_gax::paginator::Paginator<
16846 google_cloud_longrunning::model::ListOperationsResponse,
16847 crate::Error,
16848 > {
16849 use std::clone::Clone;
16850 let token = self.0.request.page_token.clone();
16851 let execute = move |token: String| {
16852 let mut builder = self.clone();
16853 builder.0.request = builder.0.request.set_page_token(token);
16854 builder.send()
16855 };
16856 google_cloud_gax::paginator::internal::new_paginator(token, execute)
16857 }
16858
16859 pub fn by_item(
16861 self,
16862 ) -> impl google_cloud_gax::paginator::ItemPaginator<
16863 google_cloud_longrunning::model::ListOperationsResponse,
16864 crate::Error,
16865 > {
16866 use google_cloud_gax::paginator::Paginator;
16867 self.by_page().items()
16868 }
16869
16870 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16872 self.0.request.name = v.into();
16873 self
16874 }
16875
16876 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
16878 self.0.request.filter = v.into();
16879 self
16880 }
16881
16882 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
16884 self.0.request.page_size = v.into();
16885 self
16886 }
16887
16888 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
16890 self.0.request.page_token = v.into();
16891 self
16892 }
16893
16894 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
16896 self.0.request.return_partial_success = v.into();
16897 self
16898 }
16899 }
16900
16901 #[doc(hidden)]
16902 impl crate::RequestBuilder for ListOperations {
16903 fn request_options(&mut self) -> &mut crate::RequestOptions {
16904 &mut self.0.options
16905 }
16906 }
16907
16908 #[derive(Clone, Debug)]
16925 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
16926
16927 impl GetOperation {
16928 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16929 Self(RequestBuilder::new(stub))
16930 }
16931
16932 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
16934 mut self,
16935 v: V,
16936 ) -> Self {
16937 self.0.request = v.into();
16938 self
16939 }
16940
16941 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
16943 self.0.options = v.into();
16944 self
16945 }
16946
16947 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
16949 (*self.0.stub)
16950 .get_operation(self.0.request, self.0.options)
16951 .await
16952 .map(crate::Response::into_body)
16953 }
16954
16955 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
16957 self.0.request.name = v.into();
16958 self
16959 }
16960 }
16961
16962 #[doc(hidden)]
16963 impl crate::RequestBuilder for GetOperation {
16964 fn request_options(&mut self) -> &mut crate::RequestOptions {
16965 &mut self.0.options
16966 }
16967 }
16968
16969 #[derive(Clone, Debug)]
16986 pub struct CancelOperation(
16987 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
16988 );
16989
16990 impl CancelOperation {
16991 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Intents>) -> Self {
16992 Self(RequestBuilder::new(stub))
16993 }
16994
16995 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
16997 mut self,
16998 v: V,
16999 ) -> Self {
17000 self.0.request = v.into();
17001 self
17002 }
17003
17004 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17006 self.0.options = v.into();
17007 self
17008 }
17009
17010 pub async fn send(self) -> Result<()> {
17012 (*self.0.stub)
17013 .cancel_operation(self.0.request, self.0.options)
17014 .await
17015 .map(crate::Response::into_body)
17016 }
17017
17018 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17020 self.0.request.name = v.into();
17021 self
17022 }
17023 }
17024
17025 #[doc(hidden)]
17026 impl crate::RequestBuilder for CancelOperation {
17027 fn request_options(&mut self) -> &mut crate::RequestOptions {
17028 &mut self.0.options
17029 }
17030 }
17031}
17032
17033#[cfg(feature = "knowledge-bases")]
17035#[cfg_attr(docsrs, doc(cfg(feature = "knowledge-bases")))]
17036pub mod knowledge_bases {
17037 use crate::Result;
17038
17039 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17053
17054 pub(crate) mod client {
17055 use super::super::super::client::KnowledgeBases;
17056 pub struct Factory;
17057 impl crate::ClientFactory for Factory {
17058 type Client = KnowledgeBases;
17059 type Credentials = gaxi::options::Credentials;
17060 async fn build(
17061 self,
17062 config: gaxi::options::ClientConfig,
17063 ) -> crate::ClientBuilderResult<Self::Client> {
17064 Self::Client::new(config).await
17065 }
17066 }
17067 }
17068
17069 #[derive(Clone, Debug)]
17071 pub(crate) struct RequestBuilder<R: std::default::Default> {
17072 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17073 request: R,
17074 options: crate::RequestOptions,
17075 }
17076
17077 impl<R> RequestBuilder<R>
17078 where
17079 R: std::default::Default,
17080 {
17081 pub(crate) fn new(
17082 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17083 ) -> Self {
17084 Self {
17085 stub,
17086 request: R::default(),
17087 options: crate::RequestOptions::default(),
17088 }
17089 }
17090 }
17091
17092 #[derive(Clone, Debug)]
17113 pub struct ListKnowledgeBases(RequestBuilder<crate::model::ListKnowledgeBasesRequest>);
17114
17115 impl ListKnowledgeBases {
17116 pub(crate) fn new(
17117 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17118 ) -> Self {
17119 Self(RequestBuilder::new(stub))
17120 }
17121
17122 pub fn with_request<V: Into<crate::model::ListKnowledgeBasesRequest>>(
17124 mut self,
17125 v: V,
17126 ) -> Self {
17127 self.0.request = v.into();
17128 self
17129 }
17130
17131 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17133 self.0.options = v.into();
17134 self
17135 }
17136
17137 pub async fn send(self) -> Result<crate::model::ListKnowledgeBasesResponse> {
17139 (*self.0.stub)
17140 .list_knowledge_bases(self.0.request, self.0.options)
17141 .await
17142 .map(crate::Response::into_body)
17143 }
17144
17145 pub fn by_page(
17147 self,
17148 ) -> impl google_cloud_gax::paginator::Paginator<
17149 crate::model::ListKnowledgeBasesResponse,
17150 crate::Error,
17151 > {
17152 use std::clone::Clone;
17153 let token = self.0.request.page_token.clone();
17154 let execute = move |token: String| {
17155 let mut builder = self.clone();
17156 builder.0.request = builder.0.request.set_page_token(token);
17157 builder.send()
17158 };
17159 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17160 }
17161
17162 pub fn by_item(
17164 self,
17165 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17166 crate::model::ListKnowledgeBasesResponse,
17167 crate::Error,
17168 > {
17169 use google_cloud_gax::paginator::Paginator;
17170 self.by_page().items()
17171 }
17172
17173 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17177 self.0.request.parent = v.into();
17178 self
17179 }
17180
17181 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17183 self.0.request.page_size = v.into();
17184 self
17185 }
17186
17187 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17189 self.0.request.page_token = v.into();
17190 self
17191 }
17192
17193 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17195 self.0.request.filter = v.into();
17196 self
17197 }
17198 }
17199
17200 #[doc(hidden)]
17201 impl crate::RequestBuilder for ListKnowledgeBases {
17202 fn request_options(&mut self) -> &mut crate::RequestOptions {
17203 &mut self.0.options
17204 }
17205 }
17206
17207 #[derive(Clone, Debug)]
17224 pub struct GetKnowledgeBase(RequestBuilder<crate::model::GetKnowledgeBaseRequest>);
17225
17226 impl GetKnowledgeBase {
17227 pub(crate) fn new(
17228 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17229 ) -> Self {
17230 Self(RequestBuilder::new(stub))
17231 }
17232
17233 pub fn with_request<V: Into<crate::model::GetKnowledgeBaseRequest>>(
17235 mut self,
17236 v: V,
17237 ) -> Self {
17238 self.0.request = v.into();
17239 self
17240 }
17241
17242 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17244 self.0.options = v.into();
17245 self
17246 }
17247
17248 pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17250 (*self.0.stub)
17251 .get_knowledge_base(self.0.request, self.0.options)
17252 .await
17253 .map(crate::Response::into_body)
17254 }
17255
17256 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17260 self.0.request.name = v.into();
17261 self
17262 }
17263 }
17264
17265 #[doc(hidden)]
17266 impl crate::RequestBuilder for GetKnowledgeBase {
17267 fn request_options(&mut self) -> &mut crate::RequestOptions {
17268 &mut self.0.options
17269 }
17270 }
17271
17272 #[derive(Clone, Debug)]
17289 pub struct CreateKnowledgeBase(RequestBuilder<crate::model::CreateKnowledgeBaseRequest>);
17290
17291 impl CreateKnowledgeBase {
17292 pub(crate) fn new(
17293 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17294 ) -> Self {
17295 Self(RequestBuilder::new(stub))
17296 }
17297
17298 pub fn with_request<V: Into<crate::model::CreateKnowledgeBaseRequest>>(
17300 mut self,
17301 v: V,
17302 ) -> Self {
17303 self.0.request = v.into();
17304 self
17305 }
17306
17307 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17309 self.0.options = v.into();
17310 self
17311 }
17312
17313 pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17315 (*self.0.stub)
17316 .create_knowledge_base(self.0.request, self.0.options)
17317 .await
17318 .map(crate::Response::into_body)
17319 }
17320
17321 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
17325 self.0.request.parent = v.into();
17326 self
17327 }
17328
17329 pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17333 where
17334 T: std::convert::Into<crate::model::KnowledgeBase>,
17335 {
17336 self.0.request.knowledge_base = std::option::Option::Some(v.into());
17337 self
17338 }
17339
17340 pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17344 where
17345 T: std::convert::Into<crate::model::KnowledgeBase>,
17346 {
17347 self.0.request.knowledge_base = v.map(|x| x.into());
17348 self
17349 }
17350 }
17351
17352 #[doc(hidden)]
17353 impl crate::RequestBuilder for CreateKnowledgeBase {
17354 fn request_options(&mut self) -> &mut crate::RequestOptions {
17355 &mut self.0.options
17356 }
17357 }
17358
17359 #[derive(Clone, Debug)]
17376 pub struct DeleteKnowledgeBase(RequestBuilder<crate::model::DeleteKnowledgeBaseRequest>);
17377
17378 impl DeleteKnowledgeBase {
17379 pub(crate) fn new(
17380 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17381 ) -> Self {
17382 Self(RequestBuilder::new(stub))
17383 }
17384
17385 pub fn with_request<V: Into<crate::model::DeleteKnowledgeBaseRequest>>(
17387 mut self,
17388 v: V,
17389 ) -> Self {
17390 self.0.request = v.into();
17391 self
17392 }
17393
17394 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17396 self.0.options = v.into();
17397 self
17398 }
17399
17400 pub async fn send(self) -> Result<()> {
17402 (*self.0.stub)
17403 .delete_knowledge_base(self.0.request, self.0.options)
17404 .await
17405 .map(crate::Response::into_body)
17406 }
17407
17408 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17412 self.0.request.name = v.into();
17413 self
17414 }
17415
17416 pub fn set_force<T: Into<bool>>(mut self, v: T) -> Self {
17418 self.0.request.force = v.into();
17419 self
17420 }
17421 }
17422
17423 #[doc(hidden)]
17424 impl crate::RequestBuilder for DeleteKnowledgeBase {
17425 fn request_options(&mut self) -> &mut crate::RequestOptions {
17426 &mut self.0.options
17427 }
17428 }
17429
17430 #[derive(Clone, Debug)]
17447 pub struct UpdateKnowledgeBase(RequestBuilder<crate::model::UpdateKnowledgeBaseRequest>);
17448
17449 impl UpdateKnowledgeBase {
17450 pub(crate) fn new(
17451 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17452 ) -> Self {
17453 Self(RequestBuilder::new(stub))
17454 }
17455
17456 pub fn with_request<V: Into<crate::model::UpdateKnowledgeBaseRequest>>(
17458 mut self,
17459 v: V,
17460 ) -> Self {
17461 self.0.request = v.into();
17462 self
17463 }
17464
17465 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17467 self.0.options = v.into();
17468 self
17469 }
17470
17471 pub async fn send(self) -> Result<crate::model::KnowledgeBase> {
17473 (*self.0.stub)
17474 .update_knowledge_base(self.0.request, self.0.options)
17475 .await
17476 .map(crate::Response::into_body)
17477 }
17478
17479 pub fn set_knowledge_base<T>(mut self, v: T) -> Self
17483 where
17484 T: std::convert::Into<crate::model::KnowledgeBase>,
17485 {
17486 self.0.request.knowledge_base = std::option::Option::Some(v.into());
17487 self
17488 }
17489
17490 pub fn set_or_clear_knowledge_base<T>(mut self, v: std::option::Option<T>) -> Self
17494 where
17495 T: std::convert::Into<crate::model::KnowledgeBase>,
17496 {
17497 self.0.request.knowledge_base = v.map(|x| x.into());
17498 self
17499 }
17500
17501 pub fn set_update_mask<T>(mut self, v: T) -> Self
17503 where
17504 T: std::convert::Into<wkt::FieldMask>,
17505 {
17506 self.0.request.update_mask = std::option::Option::Some(v.into());
17507 self
17508 }
17509
17510 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
17512 where
17513 T: std::convert::Into<wkt::FieldMask>,
17514 {
17515 self.0.request.update_mask = v.map(|x| x.into());
17516 self
17517 }
17518 }
17519
17520 #[doc(hidden)]
17521 impl crate::RequestBuilder for UpdateKnowledgeBase {
17522 fn request_options(&mut self) -> &mut crate::RequestOptions {
17523 &mut self.0.options
17524 }
17525 }
17526
17527 #[derive(Clone, Debug)]
17548 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
17549
17550 impl ListLocations {
17551 pub(crate) fn new(
17552 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17553 ) -> Self {
17554 Self(RequestBuilder::new(stub))
17555 }
17556
17557 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
17559 mut self,
17560 v: V,
17561 ) -> Self {
17562 self.0.request = v.into();
17563 self
17564 }
17565
17566 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17568 self.0.options = v.into();
17569 self
17570 }
17571
17572 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
17574 (*self.0.stub)
17575 .list_locations(self.0.request, self.0.options)
17576 .await
17577 .map(crate::Response::into_body)
17578 }
17579
17580 pub fn by_page(
17582 self,
17583 ) -> impl google_cloud_gax::paginator::Paginator<
17584 google_cloud_location::model::ListLocationsResponse,
17585 crate::Error,
17586 > {
17587 use std::clone::Clone;
17588 let token = self.0.request.page_token.clone();
17589 let execute = move |token: String| {
17590 let mut builder = self.clone();
17591 builder.0.request = builder.0.request.set_page_token(token);
17592 builder.send()
17593 };
17594 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17595 }
17596
17597 pub fn by_item(
17599 self,
17600 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17601 google_cloud_location::model::ListLocationsResponse,
17602 crate::Error,
17603 > {
17604 use google_cloud_gax::paginator::Paginator;
17605 self.by_page().items()
17606 }
17607
17608 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17610 self.0.request.name = v.into();
17611 self
17612 }
17613
17614 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17616 self.0.request.filter = v.into();
17617 self
17618 }
17619
17620 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17622 self.0.request.page_size = v.into();
17623 self
17624 }
17625
17626 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17628 self.0.request.page_token = v.into();
17629 self
17630 }
17631 }
17632
17633 #[doc(hidden)]
17634 impl crate::RequestBuilder for ListLocations {
17635 fn request_options(&mut self) -> &mut crate::RequestOptions {
17636 &mut self.0.options
17637 }
17638 }
17639
17640 #[derive(Clone, Debug)]
17657 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
17658
17659 impl GetLocation {
17660 pub(crate) fn new(
17661 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17662 ) -> Self {
17663 Self(RequestBuilder::new(stub))
17664 }
17665
17666 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
17668 mut self,
17669 v: V,
17670 ) -> Self {
17671 self.0.request = v.into();
17672 self
17673 }
17674
17675 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17677 self.0.options = v.into();
17678 self
17679 }
17680
17681 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
17683 (*self.0.stub)
17684 .get_location(self.0.request, self.0.options)
17685 .await
17686 .map(crate::Response::into_body)
17687 }
17688
17689 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17691 self.0.request.name = v.into();
17692 self
17693 }
17694 }
17695
17696 #[doc(hidden)]
17697 impl crate::RequestBuilder for GetLocation {
17698 fn request_options(&mut self) -> &mut crate::RequestOptions {
17699 &mut self.0.options
17700 }
17701 }
17702
17703 #[derive(Clone, Debug)]
17724 pub struct ListOperations(
17725 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
17726 );
17727
17728 impl ListOperations {
17729 pub(crate) fn new(
17730 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17731 ) -> Self {
17732 Self(RequestBuilder::new(stub))
17733 }
17734
17735 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
17737 mut self,
17738 v: V,
17739 ) -> Self {
17740 self.0.request = v.into();
17741 self
17742 }
17743
17744 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17746 self.0.options = v.into();
17747 self
17748 }
17749
17750 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
17752 (*self.0.stub)
17753 .list_operations(self.0.request, self.0.options)
17754 .await
17755 .map(crate::Response::into_body)
17756 }
17757
17758 pub fn by_page(
17760 self,
17761 ) -> impl google_cloud_gax::paginator::Paginator<
17762 google_cloud_longrunning::model::ListOperationsResponse,
17763 crate::Error,
17764 > {
17765 use std::clone::Clone;
17766 let token = self.0.request.page_token.clone();
17767 let execute = move |token: String| {
17768 let mut builder = self.clone();
17769 builder.0.request = builder.0.request.set_page_token(token);
17770 builder.send()
17771 };
17772 google_cloud_gax::paginator::internal::new_paginator(token, execute)
17773 }
17774
17775 pub fn by_item(
17777 self,
17778 ) -> impl google_cloud_gax::paginator::ItemPaginator<
17779 google_cloud_longrunning::model::ListOperationsResponse,
17780 crate::Error,
17781 > {
17782 use google_cloud_gax::paginator::Paginator;
17783 self.by_page().items()
17784 }
17785
17786 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17788 self.0.request.name = v.into();
17789 self
17790 }
17791
17792 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
17794 self.0.request.filter = v.into();
17795 self
17796 }
17797
17798 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
17800 self.0.request.page_size = v.into();
17801 self
17802 }
17803
17804 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
17806 self.0.request.page_token = v.into();
17807 self
17808 }
17809
17810 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
17812 self.0.request.return_partial_success = v.into();
17813 self
17814 }
17815 }
17816
17817 #[doc(hidden)]
17818 impl crate::RequestBuilder for ListOperations {
17819 fn request_options(&mut self) -> &mut crate::RequestOptions {
17820 &mut self.0.options
17821 }
17822 }
17823
17824 #[derive(Clone, Debug)]
17841 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
17842
17843 impl GetOperation {
17844 pub(crate) fn new(
17845 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17846 ) -> Self {
17847 Self(RequestBuilder::new(stub))
17848 }
17849
17850 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
17852 mut self,
17853 v: V,
17854 ) -> Self {
17855 self.0.request = v.into();
17856 self
17857 }
17858
17859 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17861 self.0.options = v.into();
17862 self
17863 }
17864
17865 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
17867 (*self.0.stub)
17868 .get_operation(self.0.request, self.0.options)
17869 .await
17870 .map(crate::Response::into_body)
17871 }
17872
17873 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17875 self.0.request.name = v.into();
17876 self
17877 }
17878 }
17879
17880 #[doc(hidden)]
17881 impl crate::RequestBuilder for GetOperation {
17882 fn request_options(&mut self) -> &mut crate::RequestOptions {
17883 &mut self.0.options
17884 }
17885 }
17886
17887 #[derive(Clone, Debug)]
17904 pub struct CancelOperation(
17905 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
17906 );
17907
17908 impl CancelOperation {
17909 pub(crate) fn new(
17910 stub: std::sync::Arc<dyn super::super::stub::dynamic::KnowledgeBases>,
17911 ) -> Self {
17912 Self(RequestBuilder::new(stub))
17913 }
17914
17915 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
17917 mut self,
17918 v: V,
17919 ) -> Self {
17920 self.0.request = v.into();
17921 self
17922 }
17923
17924 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
17926 self.0.options = v.into();
17927 self
17928 }
17929
17930 pub async fn send(self) -> Result<()> {
17932 (*self.0.stub)
17933 .cancel_operation(self.0.request, self.0.options)
17934 .await
17935 .map(crate::Response::into_body)
17936 }
17937
17938 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
17940 self.0.request.name = v.into();
17941 self
17942 }
17943 }
17944
17945 #[doc(hidden)]
17946 impl crate::RequestBuilder for CancelOperation {
17947 fn request_options(&mut self) -> &mut crate::RequestOptions {
17948 &mut self.0.options
17949 }
17950 }
17951}
17952
17953#[cfg(feature = "participants")]
17955#[cfg_attr(docsrs, doc(cfg(feature = "participants")))]
17956pub mod participants {
17957 use crate::Result;
17958
17959 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
17973
17974 pub(crate) mod client {
17975 use super::super::super::client::Participants;
17976 pub struct Factory;
17977 impl crate::ClientFactory for Factory {
17978 type Client = Participants;
17979 type Credentials = gaxi::options::Credentials;
17980 async fn build(
17981 self,
17982 config: gaxi::options::ClientConfig,
17983 ) -> crate::ClientBuilderResult<Self::Client> {
17984 Self::Client::new(config).await
17985 }
17986 }
17987 }
17988
17989 #[derive(Clone, Debug)]
17991 pub(crate) struct RequestBuilder<R: std::default::Default> {
17992 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
17993 request: R,
17994 options: crate::RequestOptions,
17995 }
17996
17997 impl<R> RequestBuilder<R>
17998 where
17999 R: std::default::Default,
18000 {
18001 pub(crate) fn new(
18002 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18003 ) -> Self {
18004 Self {
18005 stub,
18006 request: R::default(),
18007 options: crate::RequestOptions::default(),
18008 }
18009 }
18010 }
18011
18012 #[derive(Clone, Debug)]
18029 pub struct CreateParticipant(RequestBuilder<crate::model::CreateParticipantRequest>);
18030
18031 impl CreateParticipant {
18032 pub(crate) fn new(
18033 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18034 ) -> Self {
18035 Self(RequestBuilder::new(stub))
18036 }
18037
18038 pub fn with_request<V: Into<crate::model::CreateParticipantRequest>>(
18040 mut self,
18041 v: V,
18042 ) -> Self {
18043 self.0.request = v.into();
18044 self
18045 }
18046
18047 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18049 self.0.options = v.into();
18050 self
18051 }
18052
18053 pub async fn send(self) -> Result<crate::model::Participant> {
18055 (*self.0.stub)
18056 .create_participant(self.0.request, self.0.options)
18057 .await
18058 .map(crate::Response::into_body)
18059 }
18060
18061 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18065 self.0.request.parent = v.into();
18066 self
18067 }
18068
18069 pub fn set_participant<T>(mut self, v: T) -> Self
18073 where
18074 T: std::convert::Into<crate::model::Participant>,
18075 {
18076 self.0.request.participant = std::option::Option::Some(v.into());
18077 self
18078 }
18079
18080 pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
18084 where
18085 T: std::convert::Into<crate::model::Participant>,
18086 {
18087 self.0.request.participant = v.map(|x| x.into());
18088 self
18089 }
18090 }
18091
18092 #[doc(hidden)]
18093 impl crate::RequestBuilder for CreateParticipant {
18094 fn request_options(&mut self) -> &mut crate::RequestOptions {
18095 &mut self.0.options
18096 }
18097 }
18098
18099 #[derive(Clone, Debug)]
18116 pub struct GetParticipant(RequestBuilder<crate::model::GetParticipantRequest>);
18117
18118 impl GetParticipant {
18119 pub(crate) fn new(
18120 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18121 ) -> Self {
18122 Self(RequestBuilder::new(stub))
18123 }
18124
18125 pub fn with_request<V: Into<crate::model::GetParticipantRequest>>(mut self, v: V) -> Self {
18127 self.0.request = v.into();
18128 self
18129 }
18130
18131 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18133 self.0.options = v.into();
18134 self
18135 }
18136
18137 pub async fn send(self) -> Result<crate::model::Participant> {
18139 (*self.0.stub)
18140 .get_participant(self.0.request, self.0.options)
18141 .await
18142 .map(crate::Response::into_body)
18143 }
18144
18145 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
18149 self.0.request.name = v.into();
18150 self
18151 }
18152 }
18153
18154 #[doc(hidden)]
18155 impl crate::RequestBuilder for GetParticipant {
18156 fn request_options(&mut self) -> &mut crate::RequestOptions {
18157 &mut self.0.options
18158 }
18159 }
18160
18161 #[derive(Clone, Debug)]
18182 pub struct ListParticipants(RequestBuilder<crate::model::ListParticipantsRequest>);
18183
18184 impl ListParticipants {
18185 pub(crate) fn new(
18186 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18187 ) -> Self {
18188 Self(RequestBuilder::new(stub))
18189 }
18190
18191 pub fn with_request<V: Into<crate::model::ListParticipantsRequest>>(
18193 mut self,
18194 v: V,
18195 ) -> Self {
18196 self.0.request = v.into();
18197 self
18198 }
18199
18200 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18202 self.0.options = v.into();
18203 self
18204 }
18205
18206 pub async fn send(self) -> Result<crate::model::ListParticipantsResponse> {
18208 (*self.0.stub)
18209 .list_participants(self.0.request, self.0.options)
18210 .await
18211 .map(crate::Response::into_body)
18212 }
18213
18214 pub fn by_page(
18216 self,
18217 ) -> impl google_cloud_gax::paginator::Paginator<
18218 crate::model::ListParticipantsResponse,
18219 crate::Error,
18220 > {
18221 use std::clone::Clone;
18222 let token = self.0.request.page_token.clone();
18223 let execute = move |token: String| {
18224 let mut builder = self.clone();
18225 builder.0.request = builder.0.request.set_page_token(token);
18226 builder.send()
18227 };
18228 google_cloud_gax::paginator::internal::new_paginator(token, execute)
18229 }
18230
18231 pub fn by_item(
18233 self,
18234 ) -> impl google_cloud_gax::paginator::ItemPaginator<
18235 crate::model::ListParticipantsResponse,
18236 crate::Error,
18237 > {
18238 use google_cloud_gax::paginator::Paginator;
18239 self.by_page().items()
18240 }
18241
18242 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18246 self.0.request.parent = v.into();
18247 self
18248 }
18249
18250 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
18252 self.0.request.page_size = v.into();
18253 self
18254 }
18255
18256 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
18258 self.0.request.page_token = v.into();
18259 self
18260 }
18261 }
18262
18263 #[doc(hidden)]
18264 impl crate::RequestBuilder for ListParticipants {
18265 fn request_options(&mut self) -> &mut crate::RequestOptions {
18266 &mut self.0.options
18267 }
18268 }
18269
18270 #[derive(Clone, Debug)]
18287 pub struct UpdateParticipant(RequestBuilder<crate::model::UpdateParticipantRequest>);
18288
18289 impl UpdateParticipant {
18290 pub(crate) fn new(
18291 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18292 ) -> Self {
18293 Self(RequestBuilder::new(stub))
18294 }
18295
18296 pub fn with_request<V: Into<crate::model::UpdateParticipantRequest>>(
18298 mut self,
18299 v: V,
18300 ) -> Self {
18301 self.0.request = v.into();
18302 self
18303 }
18304
18305 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18307 self.0.options = v.into();
18308 self
18309 }
18310
18311 pub async fn send(self) -> Result<crate::model::Participant> {
18313 (*self.0.stub)
18314 .update_participant(self.0.request, self.0.options)
18315 .await
18316 .map(crate::Response::into_body)
18317 }
18318
18319 pub fn set_participant<T>(mut self, v: T) -> Self
18323 where
18324 T: std::convert::Into<crate::model::Participant>,
18325 {
18326 self.0.request.participant = std::option::Option::Some(v.into());
18327 self
18328 }
18329
18330 pub fn set_or_clear_participant<T>(mut self, v: std::option::Option<T>) -> Self
18334 where
18335 T: std::convert::Into<crate::model::Participant>,
18336 {
18337 self.0.request.participant = v.map(|x| x.into());
18338 self
18339 }
18340
18341 pub fn set_update_mask<T>(mut self, v: T) -> Self
18345 where
18346 T: std::convert::Into<wkt::FieldMask>,
18347 {
18348 self.0.request.update_mask = std::option::Option::Some(v.into());
18349 self
18350 }
18351
18352 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
18356 where
18357 T: std::convert::Into<wkt::FieldMask>,
18358 {
18359 self.0.request.update_mask = v.map(|x| x.into());
18360 self
18361 }
18362 }
18363
18364 #[doc(hidden)]
18365 impl crate::RequestBuilder for UpdateParticipant {
18366 fn request_options(&mut self) -> &mut crate::RequestOptions {
18367 &mut self.0.options
18368 }
18369 }
18370
18371 #[derive(Clone, Debug)]
18388 pub struct AnalyzeContent(RequestBuilder<crate::model::AnalyzeContentRequest>);
18389
18390 impl AnalyzeContent {
18391 pub(crate) fn new(
18392 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18393 ) -> Self {
18394 Self(RequestBuilder::new(stub))
18395 }
18396
18397 pub fn with_request<V: Into<crate::model::AnalyzeContentRequest>>(mut self, v: V) -> Self {
18399 self.0.request = v.into();
18400 self
18401 }
18402
18403 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18405 self.0.options = v.into();
18406 self
18407 }
18408
18409 pub async fn send(self) -> Result<crate::model::AnalyzeContentResponse> {
18411 (*self.0.stub)
18412 .analyze_content(self.0.request, self.0.options)
18413 .await
18414 .map(crate::Response::into_body)
18415 }
18416
18417 pub fn set_participant<T: Into<std::string::String>>(mut self, v: T) -> Self {
18421 self.0.request.participant = v.into();
18422 self
18423 }
18424
18425 pub fn set_reply_audio_config<T>(mut self, v: T) -> Self
18427 where
18428 T: std::convert::Into<crate::model::OutputAudioConfig>,
18429 {
18430 self.0.request.reply_audio_config = std::option::Option::Some(v.into());
18431 self
18432 }
18433
18434 pub fn set_or_clear_reply_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
18436 where
18437 T: std::convert::Into<crate::model::OutputAudioConfig>,
18438 {
18439 self.0.request.reply_audio_config = v.map(|x| x.into());
18440 self
18441 }
18442
18443 pub fn set_query_params<T>(mut self, v: T) -> Self
18445 where
18446 T: std::convert::Into<crate::model::QueryParameters>,
18447 {
18448 self.0.request.query_params = std::option::Option::Some(v.into());
18449 self
18450 }
18451
18452 pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18454 where
18455 T: std::convert::Into<crate::model::QueryParameters>,
18456 {
18457 self.0.request.query_params = v.map(|x| x.into());
18458 self
18459 }
18460
18461 pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18463 where
18464 T: std::convert::Into<crate::model::AssistQueryParameters>,
18465 {
18466 self.0.request.assist_query_params = std::option::Option::Some(v.into());
18467 self
18468 }
18469
18470 pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18472 where
18473 T: std::convert::Into<crate::model::AssistQueryParameters>,
18474 {
18475 self.0.request.assist_query_params = v.map(|x| x.into());
18476 self
18477 }
18478
18479 pub fn set_cx_parameters<T>(mut self, v: T) -> Self
18481 where
18482 T: std::convert::Into<wkt::Struct>,
18483 {
18484 self.0.request.cx_parameters = std::option::Option::Some(v.into());
18485 self
18486 }
18487
18488 pub fn set_or_clear_cx_parameters<T>(mut self, v: std::option::Option<T>) -> Self
18490 where
18491 T: std::convert::Into<wkt::Struct>,
18492 {
18493 self.0.request.cx_parameters = v.map(|x| x.into());
18494 self
18495 }
18496
18497 pub fn set_request_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
18499 self.0.request.request_id = v.into();
18500 self
18501 }
18502
18503 pub fn set_input<T: Into<Option<crate::model::analyze_content_request::Input>>>(
18508 mut self,
18509 v: T,
18510 ) -> Self {
18511 self.0.request.input = v.into();
18512 self
18513 }
18514
18515 pub fn set_text_input<T: std::convert::Into<std::boxed::Box<crate::model::TextInput>>>(
18521 mut self,
18522 v: T,
18523 ) -> Self {
18524 self.0.request = self.0.request.set_text_input(v);
18525 self
18526 }
18527
18528 pub fn set_audio_input<T: std::convert::Into<std::boxed::Box<crate::model::AudioInput>>>(
18534 mut self,
18535 v: T,
18536 ) -> Self {
18537 self.0.request = self.0.request.set_audio_input(v);
18538 self
18539 }
18540
18541 pub fn set_event_input<T: std::convert::Into<std::boxed::Box<crate::model::EventInput>>>(
18547 mut self,
18548 v: T,
18549 ) -> Self {
18550 self.0.request = self.0.request.set_event_input(v);
18551 self
18552 }
18553
18554 pub fn set_suggestion_input<
18560 T: std::convert::Into<std::boxed::Box<crate::model::SuggestionInput>>,
18561 >(
18562 mut self,
18563 v: T,
18564 ) -> Self {
18565 self.0.request = self.0.request.set_suggestion_input(v);
18566 self
18567 }
18568 }
18569
18570 #[doc(hidden)]
18571 impl crate::RequestBuilder for AnalyzeContent {
18572 fn request_options(&mut self) -> &mut crate::RequestOptions {
18573 &mut self.0.options
18574 }
18575 }
18576
18577 #[derive(Clone, Debug)]
18594 pub struct SuggestArticles(RequestBuilder<crate::model::SuggestArticlesRequest>);
18595
18596 impl SuggestArticles {
18597 pub(crate) fn new(
18598 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18599 ) -> Self {
18600 Self(RequestBuilder::new(stub))
18601 }
18602
18603 pub fn with_request<V: Into<crate::model::SuggestArticlesRequest>>(mut self, v: V) -> Self {
18605 self.0.request = v.into();
18606 self
18607 }
18608
18609 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18611 self.0.options = v.into();
18612 self
18613 }
18614
18615 pub async fn send(self) -> Result<crate::model::SuggestArticlesResponse> {
18617 (*self.0.stub)
18618 .suggest_articles(self.0.request, self.0.options)
18619 .await
18620 .map(crate::Response::into_body)
18621 }
18622
18623 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18627 self.0.request.parent = v.into();
18628 self
18629 }
18630
18631 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18633 self.0.request.latest_message = v.into();
18634 self
18635 }
18636
18637 pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18639 self.0.request.context_size = v.into();
18640 self
18641 }
18642
18643 pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18645 where
18646 T: std::convert::Into<crate::model::AssistQueryParameters>,
18647 {
18648 self.0.request.assist_query_params = std::option::Option::Some(v.into());
18649 self
18650 }
18651
18652 pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18654 where
18655 T: std::convert::Into<crate::model::AssistQueryParameters>,
18656 {
18657 self.0.request.assist_query_params = v.map(|x| x.into());
18658 self
18659 }
18660 }
18661
18662 #[doc(hidden)]
18663 impl crate::RequestBuilder for SuggestArticles {
18664 fn request_options(&mut self) -> &mut crate::RequestOptions {
18665 &mut self.0.options
18666 }
18667 }
18668
18669 #[derive(Clone, Debug)]
18686 pub struct SuggestFaqAnswers(RequestBuilder<crate::model::SuggestFaqAnswersRequest>);
18687
18688 impl SuggestFaqAnswers {
18689 pub(crate) fn new(
18690 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18691 ) -> Self {
18692 Self(RequestBuilder::new(stub))
18693 }
18694
18695 pub fn with_request<V: Into<crate::model::SuggestFaqAnswersRequest>>(
18697 mut self,
18698 v: V,
18699 ) -> Self {
18700 self.0.request = v.into();
18701 self
18702 }
18703
18704 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18706 self.0.options = v.into();
18707 self
18708 }
18709
18710 pub async fn send(self) -> Result<crate::model::SuggestFaqAnswersResponse> {
18712 (*self.0.stub)
18713 .suggest_faq_answers(self.0.request, self.0.options)
18714 .await
18715 .map(crate::Response::into_body)
18716 }
18717
18718 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18722 self.0.request.parent = v.into();
18723 self
18724 }
18725
18726 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18728 self.0.request.latest_message = v.into();
18729 self
18730 }
18731
18732 pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18734 self.0.request.context_size = v.into();
18735 self
18736 }
18737
18738 pub fn set_assist_query_params<T>(mut self, v: T) -> Self
18740 where
18741 T: std::convert::Into<crate::model::AssistQueryParameters>,
18742 {
18743 self.0.request.assist_query_params = std::option::Option::Some(v.into());
18744 self
18745 }
18746
18747 pub fn set_or_clear_assist_query_params<T>(mut self, v: std::option::Option<T>) -> Self
18749 where
18750 T: std::convert::Into<crate::model::AssistQueryParameters>,
18751 {
18752 self.0.request.assist_query_params = v.map(|x| x.into());
18753 self
18754 }
18755 }
18756
18757 #[doc(hidden)]
18758 impl crate::RequestBuilder for SuggestFaqAnswers {
18759 fn request_options(&mut self) -> &mut crate::RequestOptions {
18760 &mut self.0.options
18761 }
18762 }
18763
18764 #[derive(Clone, Debug)]
18781 pub struct SuggestSmartReplies(RequestBuilder<crate::model::SuggestSmartRepliesRequest>);
18782
18783 impl SuggestSmartReplies {
18784 pub(crate) fn new(
18785 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18786 ) -> Self {
18787 Self(RequestBuilder::new(stub))
18788 }
18789
18790 pub fn with_request<V: Into<crate::model::SuggestSmartRepliesRequest>>(
18792 mut self,
18793 v: V,
18794 ) -> Self {
18795 self.0.request = v.into();
18796 self
18797 }
18798
18799 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18801 self.0.options = v.into();
18802 self
18803 }
18804
18805 pub async fn send(self) -> Result<crate::model::SuggestSmartRepliesResponse> {
18807 (*self.0.stub)
18808 .suggest_smart_replies(self.0.request, self.0.options)
18809 .await
18810 .map(crate::Response::into_body)
18811 }
18812
18813 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18817 self.0.request.parent = v.into();
18818 self
18819 }
18820
18821 pub fn set_current_text_input<T>(mut self, v: T) -> Self
18823 where
18824 T: std::convert::Into<crate::model::TextInput>,
18825 {
18826 self.0.request.current_text_input = std::option::Option::Some(v.into());
18827 self
18828 }
18829
18830 pub fn set_or_clear_current_text_input<T>(mut self, v: std::option::Option<T>) -> Self
18832 where
18833 T: std::convert::Into<crate::model::TextInput>,
18834 {
18835 self.0.request.current_text_input = v.map(|x| x.into());
18836 self
18837 }
18838
18839 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18841 self.0.request.latest_message = v.into();
18842 self
18843 }
18844
18845 pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18847 self.0.request.context_size = v.into();
18848 self
18849 }
18850 }
18851
18852 #[doc(hidden)]
18853 impl crate::RequestBuilder for SuggestSmartReplies {
18854 fn request_options(&mut self) -> &mut crate::RequestOptions {
18855 &mut self.0.options
18856 }
18857 }
18858
18859 #[derive(Clone, Debug)]
18876 pub struct SuggestKnowledgeAssist(RequestBuilder<crate::model::SuggestKnowledgeAssistRequest>);
18877
18878 impl SuggestKnowledgeAssist {
18879 pub(crate) fn new(
18880 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18881 ) -> Self {
18882 Self(RequestBuilder::new(stub))
18883 }
18884
18885 pub fn with_request<V: Into<crate::model::SuggestKnowledgeAssistRequest>>(
18887 mut self,
18888 v: V,
18889 ) -> Self {
18890 self.0.request = v.into();
18891 self
18892 }
18893
18894 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18896 self.0.options = v.into();
18897 self
18898 }
18899
18900 pub async fn send(self) -> Result<crate::model::SuggestKnowledgeAssistResponse> {
18902 (*self.0.stub)
18903 .suggest_knowledge_assist(self.0.request, self.0.options)
18904 .await
18905 .map(crate::Response::into_body)
18906 }
18907
18908 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
18912 self.0.request.parent = v.into();
18913 self
18914 }
18915
18916 pub fn set_latest_message<T: Into<std::string::String>>(mut self, v: T) -> Self {
18918 self.0.request.latest_message = v.into();
18919 self
18920 }
18921
18922 pub fn set_context_size<T: Into<i32>>(mut self, v: T) -> Self {
18924 self.0.request.context_size = v.into();
18925 self
18926 }
18927
18928 pub fn set_previous_suggested_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
18930 self.0.request.previous_suggested_query = v.into();
18931 self
18932 }
18933 }
18934
18935 #[doc(hidden)]
18936 impl crate::RequestBuilder for SuggestKnowledgeAssist {
18937 fn request_options(&mut self) -> &mut crate::RequestOptions {
18938 &mut self.0.options
18939 }
18940 }
18941
18942 #[derive(Clone, Debug)]
18963 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
18964
18965 impl ListLocations {
18966 pub(crate) fn new(
18967 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
18968 ) -> Self {
18969 Self(RequestBuilder::new(stub))
18970 }
18971
18972 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
18974 mut self,
18975 v: V,
18976 ) -> Self {
18977 self.0.request = v.into();
18978 self
18979 }
18980
18981 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
18983 self.0.options = v.into();
18984 self
18985 }
18986
18987 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
18989 (*self.0.stub)
18990 .list_locations(self.0.request, self.0.options)
18991 .await
18992 .map(crate::Response::into_body)
18993 }
18994
18995 pub fn by_page(
18997 self,
18998 ) -> impl google_cloud_gax::paginator::Paginator<
18999 google_cloud_location::model::ListLocationsResponse,
19000 crate::Error,
19001 > {
19002 use std::clone::Clone;
19003 let token = self.0.request.page_token.clone();
19004 let execute = move |token: String| {
19005 let mut builder = self.clone();
19006 builder.0.request = builder.0.request.set_page_token(token);
19007 builder.send()
19008 };
19009 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19010 }
19011
19012 pub fn by_item(
19014 self,
19015 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19016 google_cloud_location::model::ListLocationsResponse,
19017 crate::Error,
19018 > {
19019 use google_cloud_gax::paginator::Paginator;
19020 self.by_page().items()
19021 }
19022
19023 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19025 self.0.request.name = v.into();
19026 self
19027 }
19028
19029 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19031 self.0.request.filter = v.into();
19032 self
19033 }
19034
19035 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19037 self.0.request.page_size = v.into();
19038 self
19039 }
19040
19041 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19043 self.0.request.page_token = v.into();
19044 self
19045 }
19046 }
19047
19048 #[doc(hidden)]
19049 impl crate::RequestBuilder for ListLocations {
19050 fn request_options(&mut self) -> &mut crate::RequestOptions {
19051 &mut self.0.options
19052 }
19053 }
19054
19055 #[derive(Clone, Debug)]
19072 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19073
19074 impl GetLocation {
19075 pub(crate) fn new(
19076 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19077 ) -> Self {
19078 Self(RequestBuilder::new(stub))
19079 }
19080
19081 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19083 mut self,
19084 v: V,
19085 ) -> Self {
19086 self.0.request = v.into();
19087 self
19088 }
19089
19090 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19092 self.0.options = v.into();
19093 self
19094 }
19095
19096 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19098 (*self.0.stub)
19099 .get_location(self.0.request, self.0.options)
19100 .await
19101 .map(crate::Response::into_body)
19102 }
19103
19104 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19106 self.0.request.name = v.into();
19107 self
19108 }
19109 }
19110
19111 #[doc(hidden)]
19112 impl crate::RequestBuilder for GetLocation {
19113 fn request_options(&mut self) -> &mut crate::RequestOptions {
19114 &mut self.0.options
19115 }
19116 }
19117
19118 #[derive(Clone, Debug)]
19139 pub struct ListOperations(
19140 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19141 );
19142
19143 impl ListOperations {
19144 pub(crate) fn new(
19145 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19146 ) -> Self {
19147 Self(RequestBuilder::new(stub))
19148 }
19149
19150 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19152 mut self,
19153 v: V,
19154 ) -> Self {
19155 self.0.request = v.into();
19156 self
19157 }
19158
19159 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19161 self.0.options = v.into();
19162 self
19163 }
19164
19165 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19167 (*self.0.stub)
19168 .list_operations(self.0.request, self.0.options)
19169 .await
19170 .map(crate::Response::into_body)
19171 }
19172
19173 pub fn by_page(
19175 self,
19176 ) -> impl google_cloud_gax::paginator::Paginator<
19177 google_cloud_longrunning::model::ListOperationsResponse,
19178 crate::Error,
19179 > {
19180 use std::clone::Clone;
19181 let token = self.0.request.page_token.clone();
19182 let execute = move |token: String| {
19183 let mut builder = self.clone();
19184 builder.0.request = builder.0.request.set_page_token(token);
19185 builder.send()
19186 };
19187 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19188 }
19189
19190 pub fn by_item(
19192 self,
19193 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19194 google_cloud_longrunning::model::ListOperationsResponse,
19195 crate::Error,
19196 > {
19197 use google_cloud_gax::paginator::Paginator;
19198 self.by_page().items()
19199 }
19200
19201 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19203 self.0.request.name = v.into();
19204 self
19205 }
19206
19207 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19209 self.0.request.filter = v.into();
19210 self
19211 }
19212
19213 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19215 self.0.request.page_size = v.into();
19216 self
19217 }
19218
19219 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19221 self.0.request.page_token = v.into();
19222 self
19223 }
19224
19225 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19227 self.0.request.return_partial_success = v.into();
19228 self
19229 }
19230 }
19231
19232 #[doc(hidden)]
19233 impl crate::RequestBuilder for ListOperations {
19234 fn request_options(&mut self) -> &mut crate::RequestOptions {
19235 &mut self.0.options
19236 }
19237 }
19238
19239 #[derive(Clone, Debug)]
19256 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19257
19258 impl GetOperation {
19259 pub(crate) fn new(
19260 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19261 ) -> Self {
19262 Self(RequestBuilder::new(stub))
19263 }
19264
19265 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19267 mut self,
19268 v: V,
19269 ) -> Self {
19270 self.0.request = v.into();
19271 self
19272 }
19273
19274 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19276 self.0.options = v.into();
19277 self
19278 }
19279
19280 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19282 (*self.0.stub)
19283 .get_operation(self.0.request, self.0.options)
19284 .await
19285 .map(crate::Response::into_body)
19286 }
19287
19288 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19290 self.0.request.name = v.into();
19291 self
19292 }
19293 }
19294
19295 #[doc(hidden)]
19296 impl crate::RequestBuilder for GetOperation {
19297 fn request_options(&mut self) -> &mut crate::RequestOptions {
19298 &mut self.0.options
19299 }
19300 }
19301
19302 #[derive(Clone, Debug)]
19319 pub struct CancelOperation(
19320 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19321 );
19322
19323 impl CancelOperation {
19324 pub(crate) fn new(
19325 stub: std::sync::Arc<dyn super::super::stub::dynamic::Participants>,
19326 ) -> Self {
19327 Self(RequestBuilder::new(stub))
19328 }
19329
19330 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19332 mut self,
19333 v: V,
19334 ) -> Self {
19335 self.0.request = v.into();
19336 self
19337 }
19338
19339 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19341 self.0.options = v.into();
19342 self
19343 }
19344
19345 pub async fn send(self) -> Result<()> {
19347 (*self.0.stub)
19348 .cancel_operation(self.0.request, self.0.options)
19349 .await
19350 .map(crate::Response::into_body)
19351 }
19352
19353 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19355 self.0.request.name = v.into();
19356 self
19357 }
19358 }
19359
19360 #[doc(hidden)]
19361 impl crate::RequestBuilder for CancelOperation {
19362 fn request_options(&mut self) -> &mut crate::RequestOptions {
19363 &mut self.0.options
19364 }
19365 }
19366}
19367
19368#[cfg(feature = "sessions")]
19370#[cfg_attr(docsrs, doc(cfg(feature = "sessions")))]
19371pub mod sessions {
19372 use crate::Result;
19373
19374 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
19388
19389 pub(crate) mod client {
19390 use super::super::super::client::Sessions;
19391 pub struct Factory;
19392 impl crate::ClientFactory for Factory {
19393 type Client = Sessions;
19394 type Credentials = gaxi::options::Credentials;
19395 async fn build(
19396 self,
19397 config: gaxi::options::ClientConfig,
19398 ) -> crate::ClientBuilderResult<Self::Client> {
19399 Self::Client::new(config).await
19400 }
19401 }
19402 }
19403
19404 #[derive(Clone, Debug)]
19406 pub(crate) struct RequestBuilder<R: std::default::Default> {
19407 stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>,
19408 request: R,
19409 options: crate::RequestOptions,
19410 }
19411
19412 impl<R> RequestBuilder<R>
19413 where
19414 R: std::default::Default,
19415 {
19416 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19417 Self {
19418 stub,
19419 request: R::default(),
19420 options: crate::RequestOptions::default(),
19421 }
19422 }
19423 }
19424
19425 #[derive(Clone, Debug)]
19442 pub struct DetectIntent(RequestBuilder<crate::model::DetectIntentRequest>);
19443
19444 impl DetectIntent {
19445 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19446 Self(RequestBuilder::new(stub))
19447 }
19448
19449 pub fn with_request<V: Into<crate::model::DetectIntentRequest>>(mut self, v: V) -> Self {
19451 self.0.request = v.into();
19452 self
19453 }
19454
19455 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19457 self.0.options = v.into();
19458 self
19459 }
19460
19461 pub async fn send(self) -> Result<crate::model::DetectIntentResponse> {
19463 (*self.0.stub)
19464 .detect_intent(self.0.request, self.0.options)
19465 .await
19466 .map(crate::Response::into_body)
19467 }
19468
19469 pub fn set_session<T: Into<std::string::String>>(mut self, v: T) -> Self {
19473 self.0.request.session = v.into();
19474 self
19475 }
19476
19477 pub fn set_query_params<T>(mut self, v: T) -> Self
19479 where
19480 T: std::convert::Into<crate::model::QueryParameters>,
19481 {
19482 self.0.request.query_params = std::option::Option::Some(v.into());
19483 self
19484 }
19485
19486 pub fn set_or_clear_query_params<T>(mut self, v: std::option::Option<T>) -> Self
19488 where
19489 T: std::convert::Into<crate::model::QueryParameters>,
19490 {
19491 self.0.request.query_params = v.map(|x| x.into());
19492 self
19493 }
19494
19495 pub fn set_query_input<T>(mut self, v: T) -> Self
19499 where
19500 T: std::convert::Into<crate::model::QueryInput>,
19501 {
19502 self.0.request.query_input = std::option::Option::Some(v.into());
19503 self
19504 }
19505
19506 pub fn set_or_clear_query_input<T>(mut self, v: std::option::Option<T>) -> Self
19510 where
19511 T: std::convert::Into<crate::model::QueryInput>,
19512 {
19513 self.0.request.query_input = v.map(|x| x.into());
19514 self
19515 }
19516
19517 pub fn set_output_audio_config<T>(mut self, v: T) -> Self
19519 where
19520 T: std::convert::Into<crate::model::OutputAudioConfig>,
19521 {
19522 self.0.request.output_audio_config = std::option::Option::Some(v.into());
19523 self
19524 }
19525
19526 pub fn set_or_clear_output_audio_config<T>(mut self, v: std::option::Option<T>) -> Self
19528 where
19529 T: std::convert::Into<crate::model::OutputAudioConfig>,
19530 {
19531 self.0.request.output_audio_config = v.map(|x| x.into());
19532 self
19533 }
19534
19535 pub fn set_output_audio_config_mask<T>(mut self, v: T) -> Self
19537 where
19538 T: std::convert::Into<wkt::FieldMask>,
19539 {
19540 self.0.request.output_audio_config_mask = std::option::Option::Some(v.into());
19541 self
19542 }
19543
19544 pub fn set_or_clear_output_audio_config_mask<T>(mut self, v: std::option::Option<T>) -> Self
19546 where
19547 T: std::convert::Into<wkt::FieldMask>,
19548 {
19549 self.0.request.output_audio_config_mask = v.map(|x| x.into());
19550 self
19551 }
19552
19553 pub fn set_input_audio<T: Into<::bytes::Bytes>>(mut self, v: T) -> Self {
19555 self.0.request.input_audio = v.into();
19556 self
19557 }
19558 }
19559
19560 #[doc(hidden)]
19561 impl crate::RequestBuilder for DetectIntent {
19562 fn request_options(&mut self) -> &mut crate::RequestOptions {
19563 &mut self.0.options
19564 }
19565 }
19566
19567 #[derive(Clone, Debug)]
19588 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
19589
19590 impl ListLocations {
19591 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19592 Self(RequestBuilder::new(stub))
19593 }
19594
19595 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
19597 mut self,
19598 v: V,
19599 ) -> Self {
19600 self.0.request = v.into();
19601 self
19602 }
19603
19604 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19606 self.0.options = v.into();
19607 self
19608 }
19609
19610 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
19612 (*self.0.stub)
19613 .list_locations(self.0.request, self.0.options)
19614 .await
19615 .map(crate::Response::into_body)
19616 }
19617
19618 pub fn by_page(
19620 self,
19621 ) -> impl google_cloud_gax::paginator::Paginator<
19622 google_cloud_location::model::ListLocationsResponse,
19623 crate::Error,
19624 > {
19625 use std::clone::Clone;
19626 let token = self.0.request.page_token.clone();
19627 let execute = move |token: String| {
19628 let mut builder = self.clone();
19629 builder.0.request = builder.0.request.set_page_token(token);
19630 builder.send()
19631 };
19632 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19633 }
19634
19635 pub fn by_item(
19637 self,
19638 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19639 google_cloud_location::model::ListLocationsResponse,
19640 crate::Error,
19641 > {
19642 use google_cloud_gax::paginator::Paginator;
19643 self.by_page().items()
19644 }
19645
19646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19648 self.0.request.name = v.into();
19649 self
19650 }
19651
19652 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19654 self.0.request.filter = v.into();
19655 self
19656 }
19657
19658 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19660 self.0.request.page_size = v.into();
19661 self
19662 }
19663
19664 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19666 self.0.request.page_token = v.into();
19667 self
19668 }
19669 }
19670
19671 #[doc(hidden)]
19672 impl crate::RequestBuilder for ListLocations {
19673 fn request_options(&mut self) -> &mut crate::RequestOptions {
19674 &mut self.0.options
19675 }
19676 }
19677
19678 #[derive(Clone, Debug)]
19695 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
19696
19697 impl GetLocation {
19698 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19699 Self(RequestBuilder::new(stub))
19700 }
19701
19702 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
19704 mut self,
19705 v: V,
19706 ) -> Self {
19707 self.0.request = v.into();
19708 self
19709 }
19710
19711 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19713 self.0.options = v.into();
19714 self
19715 }
19716
19717 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
19719 (*self.0.stub)
19720 .get_location(self.0.request, self.0.options)
19721 .await
19722 .map(crate::Response::into_body)
19723 }
19724
19725 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19727 self.0.request.name = v.into();
19728 self
19729 }
19730 }
19731
19732 #[doc(hidden)]
19733 impl crate::RequestBuilder for GetLocation {
19734 fn request_options(&mut self) -> &mut crate::RequestOptions {
19735 &mut self.0.options
19736 }
19737 }
19738
19739 #[derive(Clone, Debug)]
19760 pub struct ListOperations(
19761 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
19762 );
19763
19764 impl ListOperations {
19765 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19766 Self(RequestBuilder::new(stub))
19767 }
19768
19769 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
19771 mut self,
19772 v: V,
19773 ) -> Self {
19774 self.0.request = v.into();
19775 self
19776 }
19777
19778 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19780 self.0.options = v.into();
19781 self
19782 }
19783
19784 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
19786 (*self.0.stub)
19787 .list_operations(self.0.request, self.0.options)
19788 .await
19789 .map(crate::Response::into_body)
19790 }
19791
19792 pub fn by_page(
19794 self,
19795 ) -> impl google_cloud_gax::paginator::Paginator<
19796 google_cloud_longrunning::model::ListOperationsResponse,
19797 crate::Error,
19798 > {
19799 use std::clone::Clone;
19800 let token = self.0.request.page_token.clone();
19801 let execute = move |token: String| {
19802 let mut builder = self.clone();
19803 builder.0.request = builder.0.request.set_page_token(token);
19804 builder.send()
19805 };
19806 google_cloud_gax::paginator::internal::new_paginator(token, execute)
19807 }
19808
19809 pub fn by_item(
19811 self,
19812 ) -> impl google_cloud_gax::paginator::ItemPaginator<
19813 google_cloud_longrunning::model::ListOperationsResponse,
19814 crate::Error,
19815 > {
19816 use google_cloud_gax::paginator::Paginator;
19817 self.by_page().items()
19818 }
19819
19820 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19822 self.0.request.name = v.into();
19823 self
19824 }
19825
19826 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
19828 self.0.request.filter = v.into();
19829 self
19830 }
19831
19832 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
19834 self.0.request.page_size = v.into();
19835 self
19836 }
19837
19838 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
19840 self.0.request.page_token = v.into();
19841 self
19842 }
19843
19844 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
19846 self.0.request.return_partial_success = v.into();
19847 self
19848 }
19849 }
19850
19851 #[doc(hidden)]
19852 impl crate::RequestBuilder for ListOperations {
19853 fn request_options(&mut self) -> &mut crate::RequestOptions {
19854 &mut self.0.options
19855 }
19856 }
19857
19858 #[derive(Clone, Debug)]
19875 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
19876
19877 impl GetOperation {
19878 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19879 Self(RequestBuilder::new(stub))
19880 }
19881
19882 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
19884 mut self,
19885 v: V,
19886 ) -> Self {
19887 self.0.request = v.into();
19888 self
19889 }
19890
19891 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19893 self.0.options = v.into();
19894 self
19895 }
19896
19897 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
19899 (*self.0.stub)
19900 .get_operation(self.0.request, self.0.options)
19901 .await
19902 .map(crate::Response::into_body)
19903 }
19904
19905 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19907 self.0.request.name = v.into();
19908 self
19909 }
19910 }
19911
19912 #[doc(hidden)]
19913 impl crate::RequestBuilder for GetOperation {
19914 fn request_options(&mut self) -> &mut crate::RequestOptions {
19915 &mut self.0.options
19916 }
19917 }
19918
19919 #[derive(Clone, Debug)]
19936 pub struct CancelOperation(
19937 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
19938 );
19939
19940 impl CancelOperation {
19941 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Sessions>) -> Self {
19942 Self(RequestBuilder::new(stub))
19943 }
19944
19945 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
19947 mut self,
19948 v: V,
19949 ) -> Self {
19950 self.0.request = v.into();
19951 self
19952 }
19953
19954 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
19956 self.0.options = v.into();
19957 self
19958 }
19959
19960 pub async fn send(self) -> Result<()> {
19962 (*self.0.stub)
19963 .cancel_operation(self.0.request, self.0.options)
19964 .await
19965 .map(crate::Response::into_body)
19966 }
19967
19968 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
19970 self.0.request.name = v.into();
19971 self
19972 }
19973 }
19974
19975 #[doc(hidden)]
19976 impl crate::RequestBuilder for CancelOperation {
19977 fn request_options(&mut self) -> &mut crate::RequestOptions {
19978 &mut self.0.options
19979 }
19980 }
19981}
19982
19983#[cfg(feature = "session-entity-types")]
19985#[cfg_attr(docsrs, doc(cfg(feature = "session-entity-types")))]
19986pub mod session_entity_types {
19987 use crate::Result;
19988
19989 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20003
20004 pub(crate) mod client {
20005 use super::super::super::client::SessionEntityTypes;
20006 pub struct Factory;
20007 impl crate::ClientFactory for Factory {
20008 type Client = SessionEntityTypes;
20009 type Credentials = gaxi::options::Credentials;
20010 async fn build(
20011 self,
20012 config: gaxi::options::ClientConfig,
20013 ) -> crate::ClientBuilderResult<Self::Client> {
20014 Self::Client::new(config).await
20015 }
20016 }
20017 }
20018
20019 #[derive(Clone, Debug)]
20021 pub(crate) struct RequestBuilder<R: std::default::Default> {
20022 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20023 request: R,
20024 options: crate::RequestOptions,
20025 }
20026
20027 impl<R> RequestBuilder<R>
20028 where
20029 R: std::default::Default,
20030 {
20031 pub(crate) fn new(
20032 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20033 ) -> Self {
20034 Self {
20035 stub,
20036 request: R::default(),
20037 options: crate::RequestOptions::default(),
20038 }
20039 }
20040 }
20041
20042 #[derive(Clone, Debug)]
20063 pub struct ListSessionEntityTypes(RequestBuilder<crate::model::ListSessionEntityTypesRequest>);
20064
20065 impl ListSessionEntityTypes {
20066 pub(crate) fn new(
20067 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20068 ) -> Self {
20069 Self(RequestBuilder::new(stub))
20070 }
20071
20072 pub fn with_request<V: Into<crate::model::ListSessionEntityTypesRequest>>(
20074 mut self,
20075 v: V,
20076 ) -> Self {
20077 self.0.request = v.into();
20078 self
20079 }
20080
20081 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20083 self.0.options = v.into();
20084 self
20085 }
20086
20087 pub async fn send(self) -> Result<crate::model::ListSessionEntityTypesResponse> {
20089 (*self.0.stub)
20090 .list_session_entity_types(self.0.request, self.0.options)
20091 .await
20092 .map(crate::Response::into_body)
20093 }
20094
20095 pub fn by_page(
20097 self,
20098 ) -> impl google_cloud_gax::paginator::Paginator<
20099 crate::model::ListSessionEntityTypesResponse,
20100 crate::Error,
20101 > {
20102 use std::clone::Clone;
20103 let token = self.0.request.page_token.clone();
20104 let execute = move |token: String| {
20105 let mut builder = self.clone();
20106 builder.0.request = builder.0.request.set_page_token(token);
20107 builder.send()
20108 };
20109 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20110 }
20111
20112 pub fn by_item(
20114 self,
20115 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20116 crate::model::ListSessionEntityTypesResponse,
20117 crate::Error,
20118 > {
20119 use google_cloud_gax::paginator::Paginator;
20120 self.by_page().items()
20121 }
20122
20123 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20127 self.0.request.parent = v.into();
20128 self
20129 }
20130
20131 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20133 self.0.request.page_size = v.into();
20134 self
20135 }
20136
20137 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20139 self.0.request.page_token = v.into();
20140 self
20141 }
20142 }
20143
20144 #[doc(hidden)]
20145 impl crate::RequestBuilder for ListSessionEntityTypes {
20146 fn request_options(&mut self) -> &mut crate::RequestOptions {
20147 &mut self.0.options
20148 }
20149 }
20150
20151 #[derive(Clone, Debug)]
20168 pub struct GetSessionEntityType(RequestBuilder<crate::model::GetSessionEntityTypeRequest>);
20169
20170 impl GetSessionEntityType {
20171 pub(crate) fn new(
20172 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20173 ) -> Self {
20174 Self(RequestBuilder::new(stub))
20175 }
20176
20177 pub fn with_request<V: Into<crate::model::GetSessionEntityTypeRequest>>(
20179 mut self,
20180 v: V,
20181 ) -> Self {
20182 self.0.request = v.into();
20183 self
20184 }
20185
20186 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20188 self.0.options = v.into();
20189 self
20190 }
20191
20192 pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20194 (*self.0.stub)
20195 .get_session_entity_type(self.0.request, self.0.options)
20196 .await
20197 .map(crate::Response::into_body)
20198 }
20199
20200 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20204 self.0.request.name = v.into();
20205 self
20206 }
20207 }
20208
20209 #[doc(hidden)]
20210 impl crate::RequestBuilder for GetSessionEntityType {
20211 fn request_options(&mut self) -> &mut crate::RequestOptions {
20212 &mut self.0.options
20213 }
20214 }
20215
20216 #[derive(Clone, Debug)]
20233 pub struct CreateSessionEntityType(
20234 RequestBuilder<crate::model::CreateSessionEntityTypeRequest>,
20235 );
20236
20237 impl CreateSessionEntityType {
20238 pub(crate) fn new(
20239 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20240 ) -> Self {
20241 Self(RequestBuilder::new(stub))
20242 }
20243
20244 pub fn with_request<V: Into<crate::model::CreateSessionEntityTypeRequest>>(
20246 mut self,
20247 v: V,
20248 ) -> Self {
20249 self.0.request = v.into();
20250 self
20251 }
20252
20253 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20255 self.0.options = v.into();
20256 self
20257 }
20258
20259 pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20261 (*self.0.stub)
20262 .create_session_entity_type(self.0.request, self.0.options)
20263 .await
20264 .map(crate::Response::into_body)
20265 }
20266
20267 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
20271 self.0.request.parent = v.into();
20272 self
20273 }
20274
20275 pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20279 where
20280 T: std::convert::Into<crate::model::SessionEntityType>,
20281 {
20282 self.0.request.session_entity_type = std::option::Option::Some(v.into());
20283 self
20284 }
20285
20286 pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20290 where
20291 T: std::convert::Into<crate::model::SessionEntityType>,
20292 {
20293 self.0.request.session_entity_type = v.map(|x| x.into());
20294 self
20295 }
20296 }
20297
20298 #[doc(hidden)]
20299 impl crate::RequestBuilder for CreateSessionEntityType {
20300 fn request_options(&mut self) -> &mut crate::RequestOptions {
20301 &mut self.0.options
20302 }
20303 }
20304
20305 #[derive(Clone, Debug)]
20322 pub struct UpdateSessionEntityType(
20323 RequestBuilder<crate::model::UpdateSessionEntityTypeRequest>,
20324 );
20325
20326 impl UpdateSessionEntityType {
20327 pub(crate) fn new(
20328 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20329 ) -> Self {
20330 Self(RequestBuilder::new(stub))
20331 }
20332
20333 pub fn with_request<V: Into<crate::model::UpdateSessionEntityTypeRequest>>(
20335 mut self,
20336 v: V,
20337 ) -> Self {
20338 self.0.request = v.into();
20339 self
20340 }
20341
20342 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20344 self.0.options = v.into();
20345 self
20346 }
20347
20348 pub async fn send(self) -> Result<crate::model::SessionEntityType> {
20350 (*self.0.stub)
20351 .update_session_entity_type(self.0.request, self.0.options)
20352 .await
20353 .map(crate::Response::into_body)
20354 }
20355
20356 pub fn set_session_entity_type<T>(mut self, v: T) -> Self
20360 where
20361 T: std::convert::Into<crate::model::SessionEntityType>,
20362 {
20363 self.0.request.session_entity_type = std::option::Option::Some(v.into());
20364 self
20365 }
20366
20367 pub fn set_or_clear_session_entity_type<T>(mut self, v: std::option::Option<T>) -> Self
20371 where
20372 T: std::convert::Into<crate::model::SessionEntityType>,
20373 {
20374 self.0.request.session_entity_type = v.map(|x| x.into());
20375 self
20376 }
20377
20378 pub fn set_update_mask<T>(mut self, v: T) -> Self
20380 where
20381 T: std::convert::Into<wkt::FieldMask>,
20382 {
20383 self.0.request.update_mask = std::option::Option::Some(v.into());
20384 self
20385 }
20386
20387 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
20389 where
20390 T: std::convert::Into<wkt::FieldMask>,
20391 {
20392 self.0.request.update_mask = v.map(|x| x.into());
20393 self
20394 }
20395 }
20396
20397 #[doc(hidden)]
20398 impl crate::RequestBuilder for UpdateSessionEntityType {
20399 fn request_options(&mut self) -> &mut crate::RequestOptions {
20400 &mut self.0.options
20401 }
20402 }
20403
20404 #[derive(Clone, Debug)]
20421 pub struct DeleteSessionEntityType(
20422 RequestBuilder<crate::model::DeleteSessionEntityTypeRequest>,
20423 );
20424
20425 impl DeleteSessionEntityType {
20426 pub(crate) fn new(
20427 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20428 ) -> Self {
20429 Self(RequestBuilder::new(stub))
20430 }
20431
20432 pub fn with_request<V: Into<crate::model::DeleteSessionEntityTypeRequest>>(
20434 mut self,
20435 v: V,
20436 ) -> Self {
20437 self.0.request = v.into();
20438 self
20439 }
20440
20441 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20443 self.0.options = v.into();
20444 self
20445 }
20446
20447 pub async fn send(self) -> Result<()> {
20449 (*self.0.stub)
20450 .delete_session_entity_type(self.0.request, self.0.options)
20451 .await
20452 .map(crate::Response::into_body)
20453 }
20454
20455 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20459 self.0.request.name = v.into();
20460 self
20461 }
20462 }
20463
20464 #[doc(hidden)]
20465 impl crate::RequestBuilder for DeleteSessionEntityType {
20466 fn request_options(&mut self) -> &mut crate::RequestOptions {
20467 &mut self.0.options
20468 }
20469 }
20470
20471 #[derive(Clone, Debug)]
20492 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
20493
20494 impl ListLocations {
20495 pub(crate) fn new(
20496 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20497 ) -> Self {
20498 Self(RequestBuilder::new(stub))
20499 }
20500
20501 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
20503 mut self,
20504 v: V,
20505 ) -> Self {
20506 self.0.request = v.into();
20507 self
20508 }
20509
20510 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20512 self.0.options = v.into();
20513 self
20514 }
20515
20516 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
20518 (*self.0.stub)
20519 .list_locations(self.0.request, self.0.options)
20520 .await
20521 .map(crate::Response::into_body)
20522 }
20523
20524 pub fn by_page(
20526 self,
20527 ) -> impl google_cloud_gax::paginator::Paginator<
20528 google_cloud_location::model::ListLocationsResponse,
20529 crate::Error,
20530 > {
20531 use std::clone::Clone;
20532 let token = self.0.request.page_token.clone();
20533 let execute = move |token: String| {
20534 let mut builder = self.clone();
20535 builder.0.request = builder.0.request.set_page_token(token);
20536 builder.send()
20537 };
20538 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20539 }
20540
20541 pub fn by_item(
20543 self,
20544 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20545 google_cloud_location::model::ListLocationsResponse,
20546 crate::Error,
20547 > {
20548 use google_cloud_gax::paginator::Paginator;
20549 self.by_page().items()
20550 }
20551
20552 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20554 self.0.request.name = v.into();
20555 self
20556 }
20557
20558 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20560 self.0.request.filter = v.into();
20561 self
20562 }
20563
20564 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20566 self.0.request.page_size = v.into();
20567 self
20568 }
20569
20570 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20572 self.0.request.page_token = v.into();
20573 self
20574 }
20575 }
20576
20577 #[doc(hidden)]
20578 impl crate::RequestBuilder for ListLocations {
20579 fn request_options(&mut self) -> &mut crate::RequestOptions {
20580 &mut self.0.options
20581 }
20582 }
20583
20584 #[derive(Clone, Debug)]
20601 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
20602
20603 impl GetLocation {
20604 pub(crate) fn new(
20605 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20606 ) -> Self {
20607 Self(RequestBuilder::new(stub))
20608 }
20609
20610 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
20612 mut self,
20613 v: V,
20614 ) -> Self {
20615 self.0.request = v.into();
20616 self
20617 }
20618
20619 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20621 self.0.options = v.into();
20622 self
20623 }
20624
20625 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
20627 (*self.0.stub)
20628 .get_location(self.0.request, self.0.options)
20629 .await
20630 .map(crate::Response::into_body)
20631 }
20632
20633 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20635 self.0.request.name = v.into();
20636 self
20637 }
20638 }
20639
20640 #[doc(hidden)]
20641 impl crate::RequestBuilder for GetLocation {
20642 fn request_options(&mut self) -> &mut crate::RequestOptions {
20643 &mut self.0.options
20644 }
20645 }
20646
20647 #[derive(Clone, Debug)]
20668 pub struct ListOperations(
20669 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
20670 );
20671
20672 impl ListOperations {
20673 pub(crate) fn new(
20674 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20675 ) -> Self {
20676 Self(RequestBuilder::new(stub))
20677 }
20678
20679 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
20681 mut self,
20682 v: V,
20683 ) -> Self {
20684 self.0.request = v.into();
20685 self
20686 }
20687
20688 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20690 self.0.options = v.into();
20691 self
20692 }
20693
20694 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
20696 (*self.0.stub)
20697 .list_operations(self.0.request, self.0.options)
20698 .await
20699 .map(crate::Response::into_body)
20700 }
20701
20702 pub fn by_page(
20704 self,
20705 ) -> impl google_cloud_gax::paginator::Paginator<
20706 google_cloud_longrunning::model::ListOperationsResponse,
20707 crate::Error,
20708 > {
20709 use std::clone::Clone;
20710 let token = self.0.request.page_token.clone();
20711 let execute = move |token: String| {
20712 let mut builder = self.clone();
20713 builder.0.request = builder.0.request.set_page_token(token);
20714 builder.send()
20715 };
20716 google_cloud_gax::paginator::internal::new_paginator(token, execute)
20717 }
20718
20719 pub fn by_item(
20721 self,
20722 ) -> impl google_cloud_gax::paginator::ItemPaginator<
20723 google_cloud_longrunning::model::ListOperationsResponse,
20724 crate::Error,
20725 > {
20726 use google_cloud_gax::paginator::Paginator;
20727 self.by_page().items()
20728 }
20729
20730 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20732 self.0.request.name = v.into();
20733 self
20734 }
20735
20736 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
20738 self.0.request.filter = v.into();
20739 self
20740 }
20741
20742 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
20744 self.0.request.page_size = v.into();
20745 self
20746 }
20747
20748 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
20750 self.0.request.page_token = v.into();
20751 self
20752 }
20753
20754 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
20756 self.0.request.return_partial_success = v.into();
20757 self
20758 }
20759 }
20760
20761 #[doc(hidden)]
20762 impl crate::RequestBuilder for ListOperations {
20763 fn request_options(&mut self) -> &mut crate::RequestOptions {
20764 &mut self.0.options
20765 }
20766 }
20767
20768 #[derive(Clone, Debug)]
20785 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
20786
20787 impl GetOperation {
20788 pub(crate) fn new(
20789 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20790 ) -> Self {
20791 Self(RequestBuilder::new(stub))
20792 }
20793
20794 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
20796 mut self,
20797 v: V,
20798 ) -> Self {
20799 self.0.request = v.into();
20800 self
20801 }
20802
20803 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20805 self.0.options = v.into();
20806 self
20807 }
20808
20809 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
20811 (*self.0.stub)
20812 .get_operation(self.0.request, self.0.options)
20813 .await
20814 .map(crate::Response::into_body)
20815 }
20816
20817 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20819 self.0.request.name = v.into();
20820 self
20821 }
20822 }
20823
20824 #[doc(hidden)]
20825 impl crate::RequestBuilder for GetOperation {
20826 fn request_options(&mut self) -> &mut crate::RequestOptions {
20827 &mut self.0.options
20828 }
20829 }
20830
20831 #[derive(Clone, Debug)]
20848 pub struct CancelOperation(
20849 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
20850 );
20851
20852 impl CancelOperation {
20853 pub(crate) fn new(
20854 stub: std::sync::Arc<dyn super::super::stub::dynamic::SessionEntityTypes>,
20855 ) -> Self {
20856 Self(RequestBuilder::new(stub))
20857 }
20858
20859 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
20861 mut self,
20862 v: V,
20863 ) -> Self {
20864 self.0.request = v.into();
20865 self
20866 }
20867
20868 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20870 self.0.options = v.into();
20871 self
20872 }
20873
20874 pub async fn send(self) -> Result<()> {
20876 (*self.0.stub)
20877 .cancel_operation(self.0.request, self.0.options)
20878 .await
20879 .map(crate::Response::into_body)
20880 }
20881
20882 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
20884 self.0.request.name = v.into();
20885 self
20886 }
20887 }
20888
20889 #[doc(hidden)]
20890 impl crate::RequestBuilder for CancelOperation {
20891 fn request_options(&mut self) -> &mut crate::RequestOptions {
20892 &mut self.0.options
20893 }
20894 }
20895}
20896
20897#[cfg(feature = "sip-trunks")]
20899#[cfg_attr(docsrs, doc(cfg(feature = "sip-trunks")))]
20900pub mod sip_trunks {
20901 use crate::Result;
20902
20903 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
20917
20918 pub(crate) mod client {
20919 use super::super::super::client::SipTrunks;
20920 pub struct Factory;
20921 impl crate::ClientFactory for Factory {
20922 type Client = SipTrunks;
20923 type Credentials = gaxi::options::Credentials;
20924 async fn build(
20925 self,
20926 config: gaxi::options::ClientConfig,
20927 ) -> crate::ClientBuilderResult<Self::Client> {
20928 Self::Client::new(config).await
20929 }
20930 }
20931 }
20932
20933 #[derive(Clone, Debug)]
20935 pub(crate) struct RequestBuilder<R: std::default::Default> {
20936 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20937 request: R,
20938 options: crate::RequestOptions,
20939 }
20940
20941 impl<R> RequestBuilder<R>
20942 where
20943 R: std::default::Default,
20944 {
20945 pub(crate) fn new(
20946 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20947 ) -> Self {
20948 Self {
20949 stub,
20950 request: R::default(),
20951 options: crate::RequestOptions::default(),
20952 }
20953 }
20954 }
20955
20956 #[derive(Clone, Debug)]
20973 pub struct CreateSipTrunk(RequestBuilder<crate::model::CreateSipTrunkRequest>);
20974
20975 impl CreateSipTrunk {
20976 pub(crate) fn new(
20977 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
20978 ) -> Self {
20979 Self(RequestBuilder::new(stub))
20980 }
20981
20982 pub fn with_request<V: Into<crate::model::CreateSipTrunkRequest>>(mut self, v: V) -> Self {
20984 self.0.request = v.into();
20985 self
20986 }
20987
20988 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
20990 self.0.options = v.into();
20991 self
20992 }
20993
20994 pub async fn send(self) -> Result<crate::model::SipTrunk> {
20996 (*self.0.stub)
20997 .create_sip_trunk(self.0.request, self.0.options)
20998 .await
20999 .map(crate::Response::into_body)
21000 }
21001
21002 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21006 self.0.request.parent = v.into();
21007 self
21008 }
21009
21010 pub fn set_sip_trunk<T>(mut self, v: T) -> Self
21014 where
21015 T: std::convert::Into<crate::model::SipTrunk>,
21016 {
21017 self.0.request.sip_trunk = std::option::Option::Some(v.into());
21018 self
21019 }
21020
21021 pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
21025 where
21026 T: std::convert::Into<crate::model::SipTrunk>,
21027 {
21028 self.0.request.sip_trunk = v.map(|x| x.into());
21029 self
21030 }
21031 }
21032
21033 #[doc(hidden)]
21034 impl crate::RequestBuilder for CreateSipTrunk {
21035 fn request_options(&mut self) -> &mut crate::RequestOptions {
21036 &mut self.0.options
21037 }
21038 }
21039
21040 #[derive(Clone, Debug)]
21057 pub struct DeleteSipTrunk(RequestBuilder<crate::model::DeleteSipTrunkRequest>);
21058
21059 impl DeleteSipTrunk {
21060 pub(crate) fn new(
21061 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21062 ) -> Self {
21063 Self(RequestBuilder::new(stub))
21064 }
21065
21066 pub fn with_request<V: Into<crate::model::DeleteSipTrunkRequest>>(mut self, v: V) -> Self {
21068 self.0.request = v.into();
21069 self
21070 }
21071
21072 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21074 self.0.options = v.into();
21075 self
21076 }
21077
21078 pub async fn send(self) -> Result<()> {
21080 (*self.0.stub)
21081 .delete_sip_trunk(self.0.request, self.0.options)
21082 .await
21083 .map(crate::Response::into_body)
21084 }
21085
21086 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21090 self.0.request.name = v.into();
21091 self
21092 }
21093 }
21094
21095 #[doc(hidden)]
21096 impl crate::RequestBuilder for DeleteSipTrunk {
21097 fn request_options(&mut self) -> &mut crate::RequestOptions {
21098 &mut self.0.options
21099 }
21100 }
21101
21102 #[derive(Clone, Debug)]
21123 pub struct ListSipTrunks(RequestBuilder<crate::model::ListSipTrunksRequest>);
21124
21125 impl ListSipTrunks {
21126 pub(crate) fn new(
21127 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21128 ) -> Self {
21129 Self(RequestBuilder::new(stub))
21130 }
21131
21132 pub fn with_request<V: Into<crate::model::ListSipTrunksRequest>>(mut self, v: V) -> Self {
21134 self.0.request = v.into();
21135 self
21136 }
21137
21138 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21140 self.0.options = v.into();
21141 self
21142 }
21143
21144 pub async fn send(self) -> Result<crate::model::ListSipTrunksResponse> {
21146 (*self.0.stub)
21147 .list_sip_trunks(self.0.request, self.0.options)
21148 .await
21149 .map(crate::Response::into_body)
21150 }
21151
21152 pub fn by_page(
21154 self,
21155 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListSipTrunksResponse, crate::Error>
21156 {
21157 use std::clone::Clone;
21158 let token = self.0.request.page_token.clone();
21159 let execute = move |token: String| {
21160 let mut builder = self.clone();
21161 builder.0.request = builder.0.request.set_page_token(token);
21162 builder.send()
21163 };
21164 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21165 }
21166
21167 pub fn by_item(
21169 self,
21170 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21171 crate::model::ListSipTrunksResponse,
21172 crate::Error,
21173 > {
21174 use google_cloud_gax::paginator::Paginator;
21175 self.by_page().items()
21176 }
21177
21178 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21182 self.0.request.parent = v.into();
21183 self
21184 }
21185
21186 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21188 self.0.request.page_size = v.into();
21189 self
21190 }
21191
21192 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21194 self.0.request.page_token = v.into();
21195 self
21196 }
21197 }
21198
21199 #[doc(hidden)]
21200 impl crate::RequestBuilder for ListSipTrunks {
21201 fn request_options(&mut self) -> &mut crate::RequestOptions {
21202 &mut self.0.options
21203 }
21204 }
21205
21206 #[derive(Clone, Debug)]
21223 pub struct GetSipTrunk(RequestBuilder<crate::model::GetSipTrunkRequest>);
21224
21225 impl GetSipTrunk {
21226 pub(crate) fn new(
21227 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21228 ) -> Self {
21229 Self(RequestBuilder::new(stub))
21230 }
21231
21232 pub fn with_request<V: Into<crate::model::GetSipTrunkRequest>>(mut self, v: V) -> Self {
21234 self.0.request = v.into();
21235 self
21236 }
21237
21238 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21240 self.0.options = v.into();
21241 self
21242 }
21243
21244 pub async fn send(self) -> Result<crate::model::SipTrunk> {
21246 (*self.0.stub)
21247 .get_sip_trunk(self.0.request, self.0.options)
21248 .await
21249 .map(crate::Response::into_body)
21250 }
21251
21252 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21256 self.0.request.name = v.into();
21257 self
21258 }
21259 }
21260
21261 #[doc(hidden)]
21262 impl crate::RequestBuilder for GetSipTrunk {
21263 fn request_options(&mut self) -> &mut crate::RequestOptions {
21264 &mut self.0.options
21265 }
21266 }
21267
21268 #[derive(Clone, Debug)]
21285 pub struct UpdateSipTrunk(RequestBuilder<crate::model::UpdateSipTrunkRequest>);
21286
21287 impl UpdateSipTrunk {
21288 pub(crate) fn new(
21289 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21290 ) -> Self {
21291 Self(RequestBuilder::new(stub))
21292 }
21293
21294 pub fn with_request<V: Into<crate::model::UpdateSipTrunkRequest>>(mut self, v: V) -> Self {
21296 self.0.request = v.into();
21297 self
21298 }
21299
21300 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21302 self.0.options = v.into();
21303 self
21304 }
21305
21306 pub async fn send(self) -> Result<crate::model::SipTrunk> {
21308 (*self.0.stub)
21309 .update_sip_trunk(self.0.request, self.0.options)
21310 .await
21311 .map(crate::Response::into_body)
21312 }
21313
21314 pub fn set_sip_trunk<T>(mut self, v: T) -> Self
21318 where
21319 T: std::convert::Into<crate::model::SipTrunk>,
21320 {
21321 self.0.request.sip_trunk = std::option::Option::Some(v.into());
21322 self
21323 }
21324
21325 pub fn set_or_clear_sip_trunk<T>(mut self, v: std::option::Option<T>) -> Self
21329 where
21330 T: std::convert::Into<crate::model::SipTrunk>,
21331 {
21332 self.0.request.sip_trunk = v.map(|x| x.into());
21333 self
21334 }
21335
21336 pub fn set_update_mask<T>(mut self, v: T) -> Self
21338 where
21339 T: std::convert::Into<wkt::FieldMask>,
21340 {
21341 self.0.request.update_mask = std::option::Option::Some(v.into());
21342 self
21343 }
21344
21345 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
21347 where
21348 T: std::convert::Into<wkt::FieldMask>,
21349 {
21350 self.0.request.update_mask = v.map(|x| x.into());
21351 self
21352 }
21353 }
21354
21355 #[doc(hidden)]
21356 impl crate::RequestBuilder for UpdateSipTrunk {
21357 fn request_options(&mut self) -> &mut crate::RequestOptions {
21358 &mut self.0.options
21359 }
21360 }
21361
21362 #[derive(Clone, Debug)]
21383 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
21384
21385 impl ListLocations {
21386 pub(crate) fn new(
21387 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21388 ) -> Self {
21389 Self(RequestBuilder::new(stub))
21390 }
21391
21392 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
21394 mut self,
21395 v: V,
21396 ) -> Self {
21397 self.0.request = v.into();
21398 self
21399 }
21400
21401 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21403 self.0.options = v.into();
21404 self
21405 }
21406
21407 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
21409 (*self.0.stub)
21410 .list_locations(self.0.request, self.0.options)
21411 .await
21412 .map(crate::Response::into_body)
21413 }
21414
21415 pub fn by_page(
21417 self,
21418 ) -> impl google_cloud_gax::paginator::Paginator<
21419 google_cloud_location::model::ListLocationsResponse,
21420 crate::Error,
21421 > {
21422 use std::clone::Clone;
21423 let token = self.0.request.page_token.clone();
21424 let execute = move |token: String| {
21425 let mut builder = self.clone();
21426 builder.0.request = builder.0.request.set_page_token(token);
21427 builder.send()
21428 };
21429 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21430 }
21431
21432 pub fn by_item(
21434 self,
21435 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21436 google_cloud_location::model::ListLocationsResponse,
21437 crate::Error,
21438 > {
21439 use google_cloud_gax::paginator::Paginator;
21440 self.by_page().items()
21441 }
21442
21443 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21445 self.0.request.name = v.into();
21446 self
21447 }
21448
21449 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21451 self.0.request.filter = v.into();
21452 self
21453 }
21454
21455 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21457 self.0.request.page_size = v.into();
21458 self
21459 }
21460
21461 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21463 self.0.request.page_token = v.into();
21464 self
21465 }
21466 }
21467
21468 #[doc(hidden)]
21469 impl crate::RequestBuilder for ListLocations {
21470 fn request_options(&mut self) -> &mut crate::RequestOptions {
21471 &mut self.0.options
21472 }
21473 }
21474
21475 #[derive(Clone, Debug)]
21492 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
21493
21494 impl GetLocation {
21495 pub(crate) fn new(
21496 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21497 ) -> Self {
21498 Self(RequestBuilder::new(stub))
21499 }
21500
21501 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
21503 mut self,
21504 v: V,
21505 ) -> Self {
21506 self.0.request = v.into();
21507 self
21508 }
21509
21510 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21512 self.0.options = v.into();
21513 self
21514 }
21515
21516 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
21518 (*self.0.stub)
21519 .get_location(self.0.request, self.0.options)
21520 .await
21521 .map(crate::Response::into_body)
21522 }
21523
21524 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21526 self.0.request.name = v.into();
21527 self
21528 }
21529 }
21530
21531 #[doc(hidden)]
21532 impl crate::RequestBuilder for GetLocation {
21533 fn request_options(&mut self) -> &mut crate::RequestOptions {
21534 &mut self.0.options
21535 }
21536 }
21537
21538 #[derive(Clone, Debug)]
21559 pub struct ListOperations(
21560 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
21561 );
21562
21563 impl ListOperations {
21564 pub(crate) fn new(
21565 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21566 ) -> Self {
21567 Self(RequestBuilder::new(stub))
21568 }
21569
21570 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
21572 mut self,
21573 v: V,
21574 ) -> Self {
21575 self.0.request = v.into();
21576 self
21577 }
21578
21579 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21581 self.0.options = v.into();
21582 self
21583 }
21584
21585 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
21587 (*self.0.stub)
21588 .list_operations(self.0.request, self.0.options)
21589 .await
21590 .map(crate::Response::into_body)
21591 }
21592
21593 pub fn by_page(
21595 self,
21596 ) -> impl google_cloud_gax::paginator::Paginator<
21597 google_cloud_longrunning::model::ListOperationsResponse,
21598 crate::Error,
21599 > {
21600 use std::clone::Clone;
21601 let token = self.0.request.page_token.clone();
21602 let execute = move |token: String| {
21603 let mut builder = self.clone();
21604 builder.0.request = builder.0.request.set_page_token(token);
21605 builder.send()
21606 };
21607 google_cloud_gax::paginator::internal::new_paginator(token, execute)
21608 }
21609
21610 pub fn by_item(
21612 self,
21613 ) -> impl google_cloud_gax::paginator::ItemPaginator<
21614 google_cloud_longrunning::model::ListOperationsResponse,
21615 crate::Error,
21616 > {
21617 use google_cloud_gax::paginator::Paginator;
21618 self.by_page().items()
21619 }
21620
21621 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21623 self.0.request.name = v.into();
21624 self
21625 }
21626
21627 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
21629 self.0.request.filter = v.into();
21630 self
21631 }
21632
21633 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
21635 self.0.request.page_size = v.into();
21636 self
21637 }
21638
21639 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
21641 self.0.request.page_token = v.into();
21642 self
21643 }
21644
21645 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
21647 self.0.request.return_partial_success = v.into();
21648 self
21649 }
21650 }
21651
21652 #[doc(hidden)]
21653 impl crate::RequestBuilder for ListOperations {
21654 fn request_options(&mut self) -> &mut crate::RequestOptions {
21655 &mut self.0.options
21656 }
21657 }
21658
21659 #[derive(Clone, Debug)]
21676 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
21677
21678 impl GetOperation {
21679 pub(crate) fn new(
21680 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21681 ) -> Self {
21682 Self(RequestBuilder::new(stub))
21683 }
21684
21685 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
21687 mut self,
21688 v: V,
21689 ) -> Self {
21690 self.0.request = v.into();
21691 self
21692 }
21693
21694 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21696 self.0.options = v.into();
21697 self
21698 }
21699
21700 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
21702 (*self.0.stub)
21703 .get_operation(self.0.request, self.0.options)
21704 .await
21705 .map(crate::Response::into_body)
21706 }
21707
21708 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21710 self.0.request.name = v.into();
21711 self
21712 }
21713 }
21714
21715 #[doc(hidden)]
21716 impl crate::RequestBuilder for GetOperation {
21717 fn request_options(&mut self) -> &mut crate::RequestOptions {
21718 &mut self.0.options
21719 }
21720 }
21721
21722 #[derive(Clone, Debug)]
21739 pub struct CancelOperation(
21740 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
21741 );
21742
21743 impl CancelOperation {
21744 pub(crate) fn new(
21745 stub: std::sync::Arc<dyn super::super::stub::dynamic::SipTrunks>,
21746 ) -> Self {
21747 Self(RequestBuilder::new(stub))
21748 }
21749
21750 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
21752 mut self,
21753 v: V,
21754 ) -> Self {
21755 self.0.request = v.into();
21756 self
21757 }
21758
21759 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21761 self.0.options = v.into();
21762 self
21763 }
21764
21765 pub async fn send(self) -> Result<()> {
21767 (*self.0.stub)
21768 .cancel_operation(self.0.request, self.0.options)
21769 .await
21770 .map(crate::Response::into_body)
21771 }
21772
21773 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21775 self.0.request.name = v.into();
21776 self
21777 }
21778 }
21779
21780 #[doc(hidden)]
21781 impl crate::RequestBuilder for CancelOperation {
21782 fn request_options(&mut self) -> &mut crate::RequestOptions {
21783 &mut self.0.options
21784 }
21785 }
21786}
21787
21788#[cfg(feature = "tools")]
21790#[cfg_attr(docsrs, doc(cfg(feature = "tools")))]
21791pub mod tools {
21792 use crate::Result;
21793
21794 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
21808
21809 pub(crate) mod client {
21810 use super::super::super::client::Tools;
21811 pub struct Factory;
21812 impl crate::ClientFactory for Factory {
21813 type Client = Tools;
21814 type Credentials = gaxi::options::Credentials;
21815 async fn build(
21816 self,
21817 config: gaxi::options::ClientConfig,
21818 ) -> crate::ClientBuilderResult<Self::Client> {
21819 Self::Client::new(config).await
21820 }
21821 }
21822 }
21823
21824 #[derive(Clone, Debug)]
21826 pub(crate) struct RequestBuilder<R: std::default::Default> {
21827 stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>,
21828 request: R,
21829 options: crate::RequestOptions,
21830 }
21831
21832 impl<R> RequestBuilder<R>
21833 where
21834 R: std::default::Default,
21835 {
21836 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21837 Self {
21838 stub,
21839 request: R::default(),
21840 options: crate::RequestOptions::default(),
21841 }
21842 }
21843 }
21844
21845 #[derive(Clone, Debug)]
21862 pub struct CreateTool(RequestBuilder<crate::model::CreateToolRequest>);
21863
21864 impl CreateTool {
21865 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21866 Self(RequestBuilder::new(stub))
21867 }
21868
21869 pub fn with_request<V: Into<crate::model::CreateToolRequest>>(mut self, v: V) -> Self {
21871 self.0.request = v.into();
21872 self
21873 }
21874
21875 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21877 self.0.options = v.into();
21878 self
21879 }
21880
21881 pub async fn send(self) -> Result<crate::model::Tool> {
21883 (*self.0.stub)
21884 .create_tool(self.0.request, self.0.options)
21885 .await
21886 .map(crate::Response::into_body)
21887 }
21888
21889 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
21893 self.0.request.parent = v.into();
21894 self
21895 }
21896
21897 pub fn set_tool<T>(mut self, v: T) -> Self
21901 where
21902 T: std::convert::Into<crate::model::Tool>,
21903 {
21904 self.0.request.tool = std::option::Option::Some(v.into());
21905 self
21906 }
21907
21908 pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
21912 where
21913 T: std::convert::Into<crate::model::Tool>,
21914 {
21915 self.0.request.tool = v.map(|x| x.into());
21916 self
21917 }
21918
21919 pub fn set_tool_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
21921 self.0.request.tool_id = v.into();
21922 self
21923 }
21924 }
21925
21926 #[doc(hidden)]
21927 impl crate::RequestBuilder for CreateTool {
21928 fn request_options(&mut self) -> &mut crate::RequestOptions {
21929 &mut self.0.options
21930 }
21931 }
21932
21933 #[derive(Clone, Debug)]
21950 pub struct GetTool(RequestBuilder<crate::model::GetToolRequest>);
21951
21952 impl GetTool {
21953 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
21954 Self(RequestBuilder::new(stub))
21955 }
21956
21957 pub fn with_request<V: Into<crate::model::GetToolRequest>>(mut self, v: V) -> Self {
21959 self.0.request = v.into();
21960 self
21961 }
21962
21963 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
21965 self.0.options = v.into();
21966 self
21967 }
21968
21969 pub async fn send(self) -> Result<crate::model::Tool> {
21971 (*self.0.stub)
21972 .get_tool(self.0.request, self.0.options)
21973 .await
21974 .map(crate::Response::into_body)
21975 }
21976
21977 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
21981 self.0.request.name = v.into();
21982 self
21983 }
21984 }
21985
21986 #[doc(hidden)]
21987 impl crate::RequestBuilder for GetTool {
21988 fn request_options(&mut self) -> &mut crate::RequestOptions {
21989 &mut self.0.options
21990 }
21991 }
21992
21993 #[derive(Clone, Debug)]
22014 pub struct ListTools(RequestBuilder<crate::model::ListToolsRequest>);
22015
22016 impl ListTools {
22017 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22018 Self(RequestBuilder::new(stub))
22019 }
22020
22021 pub fn with_request<V: Into<crate::model::ListToolsRequest>>(mut self, v: V) -> Self {
22023 self.0.request = v.into();
22024 self
22025 }
22026
22027 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22029 self.0.options = v.into();
22030 self
22031 }
22032
22033 pub async fn send(self) -> Result<crate::model::ListToolsResponse> {
22035 (*self.0.stub)
22036 .list_tools(self.0.request, self.0.options)
22037 .await
22038 .map(crate::Response::into_body)
22039 }
22040
22041 pub fn by_page(
22043 self,
22044 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListToolsResponse, crate::Error>
22045 {
22046 use std::clone::Clone;
22047 let token = self.0.request.page_token.clone();
22048 let execute = move |token: String| {
22049 let mut builder = self.clone();
22050 builder.0.request = builder.0.request.set_page_token(token);
22051 builder.send()
22052 };
22053 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22054 }
22055
22056 pub fn by_item(
22058 self,
22059 ) -> impl google_cloud_gax::paginator::ItemPaginator<crate::model::ListToolsResponse, crate::Error>
22060 {
22061 use google_cloud_gax::paginator::Paginator;
22062 self.by_page().items()
22063 }
22064
22065 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22069 self.0.request.parent = v.into();
22070 self
22071 }
22072
22073 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22075 self.0.request.page_size = v.into();
22076 self
22077 }
22078
22079 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22081 self.0.request.page_token = v.into();
22082 self
22083 }
22084 }
22085
22086 #[doc(hidden)]
22087 impl crate::RequestBuilder for ListTools {
22088 fn request_options(&mut self) -> &mut crate::RequestOptions {
22089 &mut self.0.options
22090 }
22091 }
22092
22093 #[derive(Clone, Debug)]
22110 pub struct DeleteTool(RequestBuilder<crate::model::DeleteToolRequest>);
22111
22112 impl DeleteTool {
22113 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22114 Self(RequestBuilder::new(stub))
22115 }
22116
22117 pub fn with_request<V: Into<crate::model::DeleteToolRequest>>(mut self, v: V) -> Self {
22119 self.0.request = v.into();
22120 self
22121 }
22122
22123 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22125 self.0.options = v.into();
22126 self
22127 }
22128
22129 pub async fn send(self) -> Result<()> {
22131 (*self.0.stub)
22132 .delete_tool(self.0.request, self.0.options)
22133 .await
22134 .map(crate::Response::into_body)
22135 }
22136
22137 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22141 self.0.request.name = v.into();
22142 self
22143 }
22144 }
22145
22146 #[doc(hidden)]
22147 impl crate::RequestBuilder for DeleteTool {
22148 fn request_options(&mut self) -> &mut crate::RequestOptions {
22149 &mut self.0.options
22150 }
22151 }
22152
22153 #[derive(Clone, Debug)]
22170 pub struct UpdateTool(RequestBuilder<crate::model::UpdateToolRequest>);
22171
22172 impl UpdateTool {
22173 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22174 Self(RequestBuilder::new(stub))
22175 }
22176
22177 pub fn with_request<V: Into<crate::model::UpdateToolRequest>>(mut self, v: V) -> Self {
22179 self.0.request = v.into();
22180 self
22181 }
22182
22183 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22185 self.0.options = v.into();
22186 self
22187 }
22188
22189 pub async fn send(self) -> Result<crate::model::Tool> {
22191 (*self.0.stub)
22192 .update_tool(self.0.request, self.0.options)
22193 .await
22194 .map(crate::Response::into_body)
22195 }
22196
22197 pub fn set_tool<T>(mut self, v: T) -> Self
22201 where
22202 T: std::convert::Into<crate::model::Tool>,
22203 {
22204 self.0.request.tool = std::option::Option::Some(v.into());
22205 self
22206 }
22207
22208 pub fn set_or_clear_tool<T>(mut self, v: std::option::Option<T>) -> Self
22212 where
22213 T: std::convert::Into<crate::model::Tool>,
22214 {
22215 self.0.request.tool = v.map(|x| x.into());
22216 self
22217 }
22218
22219 pub fn set_update_mask<T>(mut self, v: T) -> Self
22221 where
22222 T: std::convert::Into<wkt::FieldMask>,
22223 {
22224 self.0.request.update_mask = std::option::Option::Some(v.into());
22225 self
22226 }
22227
22228 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
22230 where
22231 T: std::convert::Into<wkt::FieldMask>,
22232 {
22233 self.0.request.update_mask = v.map(|x| x.into());
22234 self
22235 }
22236 }
22237
22238 #[doc(hidden)]
22239 impl crate::RequestBuilder for UpdateTool {
22240 fn request_options(&mut self) -> &mut crate::RequestOptions {
22241 &mut self.0.options
22242 }
22243 }
22244
22245 #[derive(Clone, Debug)]
22266 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
22267
22268 impl ListLocations {
22269 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22270 Self(RequestBuilder::new(stub))
22271 }
22272
22273 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
22275 mut self,
22276 v: V,
22277 ) -> Self {
22278 self.0.request = v.into();
22279 self
22280 }
22281
22282 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22284 self.0.options = v.into();
22285 self
22286 }
22287
22288 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
22290 (*self.0.stub)
22291 .list_locations(self.0.request, self.0.options)
22292 .await
22293 .map(crate::Response::into_body)
22294 }
22295
22296 pub fn by_page(
22298 self,
22299 ) -> impl google_cloud_gax::paginator::Paginator<
22300 google_cloud_location::model::ListLocationsResponse,
22301 crate::Error,
22302 > {
22303 use std::clone::Clone;
22304 let token = self.0.request.page_token.clone();
22305 let execute = move |token: String| {
22306 let mut builder = self.clone();
22307 builder.0.request = builder.0.request.set_page_token(token);
22308 builder.send()
22309 };
22310 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22311 }
22312
22313 pub fn by_item(
22315 self,
22316 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22317 google_cloud_location::model::ListLocationsResponse,
22318 crate::Error,
22319 > {
22320 use google_cloud_gax::paginator::Paginator;
22321 self.by_page().items()
22322 }
22323
22324 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22326 self.0.request.name = v.into();
22327 self
22328 }
22329
22330 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22332 self.0.request.filter = v.into();
22333 self
22334 }
22335
22336 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22338 self.0.request.page_size = v.into();
22339 self
22340 }
22341
22342 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22344 self.0.request.page_token = v.into();
22345 self
22346 }
22347 }
22348
22349 #[doc(hidden)]
22350 impl crate::RequestBuilder for ListLocations {
22351 fn request_options(&mut self) -> &mut crate::RequestOptions {
22352 &mut self.0.options
22353 }
22354 }
22355
22356 #[derive(Clone, Debug)]
22373 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
22374
22375 impl GetLocation {
22376 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22377 Self(RequestBuilder::new(stub))
22378 }
22379
22380 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
22382 mut self,
22383 v: V,
22384 ) -> Self {
22385 self.0.request = v.into();
22386 self
22387 }
22388
22389 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22391 self.0.options = v.into();
22392 self
22393 }
22394
22395 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
22397 (*self.0.stub)
22398 .get_location(self.0.request, self.0.options)
22399 .await
22400 .map(crate::Response::into_body)
22401 }
22402
22403 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22405 self.0.request.name = v.into();
22406 self
22407 }
22408 }
22409
22410 #[doc(hidden)]
22411 impl crate::RequestBuilder for GetLocation {
22412 fn request_options(&mut self) -> &mut crate::RequestOptions {
22413 &mut self.0.options
22414 }
22415 }
22416
22417 #[derive(Clone, Debug)]
22438 pub struct ListOperations(
22439 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
22440 );
22441
22442 impl ListOperations {
22443 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22444 Self(RequestBuilder::new(stub))
22445 }
22446
22447 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
22449 mut self,
22450 v: V,
22451 ) -> Self {
22452 self.0.request = v.into();
22453 self
22454 }
22455
22456 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22458 self.0.options = v.into();
22459 self
22460 }
22461
22462 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
22464 (*self.0.stub)
22465 .list_operations(self.0.request, self.0.options)
22466 .await
22467 .map(crate::Response::into_body)
22468 }
22469
22470 pub fn by_page(
22472 self,
22473 ) -> impl google_cloud_gax::paginator::Paginator<
22474 google_cloud_longrunning::model::ListOperationsResponse,
22475 crate::Error,
22476 > {
22477 use std::clone::Clone;
22478 let token = self.0.request.page_token.clone();
22479 let execute = move |token: String| {
22480 let mut builder = self.clone();
22481 builder.0.request = builder.0.request.set_page_token(token);
22482 builder.send()
22483 };
22484 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22485 }
22486
22487 pub fn by_item(
22489 self,
22490 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22491 google_cloud_longrunning::model::ListOperationsResponse,
22492 crate::Error,
22493 > {
22494 use google_cloud_gax::paginator::Paginator;
22495 self.by_page().items()
22496 }
22497
22498 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22500 self.0.request.name = v.into();
22501 self
22502 }
22503
22504 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
22506 self.0.request.filter = v.into();
22507 self
22508 }
22509
22510 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22512 self.0.request.page_size = v.into();
22513 self
22514 }
22515
22516 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22518 self.0.request.page_token = v.into();
22519 self
22520 }
22521
22522 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
22524 self.0.request.return_partial_success = v.into();
22525 self
22526 }
22527 }
22528
22529 #[doc(hidden)]
22530 impl crate::RequestBuilder for ListOperations {
22531 fn request_options(&mut self) -> &mut crate::RequestOptions {
22532 &mut self.0.options
22533 }
22534 }
22535
22536 #[derive(Clone, Debug)]
22553 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
22554
22555 impl GetOperation {
22556 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22557 Self(RequestBuilder::new(stub))
22558 }
22559
22560 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
22562 mut self,
22563 v: V,
22564 ) -> Self {
22565 self.0.request = v.into();
22566 self
22567 }
22568
22569 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22571 self.0.options = v.into();
22572 self
22573 }
22574
22575 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
22577 (*self.0.stub)
22578 .get_operation(self.0.request, self.0.options)
22579 .await
22580 .map(crate::Response::into_body)
22581 }
22582
22583 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22585 self.0.request.name = v.into();
22586 self
22587 }
22588 }
22589
22590 #[doc(hidden)]
22591 impl crate::RequestBuilder for GetOperation {
22592 fn request_options(&mut self) -> &mut crate::RequestOptions {
22593 &mut self.0.options
22594 }
22595 }
22596
22597 #[derive(Clone, Debug)]
22614 pub struct CancelOperation(
22615 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
22616 );
22617
22618 impl CancelOperation {
22619 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Tools>) -> Self {
22620 Self(RequestBuilder::new(stub))
22621 }
22622
22623 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
22625 mut self,
22626 v: V,
22627 ) -> Self {
22628 self.0.request = v.into();
22629 self
22630 }
22631
22632 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22634 self.0.options = v.into();
22635 self
22636 }
22637
22638 pub async fn send(self) -> Result<()> {
22640 (*self.0.stub)
22641 .cancel_operation(self.0.request, self.0.options)
22642 .await
22643 .map(crate::Response::into_body)
22644 }
22645
22646 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22648 self.0.request.name = v.into();
22649 self
22650 }
22651 }
22652
22653 #[doc(hidden)]
22654 impl crate::RequestBuilder for CancelOperation {
22655 fn request_options(&mut self) -> &mut crate::RequestOptions {
22656 &mut self.0.options
22657 }
22658 }
22659}
22660
22661#[cfg(feature = "versions")]
22663#[cfg_attr(docsrs, doc(cfg(feature = "versions")))]
22664pub mod versions {
22665 use crate::Result;
22666
22667 pub type ClientBuilder = crate::ClientBuilder<client::Factory, gaxi::options::Credentials>;
22681
22682 pub(crate) mod client {
22683 use super::super::super::client::Versions;
22684 pub struct Factory;
22685 impl crate::ClientFactory for Factory {
22686 type Client = Versions;
22687 type Credentials = gaxi::options::Credentials;
22688 async fn build(
22689 self,
22690 config: gaxi::options::ClientConfig,
22691 ) -> crate::ClientBuilderResult<Self::Client> {
22692 Self::Client::new(config).await
22693 }
22694 }
22695 }
22696
22697 #[derive(Clone, Debug)]
22699 pub(crate) struct RequestBuilder<R: std::default::Default> {
22700 stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>,
22701 request: R,
22702 options: crate::RequestOptions,
22703 }
22704
22705 impl<R> RequestBuilder<R>
22706 where
22707 R: std::default::Default,
22708 {
22709 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22710 Self {
22711 stub,
22712 request: R::default(),
22713 options: crate::RequestOptions::default(),
22714 }
22715 }
22716 }
22717
22718 #[derive(Clone, Debug)]
22739 pub struct ListVersions(RequestBuilder<crate::model::ListVersionsRequest>);
22740
22741 impl ListVersions {
22742 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22743 Self(RequestBuilder::new(stub))
22744 }
22745
22746 pub fn with_request<V: Into<crate::model::ListVersionsRequest>>(mut self, v: V) -> Self {
22748 self.0.request = v.into();
22749 self
22750 }
22751
22752 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22754 self.0.options = v.into();
22755 self
22756 }
22757
22758 pub async fn send(self) -> Result<crate::model::ListVersionsResponse> {
22760 (*self.0.stub)
22761 .list_versions(self.0.request, self.0.options)
22762 .await
22763 .map(crate::Response::into_body)
22764 }
22765
22766 pub fn by_page(
22768 self,
22769 ) -> impl google_cloud_gax::paginator::Paginator<crate::model::ListVersionsResponse, crate::Error>
22770 {
22771 use std::clone::Clone;
22772 let token = self.0.request.page_token.clone();
22773 let execute = move |token: String| {
22774 let mut builder = self.clone();
22775 builder.0.request = builder.0.request.set_page_token(token);
22776 builder.send()
22777 };
22778 google_cloud_gax::paginator::internal::new_paginator(token, execute)
22779 }
22780
22781 pub fn by_item(
22783 self,
22784 ) -> impl google_cloud_gax::paginator::ItemPaginator<
22785 crate::model::ListVersionsResponse,
22786 crate::Error,
22787 > {
22788 use google_cloud_gax::paginator::Paginator;
22789 self.by_page().items()
22790 }
22791
22792 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22796 self.0.request.parent = v.into();
22797 self
22798 }
22799
22800 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
22802 self.0.request.page_size = v.into();
22803 self
22804 }
22805
22806 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
22808 self.0.request.page_token = v.into();
22809 self
22810 }
22811 }
22812
22813 #[doc(hidden)]
22814 impl crate::RequestBuilder for ListVersions {
22815 fn request_options(&mut self) -> &mut crate::RequestOptions {
22816 &mut self.0.options
22817 }
22818 }
22819
22820 #[derive(Clone, Debug)]
22837 pub struct GetVersion(RequestBuilder<crate::model::GetVersionRequest>);
22838
22839 impl GetVersion {
22840 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22841 Self(RequestBuilder::new(stub))
22842 }
22843
22844 pub fn with_request<V: Into<crate::model::GetVersionRequest>>(mut self, v: V) -> Self {
22846 self.0.request = v.into();
22847 self
22848 }
22849
22850 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22852 self.0.options = v.into();
22853 self
22854 }
22855
22856 pub async fn send(self) -> Result<crate::model::Version> {
22858 (*self.0.stub)
22859 .get_version(self.0.request, self.0.options)
22860 .await
22861 .map(crate::Response::into_body)
22862 }
22863
22864 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
22868 self.0.request.name = v.into();
22869 self
22870 }
22871 }
22872
22873 #[doc(hidden)]
22874 impl crate::RequestBuilder for GetVersion {
22875 fn request_options(&mut self) -> &mut crate::RequestOptions {
22876 &mut self.0.options
22877 }
22878 }
22879
22880 #[derive(Clone, Debug)]
22897 pub struct CreateVersion(RequestBuilder<crate::model::CreateVersionRequest>);
22898
22899 impl CreateVersion {
22900 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22901 Self(RequestBuilder::new(stub))
22902 }
22903
22904 pub fn with_request<V: Into<crate::model::CreateVersionRequest>>(mut self, v: V) -> Self {
22906 self.0.request = v.into();
22907 self
22908 }
22909
22910 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22912 self.0.options = v.into();
22913 self
22914 }
22915
22916 pub async fn send(self) -> Result<crate::model::Version> {
22918 (*self.0.stub)
22919 .create_version(self.0.request, self.0.options)
22920 .await
22921 .map(crate::Response::into_body)
22922 }
22923
22924 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
22928 self.0.request.parent = v.into();
22929 self
22930 }
22931
22932 pub fn set_version<T>(mut self, v: T) -> Self
22936 where
22937 T: std::convert::Into<crate::model::Version>,
22938 {
22939 self.0.request.version = std::option::Option::Some(v.into());
22940 self
22941 }
22942
22943 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
22947 where
22948 T: std::convert::Into<crate::model::Version>,
22949 {
22950 self.0.request.version = v.map(|x| x.into());
22951 self
22952 }
22953 }
22954
22955 #[doc(hidden)]
22956 impl crate::RequestBuilder for CreateVersion {
22957 fn request_options(&mut self) -> &mut crate::RequestOptions {
22958 &mut self.0.options
22959 }
22960 }
22961
22962 #[derive(Clone, Debug)]
22979 pub struct UpdateVersion(RequestBuilder<crate::model::UpdateVersionRequest>);
22980
22981 impl UpdateVersion {
22982 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
22983 Self(RequestBuilder::new(stub))
22984 }
22985
22986 pub fn with_request<V: Into<crate::model::UpdateVersionRequest>>(mut self, v: V) -> Self {
22988 self.0.request = v.into();
22989 self
22990 }
22991
22992 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
22994 self.0.options = v.into();
22995 self
22996 }
22997
22998 pub async fn send(self) -> Result<crate::model::Version> {
23000 (*self.0.stub)
23001 .update_version(self.0.request, self.0.options)
23002 .await
23003 .map(crate::Response::into_body)
23004 }
23005
23006 pub fn set_version<T>(mut self, v: T) -> Self
23010 where
23011 T: std::convert::Into<crate::model::Version>,
23012 {
23013 self.0.request.version = std::option::Option::Some(v.into());
23014 self
23015 }
23016
23017 pub fn set_or_clear_version<T>(mut self, v: std::option::Option<T>) -> Self
23021 where
23022 T: std::convert::Into<crate::model::Version>,
23023 {
23024 self.0.request.version = v.map(|x| x.into());
23025 self
23026 }
23027
23028 pub fn set_update_mask<T>(mut self, v: T) -> Self
23032 where
23033 T: std::convert::Into<wkt::FieldMask>,
23034 {
23035 self.0.request.update_mask = std::option::Option::Some(v.into());
23036 self
23037 }
23038
23039 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
23043 where
23044 T: std::convert::Into<wkt::FieldMask>,
23045 {
23046 self.0.request.update_mask = v.map(|x| x.into());
23047 self
23048 }
23049 }
23050
23051 #[doc(hidden)]
23052 impl crate::RequestBuilder for UpdateVersion {
23053 fn request_options(&mut self) -> &mut crate::RequestOptions {
23054 &mut self.0.options
23055 }
23056 }
23057
23058 #[derive(Clone, Debug)]
23075 pub struct DeleteVersion(RequestBuilder<crate::model::DeleteVersionRequest>);
23076
23077 impl DeleteVersion {
23078 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23079 Self(RequestBuilder::new(stub))
23080 }
23081
23082 pub fn with_request<V: Into<crate::model::DeleteVersionRequest>>(mut self, v: V) -> Self {
23084 self.0.request = v.into();
23085 self
23086 }
23087
23088 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23090 self.0.options = v.into();
23091 self
23092 }
23093
23094 pub async fn send(self) -> Result<()> {
23096 (*self.0.stub)
23097 .delete_version(self.0.request, self.0.options)
23098 .await
23099 .map(crate::Response::into_body)
23100 }
23101
23102 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23106 self.0.request.name = v.into();
23107 self
23108 }
23109 }
23110
23111 #[doc(hidden)]
23112 impl crate::RequestBuilder for DeleteVersion {
23113 fn request_options(&mut self) -> &mut crate::RequestOptions {
23114 &mut self.0.options
23115 }
23116 }
23117
23118 #[derive(Clone, Debug)]
23139 pub struct ListLocations(RequestBuilder<google_cloud_location::model::ListLocationsRequest>);
23140
23141 impl ListLocations {
23142 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23143 Self(RequestBuilder::new(stub))
23144 }
23145
23146 pub fn with_request<V: Into<google_cloud_location::model::ListLocationsRequest>>(
23148 mut self,
23149 v: V,
23150 ) -> Self {
23151 self.0.request = v.into();
23152 self
23153 }
23154
23155 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23157 self.0.options = v.into();
23158 self
23159 }
23160
23161 pub async fn send(self) -> Result<google_cloud_location::model::ListLocationsResponse> {
23163 (*self.0.stub)
23164 .list_locations(self.0.request, self.0.options)
23165 .await
23166 .map(crate::Response::into_body)
23167 }
23168
23169 pub fn by_page(
23171 self,
23172 ) -> impl google_cloud_gax::paginator::Paginator<
23173 google_cloud_location::model::ListLocationsResponse,
23174 crate::Error,
23175 > {
23176 use std::clone::Clone;
23177 let token = self.0.request.page_token.clone();
23178 let execute = move |token: String| {
23179 let mut builder = self.clone();
23180 builder.0.request = builder.0.request.set_page_token(token);
23181 builder.send()
23182 };
23183 google_cloud_gax::paginator::internal::new_paginator(token, execute)
23184 }
23185
23186 pub fn by_item(
23188 self,
23189 ) -> impl google_cloud_gax::paginator::ItemPaginator<
23190 google_cloud_location::model::ListLocationsResponse,
23191 crate::Error,
23192 > {
23193 use google_cloud_gax::paginator::Paginator;
23194 self.by_page().items()
23195 }
23196
23197 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23199 self.0.request.name = v.into();
23200 self
23201 }
23202
23203 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23205 self.0.request.filter = v.into();
23206 self
23207 }
23208
23209 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23211 self.0.request.page_size = v.into();
23212 self
23213 }
23214
23215 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23217 self.0.request.page_token = v.into();
23218 self
23219 }
23220 }
23221
23222 #[doc(hidden)]
23223 impl crate::RequestBuilder for ListLocations {
23224 fn request_options(&mut self) -> &mut crate::RequestOptions {
23225 &mut self.0.options
23226 }
23227 }
23228
23229 #[derive(Clone, Debug)]
23246 pub struct GetLocation(RequestBuilder<google_cloud_location::model::GetLocationRequest>);
23247
23248 impl GetLocation {
23249 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23250 Self(RequestBuilder::new(stub))
23251 }
23252
23253 pub fn with_request<V: Into<google_cloud_location::model::GetLocationRequest>>(
23255 mut self,
23256 v: V,
23257 ) -> Self {
23258 self.0.request = v.into();
23259 self
23260 }
23261
23262 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23264 self.0.options = v.into();
23265 self
23266 }
23267
23268 pub async fn send(self) -> Result<google_cloud_location::model::Location> {
23270 (*self.0.stub)
23271 .get_location(self.0.request, self.0.options)
23272 .await
23273 .map(crate::Response::into_body)
23274 }
23275
23276 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23278 self.0.request.name = v.into();
23279 self
23280 }
23281 }
23282
23283 #[doc(hidden)]
23284 impl crate::RequestBuilder for GetLocation {
23285 fn request_options(&mut self) -> &mut crate::RequestOptions {
23286 &mut self.0.options
23287 }
23288 }
23289
23290 #[derive(Clone, Debug)]
23311 pub struct ListOperations(
23312 RequestBuilder<google_cloud_longrunning::model::ListOperationsRequest>,
23313 );
23314
23315 impl ListOperations {
23316 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23317 Self(RequestBuilder::new(stub))
23318 }
23319
23320 pub fn with_request<V: Into<google_cloud_longrunning::model::ListOperationsRequest>>(
23322 mut self,
23323 v: V,
23324 ) -> Self {
23325 self.0.request = v.into();
23326 self
23327 }
23328
23329 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23331 self.0.options = v.into();
23332 self
23333 }
23334
23335 pub async fn send(self) -> Result<google_cloud_longrunning::model::ListOperationsResponse> {
23337 (*self.0.stub)
23338 .list_operations(self.0.request, self.0.options)
23339 .await
23340 .map(crate::Response::into_body)
23341 }
23342
23343 pub fn by_page(
23345 self,
23346 ) -> impl google_cloud_gax::paginator::Paginator<
23347 google_cloud_longrunning::model::ListOperationsResponse,
23348 crate::Error,
23349 > {
23350 use std::clone::Clone;
23351 let token = self.0.request.page_token.clone();
23352 let execute = move |token: String| {
23353 let mut builder = self.clone();
23354 builder.0.request = builder.0.request.set_page_token(token);
23355 builder.send()
23356 };
23357 google_cloud_gax::paginator::internal::new_paginator(token, execute)
23358 }
23359
23360 pub fn by_item(
23362 self,
23363 ) -> impl google_cloud_gax::paginator::ItemPaginator<
23364 google_cloud_longrunning::model::ListOperationsResponse,
23365 crate::Error,
23366 > {
23367 use google_cloud_gax::paginator::Paginator;
23368 self.by_page().items()
23369 }
23370
23371 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23373 self.0.request.name = v.into();
23374 self
23375 }
23376
23377 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
23379 self.0.request.filter = v.into();
23380 self
23381 }
23382
23383 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
23385 self.0.request.page_size = v.into();
23386 self
23387 }
23388
23389 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
23391 self.0.request.page_token = v.into();
23392 self
23393 }
23394
23395 pub fn set_return_partial_success<T: Into<bool>>(mut self, v: T) -> Self {
23397 self.0.request.return_partial_success = v.into();
23398 self
23399 }
23400 }
23401
23402 #[doc(hidden)]
23403 impl crate::RequestBuilder for ListOperations {
23404 fn request_options(&mut self) -> &mut crate::RequestOptions {
23405 &mut self.0.options
23406 }
23407 }
23408
23409 #[derive(Clone, Debug)]
23426 pub struct GetOperation(RequestBuilder<google_cloud_longrunning::model::GetOperationRequest>);
23427
23428 impl GetOperation {
23429 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23430 Self(RequestBuilder::new(stub))
23431 }
23432
23433 pub fn with_request<V: Into<google_cloud_longrunning::model::GetOperationRequest>>(
23435 mut self,
23436 v: V,
23437 ) -> Self {
23438 self.0.request = v.into();
23439 self
23440 }
23441
23442 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23444 self.0.options = v.into();
23445 self
23446 }
23447
23448 pub async fn send(self) -> Result<google_cloud_longrunning::model::Operation> {
23450 (*self.0.stub)
23451 .get_operation(self.0.request, self.0.options)
23452 .await
23453 .map(crate::Response::into_body)
23454 }
23455
23456 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23458 self.0.request.name = v.into();
23459 self
23460 }
23461 }
23462
23463 #[doc(hidden)]
23464 impl crate::RequestBuilder for GetOperation {
23465 fn request_options(&mut self) -> &mut crate::RequestOptions {
23466 &mut self.0.options
23467 }
23468 }
23469
23470 #[derive(Clone, Debug)]
23487 pub struct CancelOperation(
23488 RequestBuilder<google_cloud_longrunning::model::CancelOperationRequest>,
23489 );
23490
23491 impl CancelOperation {
23492 pub(crate) fn new(stub: std::sync::Arc<dyn super::super::stub::dynamic::Versions>) -> Self {
23493 Self(RequestBuilder::new(stub))
23494 }
23495
23496 pub fn with_request<V: Into<google_cloud_longrunning::model::CancelOperationRequest>>(
23498 mut self,
23499 v: V,
23500 ) -> Self {
23501 self.0.request = v.into();
23502 self
23503 }
23504
23505 pub fn with_options<V: Into<crate::RequestOptions>>(mut self, v: V) -> Self {
23507 self.0.options = v.into();
23508 self
23509 }
23510
23511 pub async fn send(self) -> Result<()> {
23513 (*self.0.stub)
23514 .cancel_operation(self.0.request, self.0.options)
23515 .await
23516 .map(crate::Response::into_body)
23517 }
23518
23519 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
23521 self.0.request.name = v.into();
23522 self
23523 }
23524 }
23525
23526 #[doc(hidden)]
23527 impl crate::RequestBuilder for CancelOperation {
23528 fn request_options(&mut self) -> &mut crate::RequestOptions {
23529 &mut self.0.options
23530 }
23531 }
23532}