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

static META: NodeMetadata = NodeMetadata {
    name: "rocketchat",
    display_name: "RocketChat",
    version: &[1],
    group: &["transform"],
    description: "Consume RocketChat API",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "resource", display_name: "Resource", kind: PropertyKind::Options, required: false, default: Some("chat") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("postMessage") },
    PropertyDef { name: "channel", display_name: "Channel", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "text", display_name: "Text", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "jsonParameters", display_name: "JSON Parameters", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "attachments", display_name: "Attachments", kind: PropertyKind::Collection, required: false, default: Some("#ff0000") },
    PropertyDef { name: "attachmentsJson", display_name: "Attachments", kind: PropertyKind::Json, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "rocketchatApi", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("rocketchat", || Arc::new(RocketchatNode)) }
