using System;
using System.Collections.Generic;
using System.Text;

namespace Edge.Core.UniversalApi
{
    /// <summary>
    /// On Class indicates it's an Event declaration.
    ///     NOTE: specify 'EventDataType' for better Api doc generation.
    /// On Method indicates it's a Service declaration.
    ///     NOTE: target Method must has return type of Task.
    /// </summary>
    [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method | AttributeTargets.Property, AllowMultiple = true)]
    public class UniversalApiAttribute : Attribute
    {
        public string Name { get; set; }
        /// <summary>
        /// ignore this api expose to outside
        /// </summary>
        public bool IgnoreApi { get; set; }

        public string Description { get; set; }

        /// <summary>
        /// A sample Json data that match the API's input parameters declartion, the caller can use this sample to start a API call.
        /// it's provided to help the caller to test or understand the api.
        /// </summary>
        public string InputParametersExampleJson { get; set; }

        /// <summary>
        /// indicates this Api is an event api, and the event will raise data with this type.
        /// </summary>
        public Type EventDataType { get; set; }

        ///// <summary>
        ///// like method parameter
        ///// </summary>
        //public Type ServiceInputDataType { get; set; }

        ///// <summary>
        ///// like method return data.
        ///// </summary>
        //public Type ServiceOutputDataType { get; set; }
    }
}
