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

static META: NodeMetadata = NodeMetadata {
    name: "respondtowebhook",
    display_name: "Respond to Webhook",
    version: &[1],
    group: &["transform"],
    description: "Returns data for Webhook",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "enableResponseOutput", display_name: "Enable Response Output Branch", kind: PropertyKind::Boolean, required: false, default: None },
    PropertyDef { name: "generalNotice", display_name: "Verify that the ", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "credentials", display_name: "Credentials", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "webhookNotice", display_name: "When using expressions, note that this node will only run for the first item in the input data", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "redirectURL", display_name: "Redirect URL", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "responseBody", display_name: "Response Body", kind: PropertyKind::Json, required: false, default: Some("{\\n  ") },
    PropertyDef { name: "payload", display_name: "Payload", kind: PropertyKind::Json, required: false, default: Some("{\\n  ") },
    PropertyDef { name: "responseBody", display_name: "Response Body", kind: PropertyKind::String, required: false, default: Some("") },
    PropertyDef { name: "responseDataSource", display_name: "Response Data Source", kind: PropertyKind::Options, required: false, default: Some("automatically") },
    PropertyDef { name: "inputFieldName", display_name: "Input Field Name", kind: PropertyKind::String, required: true, default: Some("data") },
    PropertyDef { name: "contentTypeNotice", display_name: "To avoid unexpected behavior, add a ", kind: PropertyKind::Notice, required: false, default: Some("") },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "jwtAuth", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("respondtowebhook", || Arc::new(RespondtowebhookNode)) }
