linkbreakers 1.52.6

Official Rust SDK for the Linkbreakers API
Documentation
/*
 * Linkbreakers API
 *
 * This is a documentation of all the APIs of Linkbreakers
 *
 * The version of the OpenAPI document: 1.52.6
 * 
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CreateWebhookRequest {
    #[serde(rename = "endpointUrl")]
    pub endpoint_url: String,
    /// Filter webhook notifications by a specific link ID. Only events from this link will trigger webhook notifications. If empty, all links in the workspace will trigger notifications.
    #[serde(rename = "linkId", skip_serializing_if = "Option::is_none")]
    pub link_id: Option<String>,
    #[serde(rename = "name")]
    pub name: String,
    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
    pub source: Option<models::WebhookSource>,
    /// Filter webhook notifications by workflow step kinds. Only workflow steps matching these kinds will trigger webhook notifications. If empty, all workflow step kinds will trigger notifications.
    #[serde(rename = "triggers", skip_serializing_if = "Option::is_none")]
    pub triggers: Option<Vec<Triggers>>,
}

impl CreateWebhookRequest {
    pub fn new(endpoint_url: String, name: String) -> CreateWebhookRequest {
        CreateWebhookRequest {
            endpoint_url,
            link_id: None,
            name,
            source: None,
            triggers: None,
        }
    }
}
/// Filter webhook notifications by workflow step kinds. Only workflow steps matching these kinds will trigger webhook notifications. If empty, all workflow step kinds will trigger notifications.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Triggers {
    #[serde(rename = "KIND_UNSPECIFIED")]
    KindUnspecified,
    #[serde(rename = "KIND_ENTRY")]
    KindEntry,
    #[serde(rename = "KIND_EXIT")]
    KindExit,
    #[serde(rename = "KIND_INTERACTION")]
    KindInteraction,
    #[serde(rename = "KIND_CONDITION")]
    KindCondition,
}

impl Default for Triggers {
    fn default() -> Triggers {
        Self::KindUnspecified
    }
}