// AUTO-GENERATED — do not edit by hand
// Upstream: https://github.com/n8n-io/n8n/blob/master/packages/nodes-base/nodes/Gitlab/GitlabTrigger.node.ts
// To implement: copy to ../impl/comment.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 CommentNode;

static META: NodeMetadata = NodeMetadata {
    name: "comment",
    display_name: "GitLab Trigger",
    version: &[1],
    group: &["transform"],
    description: "Triggered when a new comment is made on commits, merge requests, issues, and code snippets",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "authentication", display_name: "Authentication", kind: PropertyKind::Options, required: false, default: Some("accessToken") },
    PropertyDef { name: "owner", display_name: "Repository Owner", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "repository", display_name: "Repository Name", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "events", display_name: "Events", kind: PropertyKind::MultiOptions, required: true, default: None }
],
    credentials: &[
    CredentialRef { name: "gitlabApi", required: true },
    CredentialRef { name: "gitlabOAuth2Api", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("comment", || Arc::new(CommentNode)) }
