1pub mod case_attachment_service {
18 use crate::Result;
19
20 pub type ClientBuilder =
34 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
35
36 pub(crate) mod client {
37 use super::super::super::client::CaseAttachmentService;
38 pub struct Factory;
39 impl gax::client_builder::internal::ClientFactory for Factory {
40 type Client = CaseAttachmentService;
41 type Credentials = gaxi::options::Credentials;
42 async fn build(
43 self,
44 config: gaxi::options::ClientConfig,
45 ) -> gax::client_builder::Result<Self::Client> {
46 Self::Client::new(config).await
47 }
48 }
49 }
50
51 #[derive(Clone, Debug)]
53 pub(crate) struct RequestBuilder<R: std::default::Default> {
54 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseAttachmentService>,
55 request: R,
56 options: gax::options::RequestOptions,
57 }
58
59 impl<R> RequestBuilder<R>
60 where
61 R: std::default::Default,
62 {
63 pub(crate) fn new(
64 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseAttachmentService>,
65 ) -> Self {
66 Self {
67 stub,
68 request: R::default(),
69 options: gax::options::RequestOptions::default(),
70 }
71 }
72 }
73
74 #[derive(Clone, Debug)]
96 pub struct ListAttachments(RequestBuilder<crate::model::ListAttachmentsRequest>);
97
98 impl ListAttachments {
99 pub(crate) fn new(
100 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseAttachmentService>,
101 ) -> Self {
102 Self(RequestBuilder::new(stub))
103 }
104
105 pub fn with_request<V: Into<crate::model::ListAttachmentsRequest>>(mut self, v: V) -> Self {
107 self.0.request = v.into();
108 self
109 }
110
111 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
113 self.0.options = v.into();
114 self
115 }
116
117 pub async fn send(self) -> Result<crate::model::ListAttachmentsResponse> {
119 (*self.0.stub)
120 .list_attachments(self.0.request, self.0.options)
121 .await
122 .map(gax::response::Response::into_body)
123 }
124
125 pub fn by_page(
127 self,
128 ) -> impl gax::paginator::Paginator<crate::model::ListAttachmentsResponse, gax::error::Error>
129 {
130 use std::clone::Clone;
131 let token = self.0.request.page_token.clone();
132 let execute = move |token: String| {
133 let mut builder = self.clone();
134 builder.0.request = builder.0.request.set_page_token(token);
135 builder.send()
136 };
137 gax::paginator::internal::new_paginator(token, execute)
138 }
139
140 pub fn by_item(
142 self,
143 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAttachmentsResponse, gax::error::Error>
144 {
145 use gax::paginator::Paginator;
146 self.by_page().items()
147 }
148
149 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
153 self.0.request.parent = v.into();
154 self
155 }
156
157 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
159 self.0.request.page_size = v.into();
160 self
161 }
162
163 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
165 self.0.request.page_token = v.into();
166 self
167 }
168 }
169
170 #[doc(hidden)]
171 impl gax::options::internal::RequestBuilder for ListAttachments {
172 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
173 &mut self.0.options
174 }
175 }
176}
177
178pub mod case_service {
179 use crate::Result;
180
181 pub type ClientBuilder =
195 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
196
197 pub(crate) mod client {
198 use super::super::super::client::CaseService;
199 pub struct Factory;
200 impl gax::client_builder::internal::ClientFactory for Factory {
201 type Client = CaseService;
202 type Credentials = gaxi::options::Credentials;
203 async fn build(
204 self,
205 config: gaxi::options::ClientConfig,
206 ) -> gax::client_builder::Result<Self::Client> {
207 Self::Client::new(config).await
208 }
209 }
210 }
211
212 #[derive(Clone, Debug)]
214 pub(crate) struct RequestBuilder<R: std::default::Default> {
215 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
216 request: R,
217 options: gax::options::RequestOptions,
218 }
219
220 impl<R> RequestBuilder<R>
221 where
222 R: std::default::Default,
223 {
224 pub(crate) fn new(
225 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
226 ) -> Self {
227 Self {
228 stub,
229 request: R::default(),
230 options: gax::options::RequestOptions::default(),
231 }
232 }
233 }
234
235 #[derive(Clone, Debug)]
253 pub struct GetCase(RequestBuilder<crate::model::GetCaseRequest>);
254
255 impl GetCase {
256 pub(crate) fn new(
257 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
258 ) -> Self {
259 Self(RequestBuilder::new(stub))
260 }
261
262 pub fn with_request<V: Into<crate::model::GetCaseRequest>>(mut self, v: V) -> Self {
264 self.0.request = v.into();
265 self
266 }
267
268 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
270 self.0.options = v.into();
271 self
272 }
273
274 pub async fn send(self) -> Result<crate::model::Case> {
276 (*self.0.stub)
277 .get_case(self.0.request, self.0.options)
278 .await
279 .map(gax::response::Response::into_body)
280 }
281
282 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
286 self.0.request.name = v.into();
287 self
288 }
289 }
290
291 #[doc(hidden)]
292 impl gax::options::internal::RequestBuilder for GetCase {
293 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
294 &mut self.0.options
295 }
296 }
297
298 #[derive(Clone, Debug)]
320 pub struct ListCases(RequestBuilder<crate::model::ListCasesRequest>);
321
322 impl ListCases {
323 pub(crate) fn new(
324 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
325 ) -> Self {
326 Self(RequestBuilder::new(stub))
327 }
328
329 pub fn with_request<V: Into<crate::model::ListCasesRequest>>(mut self, v: V) -> Self {
331 self.0.request = v.into();
332 self
333 }
334
335 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
337 self.0.options = v.into();
338 self
339 }
340
341 pub async fn send(self) -> Result<crate::model::ListCasesResponse> {
343 (*self.0.stub)
344 .list_cases(self.0.request, self.0.options)
345 .await
346 .map(gax::response::Response::into_body)
347 }
348
349 pub fn by_page(
351 self,
352 ) -> impl gax::paginator::Paginator<crate::model::ListCasesResponse, gax::error::Error>
353 {
354 use std::clone::Clone;
355 let token = self.0.request.page_token.clone();
356 let execute = move |token: String| {
357 let mut builder = self.clone();
358 builder.0.request = builder.0.request.set_page_token(token);
359 builder.send()
360 };
361 gax::paginator::internal::new_paginator(token, execute)
362 }
363
364 pub fn by_item(
366 self,
367 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCasesResponse, gax::error::Error>
368 {
369 use gax::paginator::Paginator;
370 self.by_page().items()
371 }
372
373 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
377 self.0.request.parent = v.into();
378 self
379 }
380
381 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
383 self.0.request.filter = v.into();
384 self
385 }
386
387 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
389 self.0.request.page_size = v.into();
390 self
391 }
392
393 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
395 self.0.request.page_token = v.into();
396 self
397 }
398 }
399
400 #[doc(hidden)]
401 impl gax::options::internal::RequestBuilder for ListCases {
402 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
403 &mut self.0.options
404 }
405 }
406
407 #[derive(Clone, Debug)]
429 pub struct SearchCases(RequestBuilder<crate::model::SearchCasesRequest>);
430
431 impl SearchCases {
432 pub(crate) fn new(
433 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
434 ) -> Self {
435 Self(RequestBuilder::new(stub))
436 }
437
438 pub fn with_request<V: Into<crate::model::SearchCasesRequest>>(mut self, v: V) -> Self {
440 self.0.request = v.into();
441 self
442 }
443
444 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
446 self.0.options = v.into();
447 self
448 }
449
450 pub async fn send(self) -> Result<crate::model::SearchCasesResponse> {
452 (*self.0.stub)
453 .search_cases(self.0.request, self.0.options)
454 .await
455 .map(gax::response::Response::into_body)
456 }
457
458 pub fn by_page(
460 self,
461 ) -> impl gax::paginator::Paginator<crate::model::SearchCasesResponse, gax::error::Error>
462 {
463 use std::clone::Clone;
464 let token = self.0.request.page_token.clone();
465 let execute = move |token: String| {
466 let mut builder = self.clone();
467 builder.0.request = builder.0.request.set_page_token(token);
468 builder.send()
469 };
470 gax::paginator::internal::new_paginator(token, execute)
471 }
472
473 pub fn by_item(
475 self,
476 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchCasesResponse, gax::error::Error>
477 {
478 use gax::paginator::Paginator;
479 self.by_page().items()
480 }
481
482 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
484 self.0.request.parent = v.into();
485 self
486 }
487
488 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
490 self.0.request.query = v.into();
491 self
492 }
493
494 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
496 self.0.request.page_size = v.into();
497 self
498 }
499
500 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
502 self.0.request.page_token = v.into();
503 self
504 }
505 }
506
507 #[doc(hidden)]
508 impl gax::options::internal::RequestBuilder for SearchCases {
509 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
510 &mut self.0.options
511 }
512 }
513
514 #[derive(Clone, Debug)]
532 pub struct CreateCase(RequestBuilder<crate::model::CreateCaseRequest>);
533
534 impl CreateCase {
535 pub(crate) fn new(
536 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
537 ) -> Self {
538 Self(RequestBuilder::new(stub))
539 }
540
541 pub fn with_request<V: Into<crate::model::CreateCaseRequest>>(mut self, v: V) -> Self {
543 self.0.request = v.into();
544 self
545 }
546
547 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
549 self.0.options = v.into();
550 self
551 }
552
553 pub async fn send(self) -> Result<crate::model::Case> {
555 (*self.0.stub)
556 .create_case(self.0.request, self.0.options)
557 .await
558 .map(gax::response::Response::into_body)
559 }
560
561 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
565 self.0.request.parent = v.into();
566 self
567 }
568
569 pub fn set_case<T>(mut self, v: T) -> Self
573 where
574 T: std::convert::Into<crate::model::Case>,
575 {
576 self.0.request.case = std::option::Option::Some(v.into());
577 self
578 }
579
580 pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
584 where
585 T: std::convert::Into<crate::model::Case>,
586 {
587 self.0.request.case = v.map(|x| x.into());
588 self
589 }
590 }
591
592 #[doc(hidden)]
593 impl gax::options::internal::RequestBuilder for CreateCase {
594 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
595 &mut self.0.options
596 }
597 }
598
599 #[derive(Clone, Debug)]
617 pub struct UpdateCase(RequestBuilder<crate::model::UpdateCaseRequest>);
618
619 impl UpdateCase {
620 pub(crate) fn new(
621 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
622 ) -> Self {
623 Self(RequestBuilder::new(stub))
624 }
625
626 pub fn with_request<V: Into<crate::model::UpdateCaseRequest>>(mut self, v: V) -> Self {
628 self.0.request = v.into();
629 self
630 }
631
632 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
634 self.0.options = v.into();
635 self
636 }
637
638 pub async fn send(self) -> Result<crate::model::Case> {
640 (*self.0.stub)
641 .update_case(self.0.request, self.0.options)
642 .await
643 .map(gax::response::Response::into_body)
644 }
645
646 pub fn set_case<T>(mut self, v: T) -> Self
650 where
651 T: std::convert::Into<crate::model::Case>,
652 {
653 self.0.request.case = std::option::Option::Some(v.into());
654 self
655 }
656
657 pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
661 where
662 T: std::convert::Into<crate::model::Case>,
663 {
664 self.0.request.case = v.map(|x| x.into());
665 self
666 }
667
668 pub fn set_update_mask<T>(mut self, v: T) -> Self
670 where
671 T: std::convert::Into<wkt::FieldMask>,
672 {
673 self.0.request.update_mask = std::option::Option::Some(v.into());
674 self
675 }
676
677 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
679 where
680 T: std::convert::Into<wkt::FieldMask>,
681 {
682 self.0.request.update_mask = v.map(|x| x.into());
683 self
684 }
685 }
686
687 #[doc(hidden)]
688 impl gax::options::internal::RequestBuilder for UpdateCase {
689 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
690 &mut self.0.options
691 }
692 }
693
694 #[derive(Clone, Debug)]
712 pub struct EscalateCase(RequestBuilder<crate::model::EscalateCaseRequest>);
713
714 impl EscalateCase {
715 pub(crate) fn new(
716 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
717 ) -> Self {
718 Self(RequestBuilder::new(stub))
719 }
720
721 pub fn with_request<V: Into<crate::model::EscalateCaseRequest>>(mut self, v: V) -> Self {
723 self.0.request = v.into();
724 self
725 }
726
727 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
729 self.0.options = v.into();
730 self
731 }
732
733 pub async fn send(self) -> Result<crate::model::Case> {
735 (*self.0.stub)
736 .escalate_case(self.0.request, self.0.options)
737 .await
738 .map(gax::response::Response::into_body)
739 }
740
741 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
745 self.0.request.name = v.into();
746 self
747 }
748
749 pub fn set_escalation<T>(mut self, v: T) -> Self
751 where
752 T: std::convert::Into<crate::model::Escalation>,
753 {
754 self.0.request.escalation = std::option::Option::Some(v.into());
755 self
756 }
757
758 pub fn set_or_clear_escalation<T>(mut self, v: std::option::Option<T>) -> Self
760 where
761 T: std::convert::Into<crate::model::Escalation>,
762 {
763 self.0.request.escalation = v.map(|x| x.into());
764 self
765 }
766 }
767
768 #[doc(hidden)]
769 impl gax::options::internal::RequestBuilder for EscalateCase {
770 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
771 &mut self.0.options
772 }
773 }
774
775 #[derive(Clone, Debug)]
793 pub struct CloseCase(RequestBuilder<crate::model::CloseCaseRequest>);
794
795 impl CloseCase {
796 pub(crate) fn new(
797 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
798 ) -> Self {
799 Self(RequestBuilder::new(stub))
800 }
801
802 pub fn with_request<V: Into<crate::model::CloseCaseRequest>>(mut self, v: V) -> Self {
804 self.0.request = v.into();
805 self
806 }
807
808 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
810 self.0.options = v.into();
811 self
812 }
813
814 pub async fn send(self) -> Result<crate::model::Case> {
816 (*self.0.stub)
817 .close_case(self.0.request, self.0.options)
818 .await
819 .map(gax::response::Response::into_body)
820 }
821
822 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
826 self.0.request.name = v.into();
827 self
828 }
829 }
830
831 #[doc(hidden)]
832 impl gax::options::internal::RequestBuilder for CloseCase {
833 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
834 &mut self.0.options
835 }
836 }
837
838 #[derive(Clone, Debug)]
860 pub struct SearchCaseClassifications(
861 RequestBuilder<crate::model::SearchCaseClassificationsRequest>,
862 );
863
864 impl SearchCaseClassifications {
865 pub(crate) fn new(
866 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
867 ) -> Self {
868 Self(RequestBuilder::new(stub))
869 }
870
871 pub fn with_request<V: Into<crate::model::SearchCaseClassificationsRequest>>(
873 mut self,
874 v: V,
875 ) -> Self {
876 self.0.request = v.into();
877 self
878 }
879
880 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
882 self.0.options = v.into();
883 self
884 }
885
886 pub async fn send(self) -> Result<crate::model::SearchCaseClassificationsResponse> {
888 (*self.0.stub)
889 .search_case_classifications(self.0.request, self.0.options)
890 .await
891 .map(gax::response::Response::into_body)
892 }
893
894 pub fn by_page(
896 self,
897 ) -> impl gax::paginator::Paginator<
898 crate::model::SearchCaseClassificationsResponse,
899 gax::error::Error,
900 > {
901 use std::clone::Clone;
902 let token = self.0.request.page_token.clone();
903 let execute = move |token: String| {
904 let mut builder = self.clone();
905 builder.0.request = builder.0.request.set_page_token(token);
906 builder.send()
907 };
908 gax::paginator::internal::new_paginator(token, execute)
909 }
910
911 pub fn by_item(
913 self,
914 ) -> impl gax::paginator::ItemPaginator<
915 crate::model::SearchCaseClassificationsResponse,
916 gax::error::Error,
917 > {
918 use gax::paginator::Paginator;
919 self.by_page().items()
920 }
921
922 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
924 self.0.request.query = v.into();
925 self
926 }
927
928 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
930 self.0.request.page_size = v.into();
931 self
932 }
933
934 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
936 self.0.request.page_token = v.into();
937 self
938 }
939 }
940
941 #[doc(hidden)]
942 impl gax::options::internal::RequestBuilder for SearchCaseClassifications {
943 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
944 &mut self.0.options
945 }
946 }
947}
948
949pub mod comment_service {
950 use crate::Result;
951
952 pub type ClientBuilder =
966 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
967
968 pub(crate) mod client {
969 use super::super::super::client::CommentService;
970 pub struct Factory;
971 impl gax::client_builder::internal::ClientFactory for Factory {
972 type Client = CommentService;
973 type Credentials = gaxi::options::Credentials;
974 async fn build(
975 self,
976 config: gaxi::options::ClientConfig,
977 ) -> gax::client_builder::Result<Self::Client> {
978 Self::Client::new(config).await
979 }
980 }
981 }
982
983 #[derive(Clone, Debug)]
985 pub(crate) struct RequestBuilder<R: std::default::Default> {
986 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
987 request: R,
988 options: gax::options::RequestOptions,
989 }
990
991 impl<R> RequestBuilder<R>
992 where
993 R: std::default::Default,
994 {
995 pub(crate) fn new(
996 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
997 ) -> Self {
998 Self {
999 stub,
1000 request: R::default(),
1001 options: gax::options::RequestOptions::default(),
1002 }
1003 }
1004 }
1005
1006 #[derive(Clone, Debug)]
1028 pub struct ListComments(RequestBuilder<crate::model::ListCommentsRequest>);
1029
1030 impl ListComments {
1031 pub(crate) fn new(
1032 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
1033 ) -> Self {
1034 Self(RequestBuilder::new(stub))
1035 }
1036
1037 pub fn with_request<V: Into<crate::model::ListCommentsRequest>>(mut self, v: V) -> Self {
1039 self.0.request = v.into();
1040 self
1041 }
1042
1043 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1045 self.0.options = v.into();
1046 self
1047 }
1048
1049 pub async fn send(self) -> Result<crate::model::ListCommentsResponse> {
1051 (*self.0.stub)
1052 .list_comments(self.0.request, self.0.options)
1053 .await
1054 .map(gax::response::Response::into_body)
1055 }
1056
1057 pub fn by_page(
1059 self,
1060 ) -> impl gax::paginator::Paginator<crate::model::ListCommentsResponse, gax::error::Error>
1061 {
1062 use std::clone::Clone;
1063 let token = self.0.request.page_token.clone();
1064 let execute = move |token: String| {
1065 let mut builder = self.clone();
1066 builder.0.request = builder.0.request.set_page_token(token);
1067 builder.send()
1068 };
1069 gax::paginator::internal::new_paginator(token, execute)
1070 }
1071
1072 pub fn by_item(
1074 self,
1075 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCommentsResponse, gax::error::Error>
1076 {
1077 use gax::paginator::Paginator;
1078 self.by_page().items()
1079 }
1080
1081 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1085 self.0.request.parent = v.into();
1086 self
1087 }
1088
1089 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1091 self.0.request.page_size = v.into();
1092 self
1093 }
1094
1095 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1097 self.0.request.page_token = v.into();
1098 self
1099 }
1100 }
1101
1102 #[doc(hidden)]
1103 impl gax::options::internal::RequestBuilder for ListComments {
1104 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1105 &mut self.0.options
1106 }
1107 }
1108
1109 #[derive(Clone, Debug)]
1127 pub struct CreateComment(RequestBuilder<crate::model::CreateCommentRequest>);
1128
1129 impl CreateComment {
1130 pub(crate) fn new(
1131 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
1132 ) -> Self {
1133 Self(RequestBuilder::new(stub))
1134 }
1135
1136 pub fn with_request<V: Into<crate::model::CreateCommentRequest>>(mut self, v: V) -> Self {
1138 self.0.request = v.into();
1139 self
1140 }
1141
1142 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1144 self.0.options = v.into();
1145 self
1146 }
1147
1148 pub async fn send(self) -> Result<crate::model::Comment> {
1150 (*self.0.stub)
1151 .create_comment(self.0.request, self.0.options)
1152 .await
1153 .map(gax::response::Response::into_body)
1154 }
1155
1156 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1160 self.0.request.parent = v.into();
1161 self
1162 }
1163
1164 pub fn set_comment<T>(mut self, v: T) -> Self
1168 where
1169 T: std::convert::Into<crate::model::Comment>,
1170 {
1171 self.0.request.comment = std::option::Option::Some(v.into());
1172 self
1173 }
1174
1175 pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
1179 where
1180 T: std::convert::Into<crate::model::Comment>,
1181 {
1182 self.0.request.comment = v.map(|x| x.into());
1183 self
1184 }
1185 }
1186
1187 #[doc(hidden)]
1188 impl gax::options::internal::RequestBuilder for CreateComment {
1189 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1190 &mut self.0.options
1191 }
1192 }
1193}