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

static META: NodeMetadata = NodeMetadata {
    name: "nextcloud",
    display_name: "Nextcloud",
    version: &[1],
    group: &["transform"],
    description: "Access data on Nextcloud",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "authentication", display_name: "Authentication", kind: PropertyKind::Options, required: false, default: Some("accessToken") },
    PropertyDef { name: "resource", display_name: "Resource", kind: PropertyKind::Options, required: false, default: Some("file") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("upload") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("create") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("create") },
    PropertyDef { name: "path", display_name: "From Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "toPath", display_name: "To Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "path", display_name: "Delete Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "path", display_name: "From Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "toPath", display_name: "To Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "path", display_name: "File Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "binaryPropertyName", display_name: "Put Output File in Field", kind: PropertyKind::String, required: true, default: Some("data") },
    PropertyDef { name: "path", display_name: "File Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "binaryDataUpload", display_name: "Binary File", kind: PropertyKind::Boolean, required: true, default: None },
    PropertyDef { name: "fileContent", display_name: "File Content", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "binaryPropertyName", display_name: "Input Binary Field", kind: PropertyKind::String, required: true, default: Some("data") },
    PropertyDef { name: "path", display_name: "File Path", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "shareType", display_name: "Share Type", kind: PropertyKind::Options, required: false, default: None },
    PropertyDef { name: "circleId", display_name: "Circle ID", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "email", display_name: "Email", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "groupId", display_name: "Group ID", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "user", display_name: "User", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "path", display_name: "Folder", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "path", display_name: "Folder Path", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "userId", display_name: "Username", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "email", display_name: "Email", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "userId", display_name: "Username", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "returnAll", display_name: "Return All", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "limit", display_name: "Limit", kind: PropertyKind::Number, required: false, default: None },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "updateFields", display_name: "Update Fields", kind: PropertyKind::FixedCollection, required: false, default: Some("email") }
],
    credentials: &[
    CredentialRef { name: "nextCloudApi", required: true },
    CredentialRef { name: "nextCloudOAuth2Api", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("nextcloud", || Arc::new(NextcloudNode)) }
