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

static META: NodeMetadata = NodeMetadata {
    name: "beeminder",
    display_name: "Beeminder",
    version: &[1],
    group: &["transform"],
    description: "Consume Beeminder API",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "authentication", display_name: "Authentication", kind: PropertyKind::Options, required: false, default: Some("apiToken") },
    PropertyDef { name: "resource", display_name: "Resource", kind: PropertyKind::Options, required: true, default: Some("datapoint") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: true, default: Some("create") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: true, default: Some("create") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: true, default: Some("get") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: true, default: Some("get") },
    PropertyDef { name: "goalName", display_name: "Goal Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "goalName", display_name: "Goal Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "goalName", display_name: "Goal Name or ID", kind: PropertyKind::Options, required: true, default: Some("") },
    PropertyDef { name: "amount", display_name: "Amount", kind: PropertyKind::Number, required: true, default: None },
    PropertyDef { name: "datapoints", display_name: "Datapoints", kind: PropertyKind::Json, required: true, default: Some("[]") },
    PropertyDef { name: "slug", display_name: "Goal Slug", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "title", display_name: "Goal Title", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "goal_type", display_name: "Goal Type", kind: PropertyKind::Options, required: true, default: Some("hustler") },
    PropertyDef { name: "gunits", display_name: "Goal Units", 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: "value", display_name: "Value", kind: PropertyKind::Number, required: true, default: None },
    PropertyDef { name: "datapointId", display_name: "Datapoint ID", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: Some("manual") },
    PropertyDef { name: "updateFields", display_name: "Update Fields", kind: PropertyKind::Collection, required: false, default: Some("") },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: None },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: None },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: None },
    PropertyDef { name: "additionalFields", display_name: "Additional Fields", kind: PropertyKind::Collection, required: false, default: None },
    PropertyDef { name: "options", display_name: "Options", kind: PropertyKind::Collection, required: false, default: Some("id") },
    PropertyDef { name: "updateFields", display_name: "Update Fields", kind: PropertyKind::Collection, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "beeminderApi", required: true },
    CredentialRef { name: "beeminderOAuth2Api", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("beeminder", || Arc::new(BeeminderNode)) }
