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

/// CreateChannelEndpoint : Register a channel endpoint (device token, webhook URL) for delivery.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateChannelEndpoint {
    /// Parent channel connection UUID.
    #[serde(rename = "channel_connection_id")]
    pub channel_connection_id: String,
    /// Endpoint type (e.g. device_token, webhook_url).
    #[serde(rename = "endpoint_type")]
    pub endpoint_type: String,
    /// Unique slug identifier.
    #[serde(rename = "identifier")]
    pub identifier: String,
    #[serde(rename = "metadata", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub metadata: Option<Option<serde_json::Value>>,
    /// Delivery target (token, URL, address).
    #[serde(rename = "target")]
    pub target: String,
}

impl CreateChannelEndpoint {
    /// Register a channel endpoint (device token, webhook URL) for delivery.
    pub fn new(channel_connection_id: String, endpoint_type: String, identifier: String, target: String) -> CreateChannelEndpoint {
        CreateChannelEndpoint {
            channel_connection_id,
            endpoint_type,
            identifier,
            metadata: None,
            target,
        }
    }
}