Skip to main content

args_api/endpoint/bug/
create_bug_comment.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{endpoint::Endpoint, resource::bug::BugCommentResource};
4
5pub struct CreateBugComment;
6
7impl Endpoint for CreateBugComment {
8    const PATH: &'static str = "/repository/{owner}/{repo}/bugs/{number}/comment";
9    const METHOD: http::Method = http::Method::POST;
10
11    type Request = CreateBugCommentRequest;
12    type Response = CreateBugCommentResponse;
13}
14
15#[derive(ApiRequest, Debug, Serialize, Deserialize)]
16pub struct CreateBugCommentRequest {
17    pub body: String,
18}
19
20#[derive(ApiResource, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
21pub struct CreateBugCommentResponse {
22    pub comment: BugCommentResource,
23    pub status: String,
24}