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


namespace Domain.Rokid.Request
{
    public class Authorization
    {
        /// <summary>
        /// BearerToken
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// a-token-from-skill
        /// </summary>
        public string token { get; set; }
    }

    public class Header
    {
        /// <summary>
        /// 5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4
        /// </summary>
        public string messageId { get; set; }
        /// <summary>
        /// Rokid.Control
        /// </summary>
        public string @namespace { get; set; }
        /// <summary>
        /// Brightness.Adjust
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// v1
        /// </summary>
        public string payloadVersion { get; set; }
        /// <summary>
        /// Authorization
        /// </summary>
        public Authorization authorization { get; set; }
    }

    public class AdditionalInfo
    {
        /// <summary>
        /// value
        /// </summary>
        public string key { get; set; }
    }

    public class States
    {
        /// <summary>
        /// Color
        /// </summary>
        public string @interface { get; set; }
        /// <summary>
        /// Value
        /// </summary>
        public string value { get; set; }
    }

    public class Endpoint
    {
        /// <summary>
        /// 开发者自己定义的终端Id
        /// </summary>
        public string endpointId { get; set; }
        /// <summary>
        /// AdditionalInfo
        /// </summary>
        public AdditionalInfo additionalInfo { get; set; }
        /// <summary>
        /// States
        /// </summary>
        public List<States> states { get; set; }
    }

    public class Payload
    {
        /// <summary>
        /// 相对值
        /// </summary>
        public int? delta { get; set; }
        /// <summary>
        /// 百分比
        /// </summary>
        public int? value { get; set; }
    }

    public class RootRequest
    {
        /// <summary>
        /// Header
        /// </summary>
        public Header header { get; set; }
        /// <summary>
        /// Endpoint
        /// </summary>
        public Endpoint endpoint { get; set; }
        /// <summary>
        /// Payload
        /// </summary>
        public Payload payload { get; set; }
    }
}
namespace Domain.Rokid.Discovery
{
    public class Header
    {
        /// <summary>
        /// 5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4
        /// </summary>
        public string messageId { get; set; }
        /// <summary>
        /// Rokid
        /// </summary>
        public string @namespace { get; set; }
        /// <summary>
        /// DiscoveryResponse
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// v1
        /// </summary>
        public string payloadVersion { get; set; }
    }

    public class AdditionalInfo
    {
        /// <summary>
        /// value
        /// </summary>
        public string key { get; set; }
    }

    public class Capabilities
    {
        /// <summary>
        /// Switch
        /// </summary>
        public string @interface { get; set; }
        /// <summary>
        /// SupportedOperations
        /// </summary>
        public List<string> supportedOperations { get; set; }
        /// <summary>
        /// ProactivelyReported
        /// </summary>
        public bool proactivelyReported { get; set; }
        /// <summary>
        /// Retrievable
        /// </summary>
        public bool retrievable { get; set; }
    }
    /// <summary>
    /// 自定义技能
    /// </summary>
    public static class CustomerCapabilities
    {
        /// <summary>
        /// 开关技能
        /// </summary>
        /// <returns></returns>
        public static List<Capabilities> SwitchCapabilities()
        {
            List<Capabilities> capabilities = new List<Capabilities>();
            capabilities.Add(new Capabilities
            {
                @interface = "Switch",
                supportedOperations = new List<string> { "On", "Off" },
                proactivelyReported = true,
                retrievable = true
            });
            return capabilities;
        }
        /// <summary>
        /// 窗帘技能
        /// </summary>
        /// <returns></returns>
        public static List<Capabilities> MotionSwitchCapabilities()
        {
            List<Capabilities> capabilities = new List<Capabilities>();
            capabilities.Add(new Capabilities
            {
                @interface = "Switch",
                supportedOperations = new List<string> { "On", "Off" },
                proactivelyReported = true,
                retrievable = true
            });
            capabilities.Add(new Capabilities
            {
                @interface = "MotionSwitch",
                supportedOperations = new List<string> { "On", "Off" },
                proactivelyReported = true,
                retrievable = true
            });
            return capabilities;
        }
        /// <summary>
        /// 调光技能
        /// </summary>
        /// <returns></returns>
        public static List<Capabilities> BrightnessCapabilities()
        {
            List<Capabilities> capabilities = new List<Capabilities>();
            capabilities.Add(new Capabilities
            {
                @interface = "Switch",
                supportedOperations = new List<string> { "On", "Off" },
                proactivelyReported = true,
                retrievable = true
            });
            capabilities.Add(new Capabilities
            {
                @interface = "Brightness",
                supportedOperations = new List<string> { "Set", "SetMax", "SetMin", "Adjust" },
                proactivelyReported = true,
                retrievable = true
            });
            return capabilities;
        }
        /// <summary>
        /// 空调技能
        /// </summary>
        /// <returns></returns>
        public static List<Capabilities> AirCapabilities()
        {
            List<Capabilities> capabilities = new List<Capabilities>();
            capabilities.Add(new Capabilities
            {
                @interface = "Switch",//开关
                supportedOperations = new List<string> { "On", "Off" },
                proactivelyReported = true,
                retrievable = true
            });
            capabilities.Add(new Capabilities
            {
                @interface = "Temperature",//温度
                supportedOperations = new List<string> { "Set", "SetMax", "SetMin", "Adjust" },
                proactivelyReported = true,
                retrievable = true
            });
            capabilities.Add(new Capabilities
            {
                @interface = "FanSpeed",//风速
                supportedOperations = new List<string> { "Set", "SetMax", "SetMin", "Adjust" },//自动0,高3,低1,中2
                proactivelyReported = true,
                retrievable = true
            });
            capabilities.Add(new Capabilities
            {
                @interface = "Mode",//模式
                supportedOperations = new List<string> { "Auto", "Cool", "Heat", "Fan" },//"Manual","Dry", "Silent", "Energy", "Sleep"
                proactivelyReported = true,
                retrievable = true
            });
            return capabilities;
        }
    }

