alchemy_api/api/notify/
delete_webhook.rs

1use crate::cores::{endpoint::Endpoint, params::QueryParams};
2use derive_builder::Builder;
3use http::Method;
4use serde::{Deserialize, Serialize};
5
6/// Allows you to delete a webhook.
7#[derive(Builder, Default, Debug, Clone, Serialize, Deserialize)]
8#[builder(setter(into))]
9pub struct DeleteWebhook {
10    /// ID of the address activity webhook.
11    webhook_id: String,
12}
13
14impl DeleteWebhook {
15    /// Create a builder for the endpoint.
16    pub fn builder() -> DeleteWebhookBuilder {
17        DeleteWebhookBuilder::default()
18    }
19}
20
21impl Endpoint for DeleteWebhook {
22    fn method(&self) -> http::Method {
23        Method::DELETE
24    }
25
26    fn endpoint(&self) -> std::borrow::Cow<'static, str> {
27        "api/delete-webhook".into()
28    }
29
30    fn parameters(&self) -> crate::cores::params::QueryParams<'_> {
31        let mut params = QueryParams::default();
32        params.push("webhook_id", self.webhook_id.clone());
33        params
34    }
35}