Skip to main content

args_api/endpoint/question/
update_question.rs

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