linkbreakers 1.46.15

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.46.15
 * 
 * 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<models::WorkflowStepKind>>,
}

impl CreateWebhookRequest {
    pub fn new(endpoint_url: String, name: String) -> CreateWebhookRequest {
        CreateWebhookRequest {
            endpoint_url,
            link_id: None,
            name,
            source: None,
            triggers: None,
        }
    }
}