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

static META: NodeMetadata = NodeMetadata {
    name: "readwritefile",
    display_name: "Read/Write Files from Disk",
    version: &[1],
    group: &["transform"],
    description: "Read or write files from the computer that runs n8n",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "info", display_name: "Use this node to read and write files on the same computer running n8n. To handle files between different computers please use other nodes (e.g. FTP, HTTP Request, AWS).", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("read") }
],
    credentials: &[],
};

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

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

inventory::submit! { NodeFactory::new("readwritefile", || Arc::new(ReadwritefileNode)) }
