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

/// UpdateIntegration : Partial update of an existing provider integration. Only provided fields are changed.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct UpdateIntegration {
    /// Updated active status.
    #[serde(rename = "active", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub active: Option<Option<bool>>,
    /// Updated routing conditions.
    #[serde(rename = "conditions")]
    pub conditions: serde_json::Value,
    /// Updated non-sensitive configuration. Merged with existing config.
    #[serde(rename = "config")]
    pub config: serde_json::Value,
    /// Updated credentials. Only overwrites credentials if provided.
    #[serde(rename = "credentials")]
    pub credentials: serde_json::Value,
    /// Updated slug identifier.
    #[serde(rename = "identifier", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub identifier: Option<Option<String>>,
    /// Updated display name.
    #[serde(rename = "name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub name: Option<Option<String>>,
    /// If true, test the connection before saving.
    #[serde(rename = "test_connection", skip_serializing_if = "Option::is_none")]
    pub test_connection: Option<bool>,
}

impl UpdateIntegration {
    /// Partial update of an existing provider integration. Only provided fields are changed.
    pub fn new(conditions: serde_json::Value, config: serde_json::Value, credentials: serde_json::Value) -> UpdateIntegration {
        UpdateIntegration {
            active: None,
            conditions,
            config,
            credentials,
            identifier: None,
            name: None,
            test_connection: None,
        }
    }
}