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

static META: NodeMetadata = NodeMetadata {
    name: "mandrill",
    display_name: "Mandrill",
    version: &[1],
    group: &["transform"],
    description: "Consume Mandrill API",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "resource", display_name: "Resource", kind: PropertyKind::Options, required: false, default: Some("message") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("sendTemplate") },
    PropertyDef { name: "template", display_name: "Template Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "fromEmail", display_name: "From Email", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "toEmail", display_name: "To Email", kind: PropertyKind::String, required: true, 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: "mergeVarsJson", display_name: "Merge Vars", kind: PropertyKind::Json, required: false, default: Some("") },
    PropertyDef { name: "mergeVarsUi", display_name: "Merge Vars", kind: PropertyKind::FixedCollection, required: false, default: Some("") },
    PropertyDef { name: "metadataUi", display_name: "Metadata", kind: PropertyKind::FixedCollection, required: false, default: Some("Name of the metadata key to add.") },
    PropertyDef { name: "metadataJson", display_name: "Metadata", kind: PropertyKind::Json, required: false, default: Some("") },
    PropertyDef { name: "attachmentsJson", display_name: "Attachments", kind: PropertyKind::Json, required: false, default: Some("") },
    PropertyDef { name: "attachmentsUi", display_name: "Attachments", kind: PropertyKind::FixedCollection, required: false, default: Some("") },
    PropertyDef { name: "headersJson", display_name: "Headers", kind: PropertyKind::Json, required: false, default: Some("") },
    PropertyDef { name: "headersUi", display_name: "Headers", kind: PropertyKind::FixedCollection, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "mandrillApi", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("mandrill", || Arc::new(MandrillNode)) }
