Skip to main content

args_api/endpoint/webhook/
create_webhook.rs

1use serde::{Deserialize, Serialize};
2
3use crate::{endpoint::Endpoint, resource::WebhookResource};
4
5pub struct CreateWebhook;
6
7impl Endpoint for CreateWebhook {
8    const PATH: &'static str = "/repository/{owner}/{repo}/webhook";
9    const METHOD: http::Method = http::Method::POST;
10
11    type Request = CreateWebhookRequest;
12    type Response = CreateWebhookResponse;
13}
14
15#[derive(ApiRequest, Debug, Serialize, Deserialize)]
16pub struct CreateWebhookRequest {
17    pub url: String,
18    pub secret: String,
19    pub events: Vec<String>,
20}
21
22pub type CreateWebhookResponse = WebhookResource;