1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* enbbox API
*
* Notification infrastructure API — open-source alternative to Novu/Courier
*
* The version of the OpenAPI document: 1.0.0
*
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// WebhookRecord : A registered webhook endpoint that receives event callbacks.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct WebhookRecord {
/// Whether this resource is active.
#[serde(rename = "active")]
pub active: bool,
/// ISO 8601 creation timestamp.
#[serde(rename = "created_at")]
pub created_at: String,
/// Event types this webhook subscribes to.
#[serde(rename = "events")]
pub events: Vec<String>,
/// Unique identifier.
#[serde(rename = "id")]
pub id: String,
/// HMAC signing key for verifying webhook payloads.
#[serde(rename = "signing_key")]
pub signing_key: String,
/// Webhook callback URL.
#[serde(rename = "url")]
pub url: String,
}
impl WebhookRecord {
/// A registered webhook endpoint that receives event callbacks.
pub fn new(active: bool, created_at: String, events: Vec<String>, id: String, signing_key: String, url: String) -> WebhookRecord {
WebhookRecord {
active,
created_at,
events,
id,
signing_key,
url,
}
}
}