// AUTO-GENERATED — do not edit by hand
// Upstream: https://github.com/n8n-io/n8n/blob/master/packages/@n8n/nodes-langchain/nodes/tools/ToolHttpRequest/ToolHttpRequest.node.ts
// To implement: copy to ../impl/toolhttprequest.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 ToolhttprequestNode;

static META: NodeMetadata = NodeMetadata {
    name: "toolhttprequest",
    display_name: "HTTP Request Tool",
    version: &[1],
    group: &["transform"],
    description: "Makes an HTTP request and returns the response data",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "toolDescription", display_name: "Description", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "method", display_name: "Method", kind: PropertyKind::Options, required: false, default: Some("GET") },
    PropertyDef { name: "placeholderNotice", display_name: "Tip: You can use a {placeholder} for any part of the request to be filled by the model. Provide more context about them in the placeholders section", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "url", display_name: "URL", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "sendQuery", display_name: "Send Query Parameters", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "specifyQuery", display_name: "Specify Query Parameters", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "parametersQuery", display_name: "Query Parameters", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "jsonQuery", display_name: "jsonQuery", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "sendHeaders", display_name: "Send Headers", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "specifyHeaders", display_name: "Specify Headers", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "parametersHeaders", display_name: "Header Parameters", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "jsonHeaders", display_name: "jsonHeaders", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "sendBody", display_name: "Send Body", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "specifyBody", display_name: "Specify Body", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "parametersBody", display_name: "Body Parameters", kind: PropertyKind::String, required: false, default: None },
    PropertyDef { name: "jsonBody", display_name: "jsonBody", kind: PropertyKind::String, required: false, default: None }
],
    credentials: &[],
};

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

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

inventory::submit! { NodeFactory::new("toolhttprequest", || Arc::new(ToolhttprequestNode)) }
