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

static META: NodeMetadata = NodeMetadata {
    name: "spotify",
    display_name: "Spotify",
    version: &[1],
    group: &["transform"],
    description: "Access public song data via the Spotify API",
    inputs: 1,
    outputs: 1,
    properties: &[
    PropertyDef { name: "resource", display_name: "Resource", kind: PropertyKind::Options, required: false, default: Some("player") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("addSongToQueue") },
    PropertyDef { name: "id", display_name: "Resource ID", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "id", display_name: "Track ID", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("track") },
    PropertyDef { name: "id", display_name: "Track ID", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "query", display_name: "Search Keyword", kind: PropertyKind::String, required: true, default: Some("") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("getLikedTracks") },
    PropertyDef { name: "operation", display_name: "Operation", kind: PropertyKind::Options, required: false, default: Some("getFollowingArtists") },
    PropertyDef { name: "returnAll", display_name: "Return All", kind: PropertyKind::Boolean, required: true, default: None },
    PropertyDef { name: "limit", display_name: "Limit", kind: PropertyKind::Number, required: true, default: None },
    PropertyDef { name: "limit", display_name: "Limit", kind: PropertyKind::Number, required: true, default: None },
    PropertyDef { name: "volumePercent", display_name: "Volume", kind: PropertyKind::Number, required: true, default: None },
    PropertyDef { name: "filters", display_name: "Filters", kind: PropertyKind::Collection, required: false, default: Some("US") },
    PropertyDef { name: "filters", display_name: "Filters", kind: PropertyKind::Collection, required: false, default: Some("") }
],
    credentials: &[
    CredentialRef { name: "spotifyOAuth2Api", required: true }
],
};

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

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

inventory::submit! { NodeFactory::new("spotify", || Arc::new(SpotifyNode)) }
