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

static META: NodeMetadata = NodeMetadata {
    name: "filemaker",
    display_name: "FileMaker",
    version: &[1],
    group: &["transform"],
    description: "Retrieve data from the FileMaker data API",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "action", display_name: "Action", kind: PropertyKind::Options, required: false, default: Some("record") },
    PropertyDef { name: "layout", display_name: "Layout Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "recid", display_name: "Record ID", kind: PropertyKind::Number, required: true, default: Some("") },
    PropertyDef { name: "offset", display_name: "Offset", kind: PropertyKind::Number, required: false, default: None },
    PropertyDef { name: "limit", display_name: "Limit", kind: PropertyKind::Number, required: false, default: None },
    PropertyDef { name: "getPortals", display_name: "Get Portals", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "portals", display_name: "Portals Name or ID", kind: PropertyKind::Options, required: false, default: None },
    PropertyDef { name: "responseLayout", display_name: "Response Layout Name or ID", kind: PropertyKind::Options, required: false, default: Some("") },
    PropertyDef { name: "queries", display_name: "Queries", kind: PropertyKind::FixedCollection, required: false, default: Some("") },
    PropertyDef { name: "setSort", display_name: "Sort Data?", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "sortParametersUi", display_name: "Sort", kind: PropertyKind::FixedCollection, required: false, default: Some("") },
    PropertyDef { name: "setScriptBefore", display_name: "Before Find Script", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "scriptBefore", display_name: "Script Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "scriptBeforeParam", display_name: "Script Parameter", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "setScriptSort", display_name: "Before Sort Script", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "scriptSort", display_name: "Script Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "scriptSortParam", display_name: "Script Parameter", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "setScriptAfter", display_name: "After Sort Script", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "scriptAfter", display_name: "Script Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "scriptAfterParam", display_name: "Script Parameter", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "fieldData", display_name: "fieldData", kind: PropertyKind::String, required: false, default: Some("{}") },
    PropertyDef { name: "modId", display_name: "Mod ID", kind: PropertyKind::Number, required: false, default: Some("") },
    PropertyDef { name: "fieldsParametersUi", display_name: "Fields", kind: PropertyKind::FixedCollection, required: false, default: Some("") },
    PropertyDef { name: "script", display_name: "Script Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "scriptParam", display_name: "Script Parameter", kind: PropertyKind::String, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "fileMaker", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("filemaker", || Arc::new(FilemakerNode)) }
