// AUTO-GENERATED — do not edit by hand
// Upstream: https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/Jira/JiraTrigger.node.ts
// To implement: copy to ../impl/jiratrigger.rs, fill in execute(), add to ../impl/mod.rs
// r8r: rust port of n8n.io
// License: Unlicense

use async_trait::async_trait;
use crate::core::error::NodeError;
use crate::core::types::*;
use crate::engine::{ExecuteCtx, Node, NodeFactory};
use std::sync::Arc;

pub struct JiratriggerNode;

static META: NodeMetadata = NodeMetadata {
    name: "jiratrigger",
    display_name: "Jira Trigger",
    version: &[1],
    group: &["transform"],
    description: "Starts the workflow when Jira events occur",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "jiraVersion", display_name: "Jira Version", kind: PropertyKind::Options, required: false, default: Some("cloud") },
    PropertyDef { name: "authenticateWebhook", display_name: "Authenticate Incoming Webhook", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "incomingAuthentication", display_name: "Authenticate Webhook With", kind: PropertyKind::Options, required: false, default: Some("none") },
    PropertyDef { name: "events", display_name: "Events", kind: PropertyKind::MultiOptions, required: true, default: None },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "jiraSoftwareCloudApi", required: true },
    CredentialRef { name: "jiraSoftwareServerApi", required: true },
    CredentialRef { name: "jiraSoftwareServerPatApi", required: true }
],
};

#[async_trait]
impl Node for JiratriggerNode {
    fn metadata(&self) -> &'static NodeMetadata { &META }

    async fn execute(&self, _ctx: &mut ExecuteCtx<'_>) -> Result<NodeOutput, NodeError> {
    Err(NodeError::NotYetPorted { node: "jiratrigger", upstream: "https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/Jira/JiraTrigger.node.ts" })
    }
}

inventory::submit! { NodeFactory::new("jiratrigger", || Arc::new(JiratriggerNode)) }
