using System;
using System.Collections.Generic;
using Essensoft.Paylink.Alipay.Response;
using Essensoft.Paylink.Alipay.Utility;

namespace Essensoft.Paylink.Alipay.Request
{
    /// <summary>
    /// alipay.ins.data.auto.coefficient.sync
    /// </summary>
    public class AlipayInsDataAutoCoefficientSyncRequest : IAlipayUploadRequest<AlipayInsDataAutoCoefficientSyncResponse>
    {
        /// <summary>
        /// csv文件
        /// </summary>
        public FileItem CoeffecientTableContent { get; set; }

        /// <summary>
        /// 同步表id，每次同步的系数表应有唯一可辨认的id
        /// </summary>
        public string CoeffecientTableId { get; set; }

        /// <summary>
        /// 同步系数表的条目数量
        /// </summary>
        public Nullable<long> CoeffecientTableSize { get; set; }

        /// <summary>
        /// 请求id，每次请求唯一
        /// </summary>
        public string RequestId { get; set; }

        #region IAlipayRequest Members

        private bool needEncrypt = false;
        private string apiVersion = "1.0";
        private string terminalType;
        private string terminalInfo;
        private string prodCode;
        private string notifyUrl;
        private string returnUrl;
        private AlipayObject bizModel;

        public void SetNeedEncrypt(bool needEncrypt)
        {
            this.needEncrypt = needEncrypt;
        }

        public bool GetNeedEncrypt()
        {
            return needEncrypt;
        }

        public void SetNotifyUrl(string notifyUrl)
        {
            this.notifyUrl = notifyUrl;
        }

        public string GetNotifyUrl()
        {
            return notifyUrl;
        }

        public void SetReturnUrl(string returnUrl)
        {
            this.returnUrl = returnUrl;
        }

        public string GetReturnUrl()
        {
            return returnUrl;
        }

        public void SetTerminalType(string terminalType)
        {
            this.terminalType = terminalType;
        }

        public string GetTerminalType()
        {
            return terminalType;
        }

        public void SetTerminalInfo(string terminalInfo)
        {
            this.terminalInfo = terminalInfo;
        }

        public string GetTerminalInfo()
        {
            return terminalInfo;
        }

        public void SetProdCode(string prodCode)
        {
            this.prodCode = prodCode;
        }

        public string GetProdCode()
        {
            return prodCode;
        }

        public void SetApiVersion(string apiVersion)
        {
            this.apiVersion = apiVersion;
        }

        public string GetApiVersion()
        {
            return apiVersion;
        }

        public string GetApiName()
        {
            return "alipay.ins.data.auto.coefficient.sync";
        }

        public IDictionary<string, string> GetParameters()
        {
            var parameters = new AlipayDictionary
            {
                { "coeffecient_table_id", CoeffecientTableId },
                { "coeffecient_table_size", CoeffecientTableSize },
                { "request_id", RequestId }
            };
            return parameters;
        }

        public AlipayObject GetBizModel()
        {
            return bizModel;
        }

        public void SetBizModel(AlipayObject bizModel)
        {
            this.bizModel = bizModel;
        }

        #endregion

        #region IAlipayUploadRequest Members

        public IDictionary<string, FileItem> GetFileParameters()
        {
            var parameters = new Dictionary<string, FileItem>
            {
                { "coeffecient_table_content", CoeffecientTableContent }
            };
            return parameters;
        }

        #endregion
    }
}
