using System;
using NodePipeline.Abstractions.Interfaces.Nodes;

// ReSharper disable UnusedAutoPropertyAccessor.Global

namespace NodePipeline.Abstractions.Attributes;

/// <summary>
///     Node field required attribute
/// </summary>
/// <param name="direction">Specifies node field direction</param>
/// <param name="name">Optional node field name override</param>
[AttributeUsage(AttributeTargets.Property)]
public sealed class NodeFieldAttribute(FieldDirection direction, string? name = null) : Attribute
{
    /// <summary>
    ///     User specified field name
    ///     <para>
    ///         In other case property name will be used
    ///     </para>
    /// </summary>
    public string? Name { get; } = name;

    /// <summary>
    ///     Node field direction
    /// </summary>
    public FieldDirection Direction { get; } = direction;
}