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)]
95 pub struct ListAttachments(RequestBuilder<crate::model::ListAttachmentsRequest>);
96
97 impl ListAttachments {
98 pub(crate) fn new(
99 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseAttachmentService>,
100 ) -> Self {
101 Self(RequestBuilder::new(stub))
102 }
103
104 pub fn with_request<V: Into<crate::model::ListAttachmentsRequest>>(mut self, v: V) -> Self {
106 self.0.request = v.into();
107 self
108 }
109
110 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
112 self.0.options = v.into();
113 self
114 }
115
116 pub async fn send(self) -> Result<crate::model::ListAttachmentsResponse> {
118 (*self.0.stub)
119 .list_attachments(self.0.request, self.0.options)
120 .await
121 .map(gax::response::Response::into_body)
122 }
123
124 pub fn by_page(
126 self,
127 ) -> impl gax::paginator::Paginator<crate::model::ListAttachmentsResponse, gax::error::Error>
128 {
129 use std::clone::Clone;
130 let token = self.0.request.page_token.clone();
131 let execute = move |token: String| {
132 let mut builder = self.clone();
133 builder.0.request = builder.0.request.set_page_token(token);
134 builder.send()
135 };
136 gax::paginator::internal::new_paginator(token, execute)
137 }
138
139 pub fn by_item(
141 self,
142 ) -> impl gax::paginator::ItemPaginator<crate::model::ListAttachmentsResponse, gax::error::Error>
143 {
144 use gax::paginator::Paginator;
145 self.by_page().items()
146 }
147
148 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
152 self.0.request.parent = v.into();
153 self
154 }
155
156 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
158 self.0.request.page_size = v.into();
159 self
160 }
161
162 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
164 self.0.request.page_token = v.into();
165 self
166 }
167 }
168
169 #[doc(hidden)]
170 impl gax::options::internal::RequestBuilder for ListAttachments {
171 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
172 &mut self.0.options
173 }
174 }
175}
176
177pub mod case_service {
178 use crate::Result;
179
180 pub type ClientBuilder =
194 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
195
196 pub(crate) mod client {
197 use super::super::super::client::CaseService;
198 pub struct Factory;
199 impl gax::client_builder::internal::ClientFactory for Factory {
200 type Client = CaseService;
201 type Credentials = gaxi::options::Credentials;
202 async fn build(
203 self,
204 config: gaxi::options::ClientConfig,
205 ) -> gax::client_builder::Result<Self::Client> {
206 Self::Client::new(config).await
207 }
208 }
209 }
210
211 #[derive(Clone, Debug)]
213 pub(crate) struct RequestBuilder<R: std::default::Default> {
214 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
215 request: R,
216 options: gax::options::RequestOptions,
217 }
218
219 impl<R> RequestBuilder<R>
220 where
221 R: std::default::Default,
222 {
223 pub(crate) fn new(
224 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
225 ) -> Self {
226 Self {
227 stub,
228 request: R::default(),
229 options: gax::options::RequestOptions::default(),
230 }
231 }
232 }
233
234 #[derive(Clone, Debug)]
251 pub struct GetCase(RequestBuilder<crate::model::GetCaseRequest>);
252
253 impl GetCase {
254 pub(crate) fn new(
255 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
256 ) -> Self {
257 Self(RequestBuilder::new(stub))
258 }
259
260 pub fn with_request<V: Into<crate::model::GetCaseRequest>>(mut self, v: V) -> Self {
262 self.0.request = v.into();
263 self
264 }
265
266 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
268 self.0.options = v.into();
269 self
270 }
271
272 pub async fn send(self) -> Result<crate::model::Case> {
274 (*self.0.stub)
275 .get_case(self.0.request, self.0.options)
276 .await
277 .map(gax::response::Response::into_body)
278 }
279
280 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
284 self.0.request.name = v.into();
285 self
286 }
287 }
288
289 #[doc(hidden)]
290 impl gax::options::internal::RequestBuilder for GetCase {
291 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
292 &mut self.0.options
293 }
294 }
295
296 #[derive(Clone, Debug)]
317 pub struct ListCases(RequestBuilder<crate::model::ListCasesRequest>);
318
319 impl ListCases {
320 pub(crate) fn new(
321 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
322 ) -> Self {
323 Self(RequestBuilder::new(stub))
324 }
325
326 pub fn with_request<V: Into<crate::model::ListCasesRequest>>(mut self, v: V) -> Self {
328 self.0.request = v.into();
329 self
330 }
331
332 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
334 self.0.options = v.into();
335 self
336 }
337
338 pub async fn send(self) -> Result<crate::model::ListCasesResponse> {
340 (*self.0.stub)
341 .list_cases(self.0.request, self.0.options)
342 .await
343 .map(gax::response::Response::into_body)
344 }
345
346 pub fn by_page(
348 self,
349 ) -> impl gax::paginator::Paginator<crate::model::ListCasesResponse, gax::error::Error>
350 {
351 use std::clone::Clone;
352 let token = self.0.request.page_token.clone();
353 let execute = move |token: String| {
354 let mut builder = self.clone();
355 builder.0.request = builder.0.request.set_page_token(token);
356 builder.send()
357 };
358 gax::paginator::internal::new_paginator(token, execute)
359 }
360
361 pub fn by_item(
363 self,
364 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCasesResponse, gax::error::Error>
365 {
366 use gax::paginator::Paginator;
367 self.by_page().items()
368 }
369
370 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
374 self.0.request.parent = v.into();
375 self
376 }
377
378 pub fn set_filter<T: Into<std::string::String>>(mut self, v: T) -> Self {
380 self.0.request.filter = v.into();
381 self
382 }
383
384 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
386 self.0.request.page_size = v.into();
387 self
388 }
389
390 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
392 self.0.request.page_token = v.into();
393 self
394 }
395 }
396
397 #[doc(hidden)]
398 impl gax::options::internal::RequestBuilder for ListCases {
399 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
400 &mut self.0.options
401 }
402 }
403
404 #[derive(Clone, Debug)]
425 pub struct SearchCases(RequestBuilder<crate::model::SearchCasesRequest>);
426
427 impl SearchCases {
428 pub(crate) fn new(
429 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
430 ) -> Self {
431 Self(RequestBuilder::new(stub))
432 }
433
434 pub fn with_request<V: Into<crate::model::SearchCasesRequest>>(mut self, v: V) -> Self {
436 self.0.request = v.into();
437 self
438 }
439
440 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
442 self.0.options = v.into();
443 self
444 }
445
446 pub async fn send(self) -> Result<crate::model::SearchCasesResponse> {
448 (*self.0.stub)
449 .search_cases(self.0.request, self.0.options)
450 .await
451 .map(gax::response::Response::into_body)
452 }
453
454 pub fn by_page(
456 self,
457 ) -> impl gax::paginator::Paginator<crate::model::SearchCasesResponse, gax::error::Error>
458 {
459 use std::clone::Clone;
460 let token = self.0.request.page_token.clone();
461 let execute = move |token: String| {
462 let mut builder = self.clone();
463 builder.0.request = builder.0.request.set_page_token(token);
464 builder.send()
465 };
466 gax::paginator::internal::new_paginator(token, execute)
467 }
468
469 pub fn by_item(
471 self,
472 ) -> impl gax::paginator::ItemPaginator<crate::model::SearchCasesResponse, gax::error::Error>
473 {
474 use gax::paginator::Paginator;
475 self.by_page().items()
476 }
477
478 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
480 self.0.request.parent = v.into();
481 self
482 }
483
484 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
486 self.0.request.query = v.into();
487 self
488 }
489
490 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
492 self.0.request.page_size = v.into();
493 self
494 }
495
496 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
498 self.0.request.page_token = v.into();
499 self
500 }
501 }
502
503 #[doc(hidden)]
504 impl gax::options::internal::RequestBuilder for SearchCases {
505 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
506 &mut self.0.options
507 }
508 }
509
510 #[derive(Clone, Debug)]
527 pub struct CreateCase(RequestBuilder<crate::model::CreateCaseRequest>);
528
529 impl CreateCase {
530 pub(crate) fn new(
531 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
532 ) -> Self {
533 Self(RequestBuilder::new(stub))
534 }
535
536 pub fn with_request<V: Into<crate::model::CreateCaseRequest>>(mut self, v: V) -> Self {
538 self.0.request = v.into();
539 self
540 }
541
542 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
544 self.0.options = v.into();
545 self
546 }
547
548 pub async fn send(self) -> Result<crate::model::Case> {
550 (*self.0.stub)
551 .create_case(self.0.request, self.0.options)
552 .await
553 .map(gax::response::Response::into_body)
554 }
555
556 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
560 self.0.request.parent = v.into();
561 self
562 }
563
564 pub fn set_case<T>(mut self, v: T) -> Self
568 where
569 T: std::convert::Into<crate::model::Case>,
570 {
571 self.0.request.case = std::option::Option::Some(v.into());
572 self
573 }
574
575 pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
579 where
580 T: std::convert::Into<crate::model::Case>,
581 {
582 self.0.request.case = v.map(|x| x.into());
583 self
584 }
585 }
586
587 #[doc(hidden)]
588 impl gax::options::internal::RequestBuilder for CreateCase {
589 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
590 &mut self.0.options
591 }
592 }
593
594 #[derive(Clone, Debug)]
611 pub struct UpdateCase(RequestBuilder<crate::model::UpdateCaseRequest>);
612
613 impl UpdateCase {
614 pub(crate) fn new(
615 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
616 ) -> Self {
617 Self(RequestBuilder::new(stub))
618 }
619
620 pub fn with_request<V: Into<crate::model::UpdateCaseRequest>>(mut self, v: V) -> Self {
622 self.0.request = v.into();
623 self
624 }
625
626 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
628 self.0.options = v.into();
629 self
630 }
631
632 pub async fn send(self) -> Result<crate::model::Case> {
634 (*self.0.stub)
635 .update_case(self.0.request, self.0.options)
636 .await
637 .map(gax::response::Response::into_body)
638 }
639
640 pub fn set_case<T>(mut self, v: T) -> Self
644 where
645 T: std::convert::Into<crate::model::Case>,
646 {
647 self.0.request.case = std::option::Option::Some(v.into());
648 self
649 }
650
651 pub fn set_or_clear_case<T>(mut self, v: std::option::Option<T>) -> Self
655 where
656 T: std::convert::Into<crate::model::Case>,
657 {
658 self.0.request.case = v.map(|x| x.into());
659 self
660 }
661
662 pub fn set_update_mask<T>(mut self, v: T) -> Self
664 where
665 T: std::convert::Into<wkt::FieldMask>,
666 {
667 self.0.request.update_mask = std::option::Option::Some(v.into());
668 self
669 }
670
671 pub fn set_or_clear_update_mask<T>(mut self, v: std::option::Option<T>) -> Self
673 where
674 T: std::convert::Into<wkt::FieldMask>,
675 {
676 self.0.request.update_mask = v.map(|x| x.into());
677 self
678 }
679 }
680
681 #[doc(hidden)]
682 impl gax::options::internal::RequestBuilder for UpdateCase {
683 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
684 &mut self.0.options
685 }
686 }
687
688 #[derive(Clone, Debug)]
705 pub struct EscalateCase(RequestBuilder<crate::model::EscalateCaseRequest>);
706
707 impl EscalateCase {
708 pub(crate) fn new(
709 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
710 ) -> Self {
711 Self(RequestBuilder::new(stub))
712 }
713
714 pub fn with_request<V: Into<crate::model::EscalateCaseRequest>>(mut self, v: V) -> Self {
716 self.0.request = v.into();
717 self
718 }
719
720 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
722 self.0.options = v.into();
723 self
724 }
725
726 pub async fn send(self) -> Result<crate::model::Case> {
728 (*self.0.stub)
729 .escalate_case(self.0.request, self.0.options)
730 .await
731 .map(gax::response::Response::into_body)
732 }
733
734 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
738 self.0.request.name = v.into();
739 self
740 }
741
742 pub fn set_escalation<T>(mut self, v: T) -> Self
744 where
745 T: std::convert::Into<crate::model::Escalation>,
746 {
747 self.0.request.escalation = std::option::Option::Some(v.into());
748 self
749 }
750
751 pub fn set_or_clear_escalation<T>(mut self, v: std::option::Option<T>) -> Self
753 where
754 T: std::convert::Into<crate::model::Escalation>,
755 {
756 self.0.request.escalation = v.map(|x| x.into());
757 self
758 }
759 }
760
761 #[doc(hidden)]
762 impl gax::options::internal::RequestBuilder for EscalateCase {
763 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
764 &mut self.0.options
765 }
766 }
767
768 #[derive(Clone, Debug)]
785 pub struct CloseCase(RequestBuilder<crate::model::CloseCaseRequest>);
786
787 impl CloseCase {
788 pub(crate) fn new(
789 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
790 ) -> Self {
791 Self(RequestBuilder::new(stub))
792 }
793
794 pub fn with_request<V: Into<crate::model::CloseCaseRequest>>(mut self, v: V) -> Self {
796 self.0.request = v.into();
797 self
798 }
799
800 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
802 self.0.options = v.into();
803 self
804 }
805
806 pub async fn send(self) -> Result<crate::model::Case> {
808 (*self.0.stub)
809 .close_case(self.0.request, self.0.options)
810 .await
811 .map(gax::response::Response::into_body)
812 }
813
814 pub fn set_name<T: Into<std::string::String>>(mut self, v: T) -> Self {
818 self.0.request.name = v.into();
819 self
820 }
821 }
822
823 #[doc(hidden)]
824 impl gax::options::internal::RequestBuilder for CloseCase {
825 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
826 &mut self.0.options
827 }
828 }
829
830 #[derive(Clone, Debug)]
851 pub struct SearchCaseClassifications(
852 RequestBuilder<crate::model::SearchCaseClassificationsRequest>,
853 );
854
855 impl SearchCaseClassifications {
856 pub(crate) fn new(
857 stub: std::sync::Arc<dyn super::super::stub::dynamic::CaseService>,
858 ) -> Self {
859 Self(RequestBuilder::new(stub))
860 }
861
862 pub fn with_request<V: Into<crate::model::SearchCaseClassificationsRequest>>(
864 mut self,
865 v: V,
866 ) -> Self {
867 self.0.request = v.into();
868 self
869 }
870
871 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
873 self.0.options = v.into();
874 self
875 }
876
877 pub async fn send(self) -> Result<crate::model::SearchCaseClassificationsResponse> {
879 (*self.0.stub)
880 .search_case_classifications(self.0.request, self.0.options)
881 .await
882 .map(gax::response::Response::into_body)
883 }
884
885 pub fn by_page(
887 self,
888 ) -> impl gax::paginator::Paginator<
889 crate::model::SearchCaseClassificationsResponse,
890 gax::error::Error,
891 > {
892 use std::clone::Clone;
893 let token = self.0.request.page_token.clone();
894 let execute = move |token: String| {
895 let mut builder = self.clone();
896 builder.0.request = builder.0.request.set_page_token(token);
897 builder.send()
898 };
899 gax::paginator::internal::new_paginator(token, execute)
900 }
901
902 pub fn by_item(
904 self,
905 ) -> impl gax::paginator::ItemPaginator<
906 crate::model::SearchCaseClassificationsResponse,
907 gax::error::Error,
908 > {
909 use gax::paginator::Paginator;
910 self.by_page().items()
911 }
912
913 pub fn set_query<T: Into<std::string::String>>(mut self, v: T) -> Self {
915 self.0.request.query = v.into();
916 self
917 }
918
919 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
921 self.0.request.page_size = v.into();
922 self
923 }
924
925 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
927 self.0.request.page_token = v.into();
928 self
929 }
930 }
931
932 #[doc(hidden)]
933 impl gax::options::internal::RequestBuilder for SearchCaseClassifications {
934 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
935 &mut self.0.options
936 }
937 }
938}
939
940pub mod comment_service {
941 use crate::Result;
942
943 pub type ClientBuilder =
957 gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;
958
959 pub(crate) mod client {
960 use super::super::super::client::CommentService;
961 pub struct Factory;
962 impl gax::client_builder::internal::ClientFactory for Factory {
963 type Client = CommentService;
964 type Credentials = gaxi::options::Credentials;
965 async fn build(
966 self,
967 config: gaxi::options::ClientConfig,
968 ) -> gax::client_builder::Result<Self::Client> {
969 Self::Client::new(config).await
970 }
971 }
972 }
973
974 #[derive(Clone, Debug)]
976 pub(crate) struct RequestBuilder<R: std::default::Default> {
977 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
978 request: R,
979 options: gax::options::RequestOptions,
980 }
981
982 impl<R> RequestBuilder<R>
983 where
984 R: std::default::Default,
985 {
986 pub(crate) fn new(
987 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
988 ) -> Self {
989 Self {
990 stub,
991 request: R::default(),
992 options: gax::options::RequestOptions::default(),
993 }
994 }
995 }
996
997 #[derive(Clone, Debug)]
1018 pub struct ListComments(RequestBuilder<crate::model::ListCommentsRequest>);
1019
1020 impl ListComments {
1021 pub(crate) fn new(
1022 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
1023 ) -> Self {
1024 Self(RequestBuilder::new(stub))
1025 }
1026
1027 pub fn with_request<V: Into<crate::model::ListCommentsRequest>>(mut self, v: V) -> Self {
1029 self.0.request = v.into();
1030 self
1031 }
1032
1033 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1035 self.0.options = v.into();
1036 self
1037 }
1038
1039 pub async fn send(self) -> Result<crate::model::ListCommentsResponse> {
1041 (*self.0.stub)
1042 .list_comments(self.0.request, self.0.options)
1043 .await
1044 .map(gax::response::Response::into_body)
1045 }
1046
1047 pub fn by_page(
1049 self,
1050 ) -> impl gax::paginator::Paginator<crate::model::ListCommentsResponse, gax::error::Error>
1051 {
1052 use std::clone::Clone;
1053 let token = self.0.request.page_token.clone();
1054 let execute = move |token: String| {
1055 let mut builder = self.clone();
1056 builder.0.request = builder.0.request.set_page_token(token);
1057 builder.send()
1058 };
1059 gax::paginator::internal::new_paginator(token, execute)
1060 }
1061
1062 pub fn by_item(
1064 self,
1065 ) -> impl gax::paginator::ItemPaginator<crate::model::ListCommentsResponse, gax::error::Error>
1066 {
1067 use gax::paginator::Paginator;
1068 self.by_page().items()
1069 }
1070
1071 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1075 self.0.request.parent = v.into();
1076 self
1077 }
1078
1079 pub fn set_page_size<T: Into<i32>>(mut self, v: T) -> Self {
1081 self.0.request.page_size = v.into();
1082 self
1083 }
1084
1085 pub fn set_page_token<T: Into<std::string::String>>(mut self, v: T) -> Self {
1087 self.0.request.page_token = v.into();
1088 self
1089 }
1090 }
1091
1092 #[doc(hidden)]
1093 impl gax::options::internal::RequestBuilder for ListComments {
1094 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1095 &mut self.0.options
1096 }
1097 }
1098
1099 #[derive(Clone, Debug)]
1116 pub struct CreateComment(RequestBuilder<crate::model::CreateCommentRequest>);
1117
1118 impl CreateComment {
1119 pub(crate) fn new(
1120 stub: std::sync::Arc<dyn super::super::stub::dynamic::CommentService>,
1121 ) -> Self {
1122 Self(RequestBuilder::new(stub))
1123 }
1124
1125 pub fn with_request<V: Into<crate::model::CreateCommentRequest>>(mut self, v: V) -> Self {
1127 self.0.request = v.into();
1128 self
1129 }
1130
1131 pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
1133 self.0.options = v.into();
1134 self
1135 }
1136
1137 pub async fn send(self) -> Result<crate::model::Comment> {
1139 (*self.0.stub)
1140 .create_comment(self.0.request, self.0.options)
1141 .await
1142 .map(gax::response::Response::into_body)
1143 }
1144
1145 pub fn set_parent<T: Into<std::string::String>>(mut self, v: T) -> Self {
1149 self.0.request.parent = v.into();
1150 self
1151 }
1152
1153 pub fn set_comment<T>(mut self, v: T) -> Self
1157 where
1158 T: std::convert::Into<crate::model::Comment>,
1159 {
1160 self.0.request.comment = std::option::Option::Some(v.into());
1161 self
1162 }
1163
1164 pub fn set_or_clear_comment<T>(mut self, v: std::option::Option<T>) -> Self
1168 where
1169 T: std::convert::Into<crate::model::Comment>,
1170 {
1171 self.0.request.comment = v.map(|x| x.into());
1172 self
1173 }
1174 }
1175
1176 #[doc(hidden)]
1177 impl gax::options::internal::RequestBuilder for CreateComment {
1178 fn request_options(&mut self) -> &mut gax::options::RequestOptions {
1179 &mut self.0.options
1180 }
1181 }
1182}