Skip to main content

nominal_api/conjure/clients/comments/api/
comments_service.rs

1use conjure_http::endpoint;
2/// Comments service manages conversations about resources.
3#[conjure_http::conjure_client(name = "CommentsService")]
4pub trait CommentsService<
5    #[response_body]
6    I: Iterator<
7            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
8        >,
9> {
10    /// A conversation is a fully resolved comment tree. It includes all comments for the given resource
11    /// and all the nested comments/replies to those comments.
12    #[endpoint(
13        method = GET,
14        path = "/comments/v1/conversations/{resourceType}/{resourceRid}",
15        name = "getConversation",
16        accept = conjure_http::client::StdResponseDeserializer
17    )]
18    fn get_conversation(
19        &self,
20        #[auth]
21        auth_: &conjure_object::BearerToken,
22        #[path(
23            name = "resourceType",
24            encoder = conjure_http::client::conjure::PlainEncoder
25        )]
26        resource_type: &super::super::super::super::objects::comments::api::ResourceType,
27        #[path(
28            name = "resourceRid",
29            encoder = conjure_http::client::conjure::PlainEncoder
30        )]
31        resource_rid: &conjure_object::ResourceIdentifier,
32    ) -> Result<
33        super::super::super::super::objects::comments::api::Conversation,
34        conjure_http::private::Error,
35    >;
36    /// Returns the number of comments in a conversation.
37    #[endpoint(
38        method = GET,
39        path = "/comments/v1/conversations/{resourceType}/{resourceRid}/count",
40        name = "getConversationCount",
41        accept = conjure_http::client::StdResponseDeserializer
42    )]
43    fn get_conversation_count(
44        &self,
45        #[auth]
46        auth_: &conjure_object::BearerToken,
47        #[path(
48            name = "resourceType",
49            encoder = conjure_http::client::conjure::PlainEncoder
50        )]
51        resource_type: &super::super::super::super::objects::comments::api::ResourceType,
52        #[path(
53            name = "resourceRid",
54            encoder = conjure_http::client::conjure::PlainEncoder
55        )]
56        resource_rid: &conjure_object::ResourceIdentifier,
57        #[query(
58            name = "includeDeleted",
59            encoder = conjure_http::client::conjure::PlainSeqEncoder
60        )]
61        include_deleted: Option<bool>,
62    ) -> Result<i32, conjure_http::private::Error>;
63    /// Get a comment identified by its RID
64    #[endpoint(
65        method = GET,
66        path = "/comments/v1/comments/{commentRid}",
67        name = "getComment",
68        accept = conjure_http::client::StdResponseDeserializer
69    )]
70    fn get_comment(
71        &self,
72        #[auth]
73        auth_: &conjure_object::BearerToken,
74        #[path(
75            name = "commentRid",
76            encoder = conjure_http::client::conjure::PlainEncoder
77        )]
78        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
79    ) -> Result<
80        super::super::super::super::objects::comments::api::Comment,
81        conjure_http::private::Error,
82    >;
83    /// Create a comment on a resource
84    #[endpoint(
85        method = POST,
86        path = "/comments/v1/comments",
87        name = "createComment",
88        accept = conjure_http::client::StdResponseDeserializer
89    )]
90    fn create_comment(
91        &self,
92        #[auth]
93        auth_: &conjure_object::BearerToken,
94        #[body(serializer = conjure_http::client::StdRequestSerializer)]
95        request: &super::super::super::super::objects::comments::api::CreateCommentRequest,
96    ) -> Result<
97        super::super::super::super::objects::comments::api::Comment,
98        conjure_http::private::Error,
99    >;
100    /// Edit an existing comment
101    #[endpoint(
102        method = PUT,
103        path = "/comments/v1/comments/{commentRid}",
104        name = "editComment",
105        accept = conjure_http::client::StdResponseDeserializer
106    )]
107    fn edit_comment(
108        &self,
109        #[auth]
110        auth_: &conjure_object::BearerToken,
111        #[path(
112            name = "commentRid",
113            encoder = conjure_http::client::conjure::PlainEncoder
114        )]
115        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
116        #[body(serializer = conjure_http::client::StdRequestSerializer)]
117        request: &super::super::super::super::objects::comments::api::EditCommentRequest,
118    ) -> Result<
119        super::super::super::super::objects::comments::api::Comment,
120        conjure_http::private::Error,
121    >;
122    /// Delete an existing comment
123    #[endpoint(
124        method = DELETE,
125        path = "/comments/v1/comments/{commentRid}",
126        name = "deleteComment",
127        accept = conjure_http::client::StdResponseDeserializer
128    )]
129    fn delete_comment(
130        &self,
131        #[auth]
132        auth_: &conjure_object::BearerToken,
133        #[path(
134            name = "commentRid",
135            encoder = conjure_http::client::conjure::PlainEncoder
136        )]
137        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
138    ) -> Result<
139        super::super::super::super::objects::comments::api::Comment,
140        conjure_http::private::Error,
141    >;
142    /// Pin a comment to the top of the conversation
143    #[endpoint(
144        method = PUT,
145        path = "/comments/v1/comments/{commentRid}/pin",
146        name = "pinComment",
147        accept = conjure_http::client::StdResponseDeserializer
148    )]
149    fn pin_comment(
150        &self,
151        #[auth]
152        auth_: &conjure_object::BearerToken,
153        #[path(
154            name = "commentRid",
155            encoder = conjure_http::client::conjure::PlainEncoder
156        )]
157        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
158    ) -> Result<
159        super::super::super::super::objects::comments::api::Comment,
160        conjure_http::private::Error,
161    >;
162    /// Unpin a comment from the top of the conversation
163    #[endpoint(
164        method = DELETE,
165        path = "/comments/v1/comments/{commentRid}/pin",
166        name = "unpinComment",
167        accept = conjure_http::client::StdResponseDeserializer
168    )]
169    fn unpin_comment(
170        &self,
171        #[auth]
172        auth_: &conjure_object::BearerToken,
173        #[path(
174            name = "commentRid",
175            encoder = conjure_http::client::conjure::PlainEncoder
176        )]
177        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
178    ) -> Result<
179        super::super::super::super::objects::comments::api::Comment,
180        conjure_http::private::Error,
181    >;
182    /// Create a reaction on a comment
183    #[endpoint(
184        method = PUT,
185        path = "/comments/v1/comments/{commentRid}/reactions/{type}",
186        name = "addReaction",
187        accept = conjure_http::client::StdResponseDeserializer
188    )]
189    fn add_reaction(
190        &self,
191        #[auth]
192        auth_: &conjure_object::BearerToken,
193        #[path(
194            name = "commentRid",
195            encoder = conjure_http::client::conjure::PlainEncoder
196        )]
197        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
198        #[path(name = "type", encoder = conjure_http::client::conjure::PlainEncoder)]
199        type_: &super::super::super::super::objects::comments::api::ReactionType,
200    ) -> Result<
201        super::super::super::super::objects::comments::api::Comment,
202        conjure_http::private::Error,
203    >;
204    /// Create a reaction on a comment
205    #[endpoint(
206        method = DELETE,
207        path = "/comments/v1/comments/{commentRid}/reactions/{type}",
208        name = "removeReaction",
209        accept = conjure_http::client::StdResponseDeserializer
210    )]
211    fn remove_reaction(
212        &self,
213        #[auth]
214        auth_: &conjure_object::BearerToken,
215        #[path(
216            name = "commentRid",
217            encoder = conjure_http::client::conjure::PlainEncoder
218        )]
219        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
220        #[path(name = "type", encoder = conjure_http::client::conjure::PlainEncoder)]
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}
227/// Comments service manages conversations about resources.
228#[conjure_http::conjure_client(name = "CommentsService")]
229pub trait AsyncCommentsService<
230    #[response_body]
231    I: conjure_http::private::Stream<
232            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
233        >,
234> {
235    /// A conversation is a fully resolved comment tree. It includes all comments for the given resource
236    /// and all the nested comments/replies to those comments.
237    #[endpoint(
238        method = GET,
239        path = "/comments/v1/conversations/{resourceType}/{resourceRid}",
240        name = "getConversation",
241        accept = conjure_http::client::StdResponseDeserializer
242    )]
243    async fn get_conversation(
244        &self,
245        #[auth]
246        auth_: &conjure_object::BearerToken,
247        #[path(
248            name = "resourceType",
249            encoder = conjure_http::client::conjure::PlainEncoder
250        )]
251        resource_type: &super::super::super::super::objects::comments::api::ResourceType,
252        #[path(
253            name = "resourceRid",
254            encoder = conjure_http::client::conjure::PlainEncoder
255        )]
256        resource_rid: &conjure_object::ResourceIdentifier,
257    ) -> Result<
258        super::super::super::super::objects::comments::api::Conversation,
259        conjure_http::private::Error,
260    >;
261    /// Returns the number of comments in a conversation.
262    #[endpoint(
263        method = GET,
264        path = "/comments/v1/conversations/{resourceType}/{resourceRid}/count",
265        name = "getConversationCount",
266        accept = conjure_http::client::StdResponseDeserializer
267    )]
268    async fn get_conversation_count(
269        &self,
270        #[auth]
271        auth_: &conjure_object::BearerToken,
272        #[path(
273            name = "resourceType",
274            encoder = conjure_http::client::conjure::PlainEncoder
275        )]
276        resource_type: &super::super::super::super::objects::comments::api::ResourceType,
277        #[path(
278            name = "resourceRid",
279            encoder = conjure_http::client::conjure::PlainEncoder
280        )]
281        resource_rid: &conjure_object::ResourceIdentifier,
282        #[query(
283            name = "includeDeleted",
284            encoder = conjure_http::client::conjure::PlainSeqEncoder
285        )]
286        include_deleted: Option<bool>,
287    ) -> Result<i32, conjure_http::private::Error>;
288    /// Get a comment identified by its RID
289    #[endpoint(
290        method = GET,
291        path = "/comments/v1/comments/{commentRid}",
292        name = "getComment",
293        accept = conjure_http::client::StdResponseDeserializer
294    )]
295    async fn get_comment(
296        &self,
297        #[auth]
298        auth_: &conjure_object::BearerToken,
299        #[path(
300            name = "commentRid",
301            encoder = conjure_http::client::conjure::PlainEncoder
302        )]
303        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
304    ) -> Result<
305        super::super::super::super::objects::comments::api::Comment,
306        conjure_http::private::Error,
307    >;
308    /// Create a comment on a resource
309    #[endpoint(
310        method = POST,
311        path = "/comments/v1/comments",
312        name = "createComment",
313        accept = conjure_http::client::StdResponseDeserializer
314    )]
315    async fn create_comment(
316        &self,
317        #[auth]
318        auth_: &conjure_object::BearerToken,
319        #[body(serializer = conjure_http::client::StdRequestSerializer)]
320        request: &super::super::super::super::objects::comments::api::CreateCommentRequest,
321    ) -> Result<
322        super::super::super::super::objects::comments::api::Comment,
323        conjure_http::private::Error,
324    >;
325    /// Edit an existing comment
326    #[endpoint(
327        method = PUT,
328        path = "/comments/v1/comments/{commentRid}",
329        name = "editComment",
330        accept = conjure_http::client::StdResponseDeserializer
331    )]
332    async fn edit_comment(
333        &self,
334        #[auth]
335        auth_: &conjure_object::BearerToken,
336        #[path(
337            name = "commentRid",
338            encoder = conjure_http::client::conjure::PlainEncoder
339        )]
340        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
341        #[body(serializer = conjure_http::client::StdRequestSerializer)]
342        request: &super::super::super::super::objects::comments::api::EditCommentRequest,
343    ) -> Result<
344        super::super::super::super::objects::comments::api::Comment,
345        conjure_http::private::Error,
346    >;
347    /// Delete an existing comment
348    #[endpoint(
349        method = DELETE,
350        path = "/comments/v1/comments/{commentRid}",
351        name = "deleteComment",
352        accept = conjure_http::client::StdResponseDeserializer
353    )]
354    async fn delete_comment(
355        &self,
356        #[auth]
357        auth_: &conjure_object::BearerToken,
358        #[path(
359            name = "commentRid",
360            encoder = conjure_http::client::conjure::PlainEncoder
361        )]
362        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
363    ) -> Result<
364        super::super::super::super::objects::comments::api::Comment,
365        conjure_http::private::Error,
366    >;
367    /// Pin a comment to the top of the conversation
368    #[endpoint(
369        method = PUT,
370        path = "/comments/v1/comments/{commentRid}/pin",
371        name = "pinComment",
372        accept = conjure_http::client::StdResponseDeserializer
373    )]
374    async fn pin_comment(
375        &self,
376        #[auth]
377        auth_: &conjure_object::BearerToken,
378        #[path(
379            name = "commentRid",
380            encoder = conjure_http::client::conjure::PlainEncoder
381        )]
382        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
383    ) -> Result<
384        super::super::super::super::objects::comments::api::Comment,
385        conjure_http::private::Error,
386    >;
387    /// Unpin a comment from the top of the conversation
388    #[endpoint(
389        method = DELETE,
390        path = "/comments/v1/comments/{commentRid}/pin",
391        name = "unpinComment",
392        accept = conjure_http::client::StdResponseDeserializer
393    )]
394    async fn unpin_comment(
395        &self,
396        #[auth]
397        auth_: &conjure_object::BearerToken,
398        #[path(
399            name = "commentRid",
400            encoder = conjure_http::client::conjure::PlainEncoder
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    /// Create a reaction on a comment
408    #[endpoint(
409        method = PUT,
410        path = "/comments/v1/comments/{commentRid}/reactions/{type}",
411        name = "addReaction",
412        accept = conjure_http::client::StdResponseDeserializer
413    )]
414    async fn add_reaction(
415        &self,
416        #[auth]
417        auth_: &conjure_object::BearerToken,
418        #[path(
419            name = "commentRid",
420            encoder = conjure_http::client::conjure::PlainEncoder
421        )]
422        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
423        #[path(name = "type", encoder = conjure_http::client::conjure::PlainEncoder)]
424        type_: &super::super::super::super::objects::comments::api::ReactionType,
425    ) -> Result<
426        super::super::super::super::objects::comments::api::Comment,
427        conjure_http::private::Error,
428    >;
429    /// Create a reaction on a comment
430    #[endpoint(
431        method = DELETE,
432        path = "/comments/v1/comments/{commentRid}/reactions/{type}",
433        name = "removeReaction",
434        accept = conjure_http::client::StdResponseDeserializer
435    )]
436    async fn remove_reaction(
437        &self,
438        #[auth]
439        auth_: &conjure_object::BearerToken,
440        #[path(
441            name = "commentRid",
442            encoder = conjure_http::client::conjure::PlainEncoder
443        )]
444        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
445        #[path(name = "type", encoder = conjure_http::client::conjure::PlainEncoder)]
446        type_: &super::super::super::super::objects::comments::api::ReactionType,
447    ) -> Result<
448        super::super::super::super::objects::comments::api::Comment,
449        conjure_http::private::Error,
450    >;
451}
452/// Comments service manages conversations about resources.
453#[conjure_http::conjure_client(name = "CommentsService", local)]
454pub trait LocalAsyncCommentsService<
455    #[response_body]
456    I: conjure_http::private::Stream<
457            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
458        >,
459> {
460    /// A conversation is a fully resolved comment tree. It includes all comments for the given resource
461    /// and all the nested comments/replies to those comments.
462    #[endpoint(
463        method = GET,
464        path = "/comments/v1/conversations/{resourceType}/{resourceRid}",
465        name = "getConversation",
466        accept = conjure_http::client::StdResponseDeserializer
467    )]
468    async fn get_conversation(
469        &self,
470        #[auth]
471        auth_: &conjure_object::BearerToken,
472        #[path(
473            name = "resourceType",
474            encoder = conjure_http::client::conjure::PlainEncoder
475        )]
476        resource_type: &super::super::super::super::objects::comments::api::ResourceType,
477        #[path(
478            name = "resourceRid",
479            encoder = conjure_http::client::conjure::PlainEncoder
480        )]
481        resource_rid: &conjure_object::ResourceIdentifier,
482    ) -> Result<
483        super::super::super::super::objects::comments::api::Conversation,
484        conjure_http::private::Error,
485    >;
486    /// Returns the number of comments in a conversation.
487    #[endpoint(
488        method = GET,
489        path = "/comments/v1/conversations/{resourceType}/{resourceRid}/count",
490        name = "getConversationCount",
491        accept = conjure_http::client::StdResponseDeserializer
492    )]
493    async fn get_conversation_count(
494        &self,
495        #[auth]
496        auth_: &conjure_object::BearerToken,
497        #[path(
498            name = "resourceType",
499            encoder = conjure_http::client::conjure::PlainEncoder
500        )]
501        resource_type: &super::super::super::super::objects::comments::api::ResourceType,
502        #[path(
503            name = "resourceRid",
504            encoder = conjure_http::client::conjure::PlainEncoder
505        )]
506        resource_rid: &conjure_object::ResourceIdentifier,
507        #[query(
508            name = "includeDeleted",
509            encoder = conjure_http::client::conjure::PlainSeqEncoder
510        )]
511        include_deleted: Option<bool>,
512    ) -> Result<i32, conjure_http::private::Error>;
513    /// Get a comment identified by its RID
514    #[endpoint(
515        method = GET,
516        path = "/comments/v1/comments/{commentRid}",
517        name = "getComment",
518        accept = conjure_http::client::StdResponseDeserializer
519    )]
520    async fn get_comment(
521        &self,
522        #[auth]
523        auth_: &conjure_object::BearerToken,
524        #[path(
525            name = "commentRid",
526            encoder = conjure_http::client::conjure::PlainEncoder
527        )]
528        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
529    ) -> Result<
530        super::super::super::super::objects::comments::api::Comment,
531        conjure_http::private::Error,
532    >;
533    /// Create a comment on a resource
534    #[endpoint(
535        method = POST,
536        path = "/comments/v1/comments",
537        name = "createComment",
538        accept = conjure_http::client::StdResponseDeserializer
539    )]
540    async fn create_comment(
541        &self,
542        #[auth]
543        auth_: &conjure_object::BearerToken,
544        #[body(serializer = conjure_http::client::StdRequestSerializer)]
545        request: &super::super::super::super::objects::comments::api::CreateCommentRequest,
546    ) -> Result<
547        super::super::super::super::objects::comments::api::Comment,
548        conjure_http::private::Error,
549    >;
550    /// Edit an existing comment
551    #[endpoint(
552        method = PUT,
553        path = "/comments/v1/comments/{commentRid}",
554        name = "editComment",
555        accept = conjure_http::client::StdResponseDeserializer
556    )]
557    async fn edit_comment(
558        &self,
559        #[auth]
560        auth_: &conjure_object::BearerToken,
561        #[path(
562            name = "commentRid",
563            encoder = conjure_http::client::conjure::PlainEncoder
564        )]
565        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
566        #[body(serializer = conjure_http::client::StdRequestSerializer)]
567        request: &super::super::super::super::objects::comments::api::EditCommentRequest,
568    ) -> Result<
569        super::super::super::super::objects::comments::api::Comment,
570        conjure_http::private::Error,
571    >;
572    /// Delete an existing comment
573    #[endpoint(
574        method = DELETE,
575        path = "/comments/v1/comments/{commentRid}",
576        name = "deleteComment",
577        accept = conjure_http::client::StdResponseDeserializer
578    )]
579    async fn delete_comment(
580        &self,
581        #[auth]
582        auth_: &conjure_object::BearerToken,
583        #[path(
584            name = "commentRid",
585            encoder = conjure_http::client::conjure::PlainEncoder
586        )]
587        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
588    ) -> Result<
589        super::super::super::super::objects::comments::api::Comment,
590        conjure_http::private::Error,
591    >;
592    /// Pin a comment to the top of the conversation
593    #[endpoint(
594        method = PUT,
595        path = "/comments/v1/comments/{commentRid}/pin",
596        name = "pinComment",
597        accept = conjure_http::client::StdResponseDeserializer
598    )]
599    async fn pin_comment(
600        &self,
601        #[auth]
602        auth_: &conjure_object::BearerToken,
603        #[path(
604            name = "commentRid",
605            encoder = conjure_http::client::conjure::PlainEncoder
606        )]
607        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
608    ) -> Result<
609        super::super::super::super::objects::comments::api::Comment,
610        conjure_http::private::Error,
611    >;
612    /// Unpin a comment from the top of the conversation
613    #[endpoint(
614        method = DELETE,
615        path = "/comments/v1/comments/{commentRid}/pin",
616        name = "unpinComment",
617        accept = conjure_http::client::StdResponseDeserializer
618    )]
619    async fn unpin_comment(
620        &self,
621        #[auth]
622        auth_: &conjure_object::BearerToken,
623        #[path(
624            name = "commentRid",
625            encoder = conjure_http::client::conjure::PlainEncoder
626        )]
627        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
628    ) -> Result<
629        super::super::super::super::objects::comments::api::Comment,
630        conjure_http::private::Error,
631    >;
632    /// Create a reaction on a comment
633    #[endpoint(
634        method = PUT,
635        path = "/comments/v1/comments/{commentRid}/reactions/{type}",
636        name = "addReaction",
637        accept = conjure_http::client::StdResponseDeserializer
638    )]
639    async fn add_reaction(
640        &self,
641        #[auth]
642        auth_: &conjure_object::BearerToken,
643        #[path(
644            name = "commentRid",
645            encoder = conjure_http::client::conjure::PlainEncoder
646        )]
647        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
648        #[path(name = "type", encoder = conjure_http::client::conjure::PlainEncoder)]
649        type_: &super::super::super::super::objects::comments::api::ReactionType,
650    ) -> Result<
651        super::super::super::super::objects::comments::api::Comment,
652        conjure_http::private::Error,
653    >;
654    /// Create a reaction on a comment
655    #[endpoint(
656        method = DELETE,
657        path = "/comments/v1/comments/{commentRid}/reactions/{type}",
658        name = "removeReaction",
659        accept = conjure_http::client::StdResponseDeserializer
660    )]
661    async fn remove_reaction(
662        &self,
663        #[auth]
664        auth_: &conjure_object::BearerToken,
665        #[path(
666            name = "commentRid",
667            encoder = conjure_http::client::conjure::PlainEncoder
668        )]
669        comment_rid: &super::super::super::super::objects::comments::api::CommentRid,
670        #[path(name = "type", encoder = conjure_http::client::conjure::PlainEncoder)]
671        type_: &super::super::super::super::objects::comments::api::ReactionType,
672    ) -> Result<
673        super::super::super::super::objects::comments::api::Comment,
674        conjure_http::private::Error,
675    >;
676}