Skip to main content

args_api/endpoint/question/
create_question.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{endpoint::Endpoint, resource::question::QuestionResource};
4
5pub struct CreateQuestion;
6
7impl Endpoint for CreateQuestion {
8    const PATH: &'static str = "/repository/{owner}/{repo}/question";
9    const METHOD: http::Method = http::Method::POST;
10
11    type Request = CreateQuestionRequest;
12    type Response = CreateQuestionResponse;
13}
14
15#[derive(ApiRequest, Debug, Serialize, Deserialize)]
16pub struct CreateQuestionRequest {
17    pub title: String,
18    pub body: String,
19}
20
21pub type CreateQuestionResponse = QuestionResource;