Skip to main content

args_api/endpoint/webhook/
update_webhook.rs

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