btcpay_client/models/
webhook_data_create.rs

1/*
2 * BTCPay Greenfield API
3 *
4 * A full API to use your BTCPay Server
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11
12
13
14#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
15pub struct WebhookDataCreate {
16    /// The id of the webhook
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    /// Whether this webhook is enabled or not
20    #[serde(rename = "enabled", skip_serializing_if = "Option::is_none")]
21    pub enabled: Option<bool>,
22    /// If true, BTCPay Server will retry to redeliver any failed delivery after 10 seconds, 1 minutes and up to 6 times after 10 minutes.
23    #[serde(rename = "automaticRedelivery", skip_serializing_if = "Option::is_none")]
24    pub automatic_redelivery: Option<bool>,
25    /// The endpoint where BTCPay Server will make the POST request with the webhook body
26    #[serde(rename = "url", skip_serializing_if = "Option::is_none")]
27    pub url: Option<String>,
28    #[serde(rename = "authorizedEvents", skip_serializing_if = "Option::is_none")]
29    pub authorized_events: Option<Box<crate::models::WebhookDataBaseAuthorizedEvents>>,
30    /// Must be used by the callback receiver to ensure the delivery comes from BTCPay Server. BTCPay Server includes the `BTCPay-Sig` HTTP header, whose format is `sha256=HMAC256(UTF8(webhook's secret), body)`. The pattern to authenticate the webhook is similar to [how to secure webhooks in Github](https://docs.github.com/webhooks/securing/).
31    #[serde(rename = "secret", skip_serializing_if = "Option::is_none")]
32    pub secret: Option<String>,
33}
34
35impl WebhookDataCreate {
36    pub fn new() -> WebhookDataCreate {
37        WebhookDataCreate {
38            id: None,
39            enabled: None,
40            automatic_redelivery: None,
41            url: None,
42            authorized_events: None,
43            secret: None,
44        }
45    }
46}
47
48