args-api 0.1.0

Shared API contract types and endpoint definitions for args.
Documentation
use serde::{Deserialize, Serialize};

use crate::{endpoint::Endpoint, resource::bug::BugCommentResource};

pub struct CreateBugComment;

impl Endpoint for CreateBugComment {
    const PATH: &'static str = "/repository/{owner}/{repo}/bugs/{number}/comment";
    const METHOD: http::Method = http::Method::POST;

    type Request = CreateBugCommentRequest;
    type Response = CreateBugCommentResponse;
}

#[derive(ApiRequest, Debug, Serialize, Deserialize)]
pub struct CreateBugCommentRequest {
    pub body: String,
}

#[derive(ApiResource, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct CreateBugCommentResponse {
    pub comment: BugCommentResource,
    pub status: String,
}