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

static META: NodeMetadata = NodeMetadata {
    name: "facebookgraphapi",
    display_name: "Facebook Graph API",
    version: &[1],
    group: &["transform"],
    description: "Interacts with Facebook using the Graph API",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "hostUrl", display_name: "Host URL", kind: PropertyKind::Options, required: true, default: Some("graph.facebook.com") },
    PropertyDef { name: "httpRequestMethod", display_name: "HTTP Request Method", kind: PropertyKind::Options, required: true, default: Some("GET") },
    PropertyDef { name: "graphApiVersion", display_name: "Graph API Version", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "node", display_name: "Node", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "edge", display_name: "Edge", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "allowUnauthorizedCerts", display_name: "Ignore SSL Issues (Insecure)", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "sendBinaryData", display_name: "Send Binary File", kind: PropertyKind::Boolean, required: true, default: None },
    PropertyDef { name: "binaryPropertyName", display_name: "Input Binary Field", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "facebookGraphApi", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("facebookgraphapi", || Arc::new(FacebookgraphapiNode)) }
