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

static META: NodeMetadata = NodeMetadata {
    name: "comparedatasets",
    display_name: "Compare Datasets",
    version: &[1],
    group: &["transform"],
    description: "Compare two inputs for changes",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "infoBox", display_name: "Items from different branches are paired together when the fields below match. If paired, the rest of the fields are compared to determine whether the items are the same or different", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "mergeByFields", display_name: "Fields to Match", kind: PropertyKind::FixedCollection, required: false, default: Some("") },
    PropertyDef { name: "resolve", display_name: "When There Are Differences", kind: PropertyKind::Options, required: false, default: Some("preferInput2") },
    PropertyDef { name: "resolve", display_name: "When There Are Differences", kind: PropertyKind::Options, required: false, default: Some("includeBoth") },
    PropertyDef { name: "fuzzyCompare", display_name: "Fuzzy Compare", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "preferWhenMix", display_name: "Prefer", kind: PropertyKind::Options, required: false, default: Some("input1") },
    PropertyDef { name: "exceptWhenMix", display_name: "For Everything Except", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("") }
],
    credentials: &[],
};

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

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

inventory::submit! { NodeFactory::new("comparedatasets", || Arc::new(ComparedatasetsNode)) }
