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};

/// IntegrationRecord : A configured provider integration with its routing priority and status.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct IntegrationRecord {
    /// Whether the integration is active and available for routing.
    #[serde(rename = "active")]
    pub active: bool,
    /// Channel this integration serves.
    #[serde(rename = "channel")]
    pub channel: models::ChannelType,
    /// Non-sensitive configuration — always returned.
    #[serde(rename = "config")]
    pub config: serde_json::Value,
    /// Whether credentials have been set (credentials themselves are never returned).
    #[serde(rename = "has_credentials")]
    pub has_credentials: bool,
    /// Integration UUID.
    #[serde(rename = "id")]
    pub id: uuid::Uuid,
    /// Unique slug identifier for API references.
    #[serde(rename = "identifier")]
    pub identifier: String,
    /// Display name.
    #[serde(rename = "name")]
    pub name: String,
    /// Whether this is the primary integration for its channel.
    #[serde(rename = "primary")]
    pub primary: bool,
    /// Routing priority (lower = higher priority).
    #[serde(rename = "priority")]
    pub priority: i32,
    /// Provider identifier.
    #[serde(rename = "provider_id")]
    pub provider_id: String,
}

impl IntegrationRecord {
    /// A configured provider integration with its routing priority and status.
    pub fn new(active: bool, channel: models::ChannelType, config: serde_json::Value, has_credentials: bool, id: uuid::Uuid, identifier: String, name: String, primary: bool, priority: i32, provider_id: String) -> IntegrationRecord {
        IntegrationRecord {
            active,
            channel,
            config,
            has_credentials,
            id,
            identifier,
            name,
            primary,
            priority,
            provider_id,
        }
    }
}