    public class States
    {
        /// <summary>
        /// Switch
        /// </summary>
        public string @interface { get; set; }
        /// <summary>
        /// On
        /// </summary>
        public string value { get; set; }
        /// <summary>
        /// 2018-03-15T18:00:00.000Z
        /// </summary>
        public string timeOfSample { get; set; }
    }

    public class Endpoints
    {
        /// <summary>
        /// blwrcu_8101_light001
        /// </summary>
        public string endpointId { get; set; }
        /// <summary>
        /// light
        /// </summary>
        public string displayType { get; set; }
        /// <summary>
        /// 床头灯
        /// </summary>
        public string displayName { get; set; }
        /// <summary>
        /// 房号
        /// </summary>
        public string recommendRoomName { get; set; }
        /// <summary>
        /// 家名
        /// </summary>
        public string recommendHomeName { get; set; }
        /// <summary>
        /// GROSS-REIS-LAMPE-ALPHA
        /// </summary>
        public string modelId { get; set; }
        /// <summary>
        /// AdditionalInfo
        /// </summary>
        public AdditionalInfo additionalInfo { get; set; }
        /// <summary>
        /// Capabilities
        /// </summary>
        public List<Capabilities> capabilities { get; set; }
        /// <summary>
        /// States
        /// </summary>
        public List<States> states { get; set; }
    }

    public class Payload
    {
        /// <summary>
        /// Endpoints
        /// </summary>
        public List<Endpoints> endpoints { get; set; }
    }

    public class DiscoveryResponse
    {
        /// <summary>
        /// Header
        /// </summary>
        public Header header { get; set; }
        /// <summary>
        /// Payload
        /// </summary>
        public Payload payload { get; set; }
    }
}
namespace Domain.Rokid.Control
{
    public class Header
    {
        /// <summary>
        /// 5f8a426e-01e4-4cc9-8b79-65f8bd0fd8a4
        /// </summary>
        public string messageId { get; set; }
        /// <summary>
        /// Rokid
        /// </summary>
        public string @namespace { get; set; }
        /// <summary>
        /// Response
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// v1
        /// </summary>
        public string payloadVersion { get; set; }
    }

    public class States
    {
        /// <summary>
        /// Color
        /// </summary>
        public string @interface { get; set; }
        /// <summary>
        /// Value
        /// </summary>
        public string value { get; set; }
    }

    public class Endpoint
    {
        /// <summary>
        /// 开发者自己定义的终端Id
        /// </summary>
        public string endpointId { get; set; }
        /// <summary>
        /// States
        /// </summary>
        public List<States> states { get; set; }
    }

    public class Payload
    {
    }

    public class ControlResponse
    {
        /// <summary>
        /// Header
        /// </summary>
        public Header header { get; set; }
        /// <summary>
        /// Endpoint
        /// </summary>
        public Endpoint endpoint { get; set; }
        /// <summary>
        /// Payload
        /// </summary>
        public Payload payload { get; set; }
    }
}
namespace Domain.Rokid.Error
{
    public class Header
    {
        /// <summary>
        /// 789-123
        /// </summary>
        public string messageId { get; set; }
        /// <summary>
        /// Rokid
        /// </summary>
        public string @namespace { get; set; }
        /// <summary>
        /// ErrorResponse
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// v1
        /// </summary>
        public string payloadVersion { get; set; }
    }

    public class Payload
    {
        /// <summary>
        /// E_DRIVER_ERROR
        /// </summary>
        public string name { get; set; }
        /// <summary>
        /// 发生了一些不可告人的错误
        /// </summary>
        public string message { get; set; }
    }

    public class ErrorResponse
    {
        /// <summary>
        /// Header
        /// </summary>
        public Header header { get; set; }
        /// <summary>
        /// Payload
        /// </summary>
        public Payload payload { get; set; }
    }
}
