enbbox 1.0.1

Notification infrastructure API — open-source alternative to Novu/Courier
Documentation
/*
 * 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,
        }
    }
}