1use conjure_http::endpoint;
2#[conjure_http::conjure_endpoints(
4 name = "CommentsService",
5 use_legacy_error_serialization
6)]
7pub trait CommentsService {
8 #[endpoint(
11 method = GET,
12 path = "/comments/v1/conversations/{resourceType}/{resourceRid}",
13 name = "getConversation",
14 produces = conjure_http::server::StdResponseSerializer
15 )]
16 fn get_conversation(
17 &self,
18 #[auth]
19 auth_: conjure_object::BearerToken,
20 #[path(
21 name = "resourceType",
22 decoder = conjure_http::server::conjure::FromPlainDecoder,
23 log_as = "resourceType",
24 safe
25 )]
26 resource_type: super::super::super::super::objects::comments::api::ResourceType,
27 #[path(
28 name = "resourceRid",
29 decoder = conjure_http::server::conjure::FromPlainDecoder,
30 log_as = "resourceRid"
31 )]
32 resource_rid: conjure_object::ResourceIdentifier,
33 ) -> Result<
34 super::super::super::super::objects::comments::api::Conversation,
35 conjure_http::private::Error,
36 >;
37 #[endpoint(
39 method = GET,
40 path = "/comments/v1/conversations/{resourceType}/{resourceRid}/count",
41 name = "getConversationCount",
42 produces = conjure_http::server::StdResponseSerializer
43 )]
44 fn get_conversation_count(
45 &self,
46 #[auth]
47 auth_: conjure_object::BearerToken,
48 #[path(
49 name = "resourceType",
50 decoder = conjure_http::server::conjure::FromPlainDecoder,
51 log_as = "resourceType",
52 safe
53 )]
54 resource_type: super::super::super::super::objects::comments::api::ResourceType,
55 #[path(
56 name = "resourceRid",
57 decoder = conjure_http::server::conjure::FromPlainDecoder,
58 log_as = "resourceRid"
59 )]
60 resource_rid: conjure_object::ResourceIdentifier,
61 #[query(
62 name = "includeDeleted",
63 decoder = conjure_http::server::conjure::FromPlainOptionDecoder,
64 log_as = "includeDeleted"
65 )]
66 include_deleted: Option<bool>,
67 ) -> Result<i32, conjure_http::private::Error>;
68 #[endpoint(
70 method = GET,
71 path = "/comments/v1/comments/{commentRid}",
72 name = "getComment",
73 produces = conjure_http::server::StdResponseSerializer
74 )]
75 fn get_comment(
76 &self,
77 #[auth]
78 auth_: conjure_object::BearerToken,
79 #[path(
80 name = "commentRid",
81 decoder = conjure_http::server::conjure::FromPlainDecoder,
82 log_as = "commentRid",
83 safe
84 )]
85 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
86 ) -> Result<
87 super::super::super::super::objects::comments::api::Comment,
88 conjure_http::private::Error,
89 >;
90 #[endpoint(
92 method = POST,
93 path = "/comments/v1/comments",
94 name = "createComment",
95 produces = conjure_http::server::StdResponseSerializer
96 )]
97 fn create_comment(
98 &self,
99 #[auth]
100 auth_: conjure_object::BearerToken,
101 #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
102 request: super::super::super::super::objects::comments::api::CreateCommentRequest,
103 ) -> Result<
104 super::super::super::super::objects::comments::api::Comment,
105 conjure_http::private::Error,
106 >;
107 #[endpoint(
109 method = PUT,
110 path = "/comments/v1/comments/{commentRid}",
111 name = "editComment",
112 produces = conjure_http::server::StdResponseSerializer
113 )]
114 fn edit_comment(
115 &self,
116 #[auth]
117 auth_: conjure_object::BearerToken,
118 #[path(
119 name = "commentRid",
120 decoder = conjure_http::server::conjure::FromPlainDecoder,
121 log_as = "commentRid",
122 safe
123 )]
124 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
125 #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
126 request: super::super::super::super::objects::comments::api::EditCommentRequest,
127 ) -> Result<
128 super::super::super::super::objects::comments::api::Comment,
129 conjure_http::private::Error,
130 >;
131 #[endpoint(
133 method = DELETE,
134 path = "/comments/v1/comments/{commentRid}",
135 name = "deleteComment",
136 produces = conjure_http::server::StdResponseSerializer
137 )]
138 fn delete_comment(
139 &self,
140 #[auth]
141 auth_: conjure_object::BearerToken,
142 #[path(
143 name = "commentRid",
144 decoder = conjure_http::server::conjure::FromPlainDecoder,
145 log_as = "commentRid",
146 safe
147 )]
148 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
149 ) -> Result<
150 super::super::super::super::objects::comments::api::Comment,
151 conjure_http::private::Error,
152 >;
153 #[endpoint(
155 method = PUT,
156 path = "/comments/v1/comments/{commentRid}/pin",
157 name = "pinComment",
158 produces = conjure_http::server::StdResponseSerializer
159 )]
160 fn pin_comment(
161 &self,
162 #[auth]
163 auth_: conjure_object::BearerToken,
164 #[path(
165 name = "commentRid",
166 decoder = conjure_http::server::conjure::FromPlainDecoder,
167 log_as = "commentRid",
168 safe
169 )]
170 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
171 ) -> Result<
172 super::super::super::super::objects::comments::api::Comment,
173 conjure_http::private::Error,
174 >;
175 #[endpoint(
177 method = DELETE,
178 path = "/comments/v1/comments/{commentRid}/pin",
179 name = "unpinComment",
180 produces = conjure_http::server::StdResponseSerializer
181 )]
182 fn unpin_comment(
183 &self,
184 #[auth]
185 auth_: conjure_object::BearerToken,
186 #[path(
187 name = "commentRid",
188 decoder = conjure_http::server::conjure::FromPlainDecoder,
189 log_as = "commentRid",
190 safe
191 )]
192 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
193 ) -> Result<
194 super::super::super::super::objects::comments::api::Comment,
195 conjure_http::private::Error,
196 >;
197 #[endpoint(
199 method = PUT,
200 path = "/comments/v1/comments/{commentRid}/reactions/{type}",
201 name = "addReaction",
202 produces = conjure_http::server::StdResponseSerializer
203 )]
204 fn add_reaction(
205 &self,
206 #[auth]
207 auth_: conjure_object::BearerToken,
208 #[path(
209 name = "commentRid",
210 decoder = conjure_http::server::conjure::FromPlainDecoder,
211 log_as = "commentRid",
212 safe
213 )]
214 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
215 #[path(
216 name = "type",
217 decoder = conjure_http::server::conjure::FromPlainDecoder,
218 log_as = "type",
219 safe
220 )]
221 type_: super::super::super::super::objects::comments::api::ReactionType,
222 ) -> Result<
223 super::super::super::super::objects::comments::api::Comment,
224 conjure_http::private::Error,
225 >;
226 #[endpoint(
228 method = DELETE,
229 path = "/comments/v1/comments/{commentRid}/reactions/{type}",
230 name = "removeReaction",
231 produces = conjure_http::server::StdResponseSerializer
232 )]
233 fn remove_reaction(
234 &self,
235 #[auth]
236 auth_: conjure_object::BearerToken,
237 #[path(
238 name = "commentRid",
239 decoder = conjure_http::server::conjure::FromPlainDecoder,
240 log_as = "commentRid",
241 safe
242 )]
243 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
244 #[path(
245 name = "type",
246 decoder = conjure_http::server::conjure::FromPlainDecoder,
247 log_as = "type",
248 safe
249 )]
250 type_: super::super::super::super::objects::comments::api::ReactionType,
251 ) -> Result<
252 super::super::super::super::objects::comments::api::Comment,
253 conjure_http::private::Error,
254 >;
255}
256#[conjure_http::conjure_endpoints(
258 name = "CommentsService",
259 use_legacy_error_serialization
260)]
261pub trait AsyncCommentsService {
262 #[endpoint(
265 method = GET,
266 path = "/comments/v1/conversations/{resourceType}/{resourceRid}",
267 name = "getConversation",
268 produces = conjure_http::server::StdResponseSerializer
269 )]
270 async fn get_conversation(
271 &self,
272 #[auth]
273 auth_: conjure_object::BearerToken,
274 #[path(
275 name = "resourceType",
276 decoder = conjure_http::server::conjure::FromPlainDecoder,
277 log_as = "resourceType",
278 safe
279 )]
280 resource_type: super::super::super::super::objects::comments::api::ResourceType,
281 #[path(
282 name = "resourceRid",
283 decoder = conjure_http::server::conjure::FromPlainDecoder,
284 log_as = "resourceRid"
285 )]
286 resource_rid: conjure_object::ResourceIdentifier,
287 ) -> Result<
288 super::super::super::super::objects::comments::api::Conversation,
289 conjure_http::private::Error,
290 >;
291 #[endpoint(
293 method = GET,
294 path = "/comments/v1/conversations/{resourceType}/{resourceRid}/count",
295 name = "getConversationCount",
296 produces = conjure_http::server::StdResponseSerializer
297 )]
298 async fn get_conversation_count(
299 &self,
300 #[auth]
301 auth_: conjure_object::BearerToken,
302 #[path(
303 name = "resourceType",
304 decoder = conjure_http::server::conjure::FromPlainDecoder,
305 log_as = "resourceType",
306 safe
307 )]
308 resource_type: super::super::super::super::objects::comments::api::ResourceType,
309 #[path(
310 name = "resourceRid",
311 decoder = conjure_http::server::conjure::FromPlainDecoder,
312 log_as = "resourceRid"
313 )]
314 resource_rid: conjure_object::ResourceIdentifier,
315 #[query(
316 name = "includeDeleted",
317 decoder = conjure_http::server::conjure::FromPlainOptionDecoder,
318 log_as = "includeDeleted"
319 )]
320 include_deleted: Option<bool>,
321 ) -> Result<i32, conjure_http::private::Error>;
322 #[endpoint(
324 method = GET,
325 path = "/comments/v1/comments/{commentRid}",
326 name = "getComment",
327 produces = conjure_http::server::StdResponseSerializer
328 )]
329 async fn get_comment(
330 &self,
331 #[auth]
332 auth_: conjure_object::BearerToken,
333 #[path(
334 name = "commentRid",
335 decoder = conjure_http::server::conjure::FromPlainDecoder,
336 log_as = "commentRid",
337 safe
338 )]
339 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
340 ) -> Result<
341 super::super::super::super::objects::comments::api::Comment,
342 conjure_http::private::Error,
343 >;
344 #[endpoint(
346 method = POST,
347 path = "/comments/v1/comments",
348 name = "createComment",
349 produces = conjure_http::server::StdResponseSerializer
350 )]
351 async fn create_comment(
352 &self,
353 #[auth]
354 auth_: conjure_object::BearerToken,
355 #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
356 request: super::super::super::super::objects::comments::api::CreateCommentRequest,
357 ) -> Result<
358 super::super::super::super::objects::comments::api::Comment,
359 conjure_http::private::Error,
360 >;
361 #[endpoint(
363 method = PUT,
364 path = "/comments/v1/comments/{commentRid}",
365 name = "editComment",
366 produces = conjure_http::server::StdResponseSerializer
367 )]
368 async fn edit_comment(
369 &self,
370 #[auth]
371 auth_: conjure_object::BearerToken,
372 #[path(
373 name = "commentRid",
374 decoder = conjure_http::server::conjure::FromPlainDecoder,
375 log_as = "commentRid",
376 safe
377 )]
378 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
379 #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
380 request: super::super::super::super::objects::comments::api::EditCommentRequest,
381 ) -> Result<
382 super::super::super::super::objects::comments::api::Comment,
383 conjure_http::private::Error,
384 >;
385 #[endpoint(
387 method = DELETE,
388 path = "/comments/v1/comments/{commentRid}",
389 name = "deleteComment",
390 produces = conjure_http::server::StdResponseSerializer
391 )]
392 async fn delete_comment(
393 &self,
394 #[auth]
395 auth_: conjure_object::BearerToken,
396 #[path(
397 name = "commentRid",
398 decoder = conjure_http::server::conjure::FromPlainDecoder,
399 log_as = "commentRid",
400 safe
401 )]
402 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
403 ) -> Result<
404 super::super::super::super::objects::comments::api::Comment,
405 conjure_http::private::Error,
406 >;
407 #[endpoint(
409 method = PUT,
410 path = "/comments/v1/comments/{commentRid}/pin",
411 name = "pinComment",
412 produces = conjure_http::server::StdResponseSerializer
413 )]
414 async fn pin_comment(
415 &self,
416 #[auth]
417 auth_: conjure_object::BearerToken,
418 #[path(
419 name = "commentRid",
420 decoder = conjure_http::server::conjure::FromPlainDecoder,
421 log_as = "commentRid",
422 safe
423 )]
424 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
425 ) -> Result<
426 super::super::super::super::objects::comments::api::Comment,
427 conjure_http::private::Error,
428 >;
429 #[endpoint(
431 method = DELETE,
432 path = "/comments/v1/comments/{commentRid}/pin",
433 name = "unpinComment",
434 produces = conjure_http::server::StdResponseSerializer
435 )]
436 async fn unpin_comment(
437 &self,
438 #[auth]
439 auth_: conjure_object::BearerToken,
440 #[path(
441 name = "commentRid",
442 decoder = conjure_http::server::conjure::FromPlainDecoder,
443 log_as = "commentRid",
444 safe
445 )]
446 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
447 ) -> Result<
448 super::super::super::super::objects::comments::api::Comment,
449 conjure_http::private::Error,
450 >;
451 #[endpoint(
453 method = PUT,
454 path = "/comments/v1/comments/{commentRid}/reactions/{type}",
455 name = "addReaction",
456 produces = conjure_http::server::StdResponseSerializer
457 )]
458 async fn add_reaction(
459 &self,
460 #[auth]
461 auth_: conjure_object::BearerToken,
462 #[path(
463 name = "commentRid",
464 decoder = conjure_http::server::conjure::FromPlainDecoder,
465 log_as = "commentRid",
466 safe
467 )]
468 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
469 #[path(
470 name = "type",
471 decoder = conjure_http::server::conjure::FromPlainDecoder,
472 log_as = "type",
473 safe
474 )]
475 type_: super::super::super::super::objects::comments::api::ReactionType,
476 ) -> Result<
477 super::super::super::super::objects::comments::api::Comment,
478 conjure_http::private::Error,
479 >;
480 #[endpoint(
482 method = DELETE,
483 path = "/comments/v1/comments/{commentRid}/reactions/{type}",
484 name = "removeReaction",
485 produces = conjure_http::server::StdResponseSerializer
486 )]
487 async fn remove_reaction(
488 &self,
489 #[auth]
490 auth_: conjure_object::BearerToken,
491 #[path(
492 name = "commentRid",
493 decoder = conjure_http::server::conjure::FromPlainDecoder,
494 log_as = "commentRid",
495 safe
496 )]
497 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
498 #[path(
499 name = "type",
500 decoder = conjure_http::server::conjure::FromPlainDecoder,
501 log_as = "type",
502 safe
503 )]
504 type_: super::super::super::super::objects::comments::api::ReactionType,
505 ) -> Result<
506 super::super::super::super::objects::comments::api::Comment,
507 conjure_http::private::Error,
508 >;
509}
510#[conjure_http::conjure_endpoints(
512 name = "CommentsService",
513 use_legacy_error_serialization,
514 local
515)]
516pub trait LocalAsyncCommentsService {
517 #[endpoint(
520 method = GET,
521 path = "/comments/v1/conversations/{resourceType}/{resourceRid}",
522 name = "getConversation",
523 produces = conjure_http::server::StdResponseSerializer
524 )]
525 async fn get_conversation(
526 &self,
527 #[auth]
528 auth_: conjure_object::BearerToken,
529 #[path(
530 name = "resourceType",
531 decoder = conjure_http::server::conjure::FromPlainDecoder,
532 log_as = "resourceType",
533 safe
534 )]
535 resource_type: super::super::super::super::objects::comments::api::ResourceType,
536 #[path(
537 name = "resourceRid",
538 decoder = conjure_http::server::conjure::FromPlainDecoder,
539 log_as = "resourceRid"
540 )]
541 resource_rid: conjure_object::ResourceIdentifier,
542 ) -> Result<
543 super::super::super::super::objects::comments::api::Conversation,
544 conjure_http::private::Error,
545 >;
546 #[endpoint(
548 method = GET,
549 path = "/comments/v1/conversations/{resourceType}/{resourceRid}/count",
550 name = "getConversationCount",
551 produces = conjure_http::server::StdResponseSerializer
552 )]
553 async fn get_conversation_count(
554 &self,
555 #[auth]
556 auth_: conjure_object::BearerToken,
557 #[path(
558 name = "resourceType",
559 decoder = conjure_http::server::conjure::FromPlainDecoder,
560 log_as = "resourceType",
561 safe
562 )]
563 resource_type: super::super::super::super::objects::comments::api::ResourceType,
564 #[path(
565 name = "resourceRid",
566 decoder = conjure_http::server::conjure::FromPlainDecoder,
567 log_as = "resourceRid"
568 )]
569 resource_rid: conjure_object::ResourceIdentifier,
570 #[query(
571 name = "includeDeleted",
572 decoder = conjure_http::server::conjure::FromPlainOptionDecoder,
573 log_as = "includeDeleted"
574 )]
575 include_deleted: Option<bool>,
576 ) -> Result<i32, conjure_http::private::Error>;
577 #[endpoint(
579 method = GET,
580 path = "/comments/v1/comments/{commentRid}",
581 name = "getComment",
582 produces = conjure_http::server::StdResponseSerializer
583 )]
584 async fn get_comment(
585 &self,
586 #[auth]
587 auth_: conjure_object::BearerToken,
588 #[path(
589 name = "commentRid",
590 decoder = conjure_http::server::conjure::FromPlainDecoder,
591 log_as = "commentRid",
592 safe
593 )]
594 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
595 ) -> Result<
596 super::super::super::super::objects::comments::api::Comment,
597 conjure_http::private::Error,
598 >;
599 #[endpoint(
601 method = POST,
602 path = "/comments/v1/comments",
603 name = "createComment",
604 produces = conjure_http::server::StdResponseSerializer
605 )]
606 async fn create_comment(
607 &self,
608 #[auth]
609 auth_: conjure_object::BearerToken,
610 #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
611 request: super::super::super::super::objects::comments::api::CreateCommentRequest,
612 ) -> Result<
613 super::super::super::super::objects::comments::api::Comment,
614 conjure_http::private::Error,
615 >;
616 #[endpoint(
618 method = PUT,
619 path = "/comments/v1/comments/{commentRid}",
620 name = "editComment",
621 produces = conjure_http::server::StdResponseSerializer
622 )]
623 async fn edit_comment(
624 &self,
625 #[auth]
626 auth_: conjure_object::BearerToken,
627 #[path(
628 name = "commentRid",
629 decoder = conjure_http::server::conjure::FromPlainDecoder,
630 log_as = "commentRid",
631 safe
632 )]
633 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
634 #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
635 request: super::super::super::super::objects::comments::api::EditCommentRequest,
636 ) -> Result<
637 super::super::super::super::objects::comments::api::Comment,
638 conjure_http::private::Error,
639 >;
640 #[endpoint(
642 method = DELETE,
643 path = "/comments/v1/comments/{commentRid}",
644 name = "deleteComment",
645 produces = conjure_http::server::StdResponseSerializer
646 )]
647 async fn delete_comment(
648 &self,
649 #[auth]
650 auth_: conjure_object::BearerToken,
651 #[path(
652 name = "commentRid",
653 decoder = conjure_http::server::conjure::FromPlainDecoder,
654 log_as = "commentRid",
655 safe
656 )]
657 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
658 ) -> Result<
659 super::super::super::super::objects::comments::api::Comment,
660 conjure_http::private::Error,
661 >;
662 #[endpoint(
664 method = PUT,
665 path = "/comments/v1/comments/{commentRid}/pin",
666 name = "pinComment",
667 produces = conjure_http::server::StdResponseSerializer
668 )]
669 async fn pin_comment(
670 &self,
671 #[auth]
672 auth_: conjure_object::BearerToken,
673 #[path(
674 name = "commentRid",
675 decoder = conjure_http::server::conjure::FromPlainDecoder,
676 log_as = "commentRid",
677 safe
678 )]
679 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
680 ) -> Result<
681 super::super::super::super::objects::comments::api::Comment,
682 conjure_http::private::Error,
683 >;
684 #[endpoint(
686 method = DELETE,
687 path = "/comments/v1/comments/{commentRid}/pin",
688 name = "unpinComment",
689 produces = conjure_http::server::StdResponseSerializer
690 )]
691 async fn unpin_comment(
692 &self,
693 #[auth]
694 auth_: conjure_object::BearerToken,
695 #[path(
696 name = "commentRid",
697 decoder = conjure_http::server::conjure::FromPlainDecoder,
698 log_as = "commentRid",
699 safe
700 )]
701 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
702 ) -> Result<
703 super::super::super::super::objects::comments::api::Comment,
704 conjure_http::private::Error,
705 >;
706 #[endpoint(
708 method = PUT,
709 path = "/comments/v1/comments/{commentRid}/reactions/{type}",
710 name = "addReaction",
711 produces = conjure_http::server::StdResponseSerializer
712 )]
713 async fn add_reaction(
714 &self,
715 #[auth]
716 auth_: conjure_object::BearerToken,
717 #[path(
718 name = "commentRid",
719 decoder = conjure_http::server::conjure::FromPlainDecoder,
720 log_as = "commentRid",
721 safe
722 )]
723 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
724 #[path(
725 name = "type",
726 decoder = conjure_http::server::conjure::FromPlainDecoder,
727 log_as = "type",
728 safe
729 )]
730 type_: super::super::super::super::objects::comments::api::ReactionType,
731 ) -> Result<
732 super::super::super::super::objects::comments::api::Comment,
733 conjure_http::private::Error,
734 >;
735 #[endpoint(
737 method = DELETE,
738 path = "/comments/v1/comments/{commentRid}/reactions/{type}",
739 name = "removeReaction",
740 produces = conjure_http::server::StdResponseSerializer
741 )]
742 async fn remove_reaction(
743 &self,
744 #[auth]
745 auth_: conjure_object::BearerToken,
746 #[path(
747 name = "commentRid",
748 decoder = conjure_http::server::conjure::FromPlainDecoder,
749 log_as = "commentRid",
750 safe
751 )]
752 comment_rid: super::super::super::super::objects::comments::api::CommentRid,
753 #[path(
754 name = "type",
755 decoder = conjure_http::server::conjure::FromPlainDecoder,
756 log_as = "type",
757 safe
758 )]
759 type_: super::super::super::super::objects::comments::api::ReactionType,
760 ) -> Result<
761 super::super::super::super::objects::comments::api::Comment,
762 conjure_http::private::Error,
763 >;
764}