using System;
using System.Collections.Generic;

namespace EngineSdkConverter.Unity.SDK
{

    //***** 初始化功能统一参数 *****//
    public class InitEventBuilder
    {
        public class InitEvent
        {
            public string serverURL;
            public string[] serverURLs;
            public Action<string> autoLogoutCallback;
            public AIHelpInitType aihelp;
        }

        private InitEvent _event;

        public InitEventBuilder()
        {
            _event = new InitEvent();
        }

        public InitEventBuilder SetServerURL(string url)
        {
            _event.serverURL = url;
            return this;
        }

        public InitEventBuilder SetServerURLs(string[] urls)
        {
            _event.serverURLs = urls;
            return this;
        }

        public InitEventBuilder SetAutoLogoutCallback(Action<string> callback)
        {
            _event.autoLogoutCallback = callback;
            return this;
        }

        public InitEventBuilder SetAIHelpInitType(AIHelpInitType aihelp)
        {
            _event.aihelp = aihelp;
            return this;
        }

        public InitEvent Build()
        {
            return _event;
        }
    }
    //************************//


    //***** 登录功能统一参数 *****//
    public class LoginEventBuilder
    {
        public class LoginEvent
        {
            public string loginType;
            public string token;
            public string extraParams;
        }

        public class PhoneCodeLogin : LoginEvent
        {
            public string phoneNumber;
            public string phoneCode;
            public VerifyCodeType verifyCodeType;
        }

        public class PhonePwdLogin : LoginEvent
        {
            public string phoneNumber;
            public string password;
            public string resetCode;
        }

        public class EmailCodeLogin : LoginEvent
        {
            public string emailNumber;
            public string emailCode;
            public VerifyCodeType verifyCodeType;
        }

        public class EmailPwdLogin : LoginEvent
        {
            public string emailNumber;
            public string password;
            public string resetCode;
        }

        public class YiDunLogin : LoginEvent
        {
            public YiDunEventBuilder.YiDunEvent yiDunEvent;
        }

        // Android 用户id + 密码登录，for版署包
        public class UidPwdLogin : LoginEvent
        {
            public string uid;
            public string password;
        }

        private LoginEvent _event;

        public LoginEventBuilder SetLoginType(string type)
        {
            if (type.Equals(SDKType.PHONE_CODE))
            {
                _event = new PhoneCodeLogin();
            }
            else if (type.Equals(SDKType.PHONE_PWD))
            {
                _event = new PhonePwdLogin();
            }
            else if (type.Equals(SDKType.EMAIL_CODE))
            {
                _event = new EmailCodeLogin();
            }
            else if (type.Equals(SDKType.EMAIL_PWD))
            {
                _event = new EmailPwdLogin();
            }
            else if (type.Equals(SDKType.YIDUN))
            {
                _event = new YiDunLogin();
            }
            else if (type.Equals(SDKType.UID_PWD))
            {
                _event = new UidPwdLogin();
            }
            else
            {
                _event = new LoginEvent();
            }
            _event.loginType = type;
            return this;
        }

        public LoginEventBuilder SetToken(string token)
        {
            SetLoginType("token");
            _event.token = token;
            return this;
        }

        public LoginEventBuilder SetExtraParams(string extraParams)
        {
            _event.extraParams = extraParams;
            return this;
        }

        public LoginEventBuilder SetPhoneNumber(string phone)
        {
            if (_event is PhoneCodeLogin phoneCodeLogin)
            {
                phoneCodeLogin.phoneNumber = phone;
            }
            else if (_event is PhonePwdLogin phonePwdLogin)
            {
                phonePwdLogin.phoneNumber = phone;
            }
            return this;
        }

        public LoginEventBuilder SetPhoneCode(string code)
        {
            (_event as PhoneCodeLogin).phoneCode = code;
            return this;
        }

        public LoginEventBuilder SetEmailNumber(string email)
        {
            if (_event is EmailCodeLogin emailCodeLogin)
            {
                emailCodeLogin.emailNumber = email;
            } else if (_event is EmailPwdLogin emailPwdLogin)
            {
                emailPwdLogin.emailNumber = email;
            }
            return this;
        }

        public LoginEventBuilder SetEmailCode(string code)
        {
            (_event as EmailCodeLogin).emailCode = code;
            return this;
        }

        public LoginEventBuilder SetResetCode(string resetCode)
        {
            if (_event is EmailPwdLogin emailPwdLogin)
            {
                emailPwdLogin.resetCode = resetCode;
            }
            else if (_event is PhonePwdLogin phonePwdLogin)
            {
                phonePwdLogin.resetCode = resetCode;
            }
            return this;
        }

        public LoginEventBuilder SetVerifyCodeType(VerifyCodeType verifyCodeType)
        {
            if (_event is EmailCodeLogin emailCodeLogin)
            {
                emailCodeLogin.verifyCodeType = verifyCodeType;
            } 
            else if (_event is PhoneCodeLogin phoneCodeLogin)
            {
                phoneCodeLogin.verifyCodeType = verifyCodeType;
            } 
            return this;
        }

        public LoginEventBuilder SetPhonePwd(string pwd)
        {
            (_event as PhonePwdLogin).password = pwd;
            return this;
        }

        public LoginEventBuilder SetEmailPwd(string pwd)
        {
            (_event as EmailPwdLogin).password = pwd;
            return this;
        }

        public LoginEventBuilder SetUidWithPwd(string uid,string pwd)
        {
            (_event as UidPwdLogin).uid = uid;
            (_event as UidPwdLogin).password = pwd;
            return this;
        }

        public LoginEventBuilder SetYiDunConfig(YiDunEventBuilder.YiDunEvent yiDunEvent)
        {
            (_event as YiDunLogin).yiDunEvent = yiDunEvent;
            return this;
        }

        public LoginEvent Build()
        {
            return _event;
        }
    }
    //************************//

    //***** 绑定功能统一参数 *****//
    public class BindEventBuilder
    {
        public class BindEvent
        {
            public string loginType;
            public string userId;
            public string token;
            public string phoneNumber;
        }

        public class EmailCodeBind : BindEvent
        {
            public string emailNumber;
            public string emailCode;
        }

        public class PhoneCodeBind : BindEvent
        {
            public string phoneCode;
        }

        private BindEvent _event;

        public BindEventBuilder SetLoginType(string type)
        {
            if (type.Equals(SDKType.EMAIL_CODE))
            {
                _event = new EmailCodeBind();
            }
            else if (type.Equals(SDKType.PHONE_CODE))
            {
                _event = new PhoneCodeBind();
            }
            else
            {
                _event = new BindEvent();
            }
            _event.loginType = type;
            return this;
        }

        public BindEventBuilder SetUserId(string userId)
        {
            _event.userId = userId;
            return this;
        }

        public BindEventBuilder SetToken(string token)
        {
            _event.token = token;
            return this;
        }

        public BindEventBuilder SetPhoneNumber(string phoneNember)
        {
            (_event as PhoneCodeBind).phoneNumber = phoneNember;
            return this;
        }

        public BindEventBuilder SetPhoneCode(string code)
        {
            (_event as PhoneCodeBind).phoneCode = code;
            return this;
        }

        public BindEventBuilder SetEmailNumber(string emailNumber)
        {
            (_event as EmailCodeBind).emailNumber = emailNumber;
            return this;
        }

        public BindEventBuilder SetEmailCode(string code)
        {
            (_event as EmailCodeBind).emailCode = code;
            return this;
        }

        public BindEvent Build()
        {
            return _event;
        }
    }
    //************************//

    //***** 支付功能统一参数 *****//
    public class PayEventBuilder
    {
        public class PayEvent
        {
            public string userId;
            public string productId;
            public string productName;
            public string productCount;
            public string chargeService;
            public string gameOrderId;
            public string serverAppInfo;
            public string gameId;
            public string productPrice;
            public string extraParams;

        }

        private PayEvent _event;

        public PayEventBuilder()
        {
            _event = new PayEvent();
        }

        public PayEventBuilder SetUserId(string userId)
        {
            _event.userId = userId;
            return this;
        }

        public PayEventBuilder SetProductId(string productId)
        {
            _event.productId = productId;
            return this;
        }

        public PayEventBuilder SetProductName(string productName)
        {
            _event.productName = productName;
            return this;
        }

        public PayEventBuilder SetProductCount(string productCount)
        {
            _event.productCount = productCount;
            return this;
        }

        public PayEventBuilder SetChargeService(string service)
        {
            _event.chargeService = service;
            return this;
        }

        public PayEventBuilder SetGameOrderId(string gameOrderId)
        {
            _event.gameOrderId = gameOrderId;
            return this;
        }

        public PayEventBuilder SetServerAppInfo(string serverAppInfo)
        {
            _event.serverAppInfo = serverAppInfo;
            return this;
        }

        public PayEventBuilder SetGameId(string gameId)
        {
            _event.gameId = gameId;
            return this;
        }

        public PayEventBuilder SetProductPrice(string productPrice)
        {
            _event.productPrice = productPrice;
            return this;
        }

        public PayEventBuilder SetExtraParams(string extraParams)
        {
            _event.extraParams = extraParams;
            return this;
        }

        public PayEvent Build()
        {
            return _event;
        }
    }
    //************************//

    //***** 上报统一参数 *****//
    public static class ReportProfileType
    {
        /**
        * 直接设置一个用户的 Profile，如果用户或者 Profile 的字段已存在，则覆盖，不存在则自动创建。
        **/
        public static string PROFILE_SET = "profile_set";

        /**
        * 与 profile_set 接口不同的是，如果用户或者 Profile 的字段已存在，则这条记录会被忽略而不会覆盖已有数据，如果 Profile 不存在则会自动创建。因此，profile_set_once 比较适用于为用户设置首次激活时间、首次注册时间等只在首次设置时有效的属性。
        **/
        public static string PROFILE_SET_ONCE = "profile_set_once";
        /**
        * 增加或减少一个用户的某个 Numeric 类型的 Profile，如果用户不存在则自动创建, Profile 不存在则默认为 0。
        **/
        public static string PROFILE_INCREMENT = "profile_increment";
        /**
        * 删除一个用户的整个 Profile。
        **/
        public static string PROFILE_DELETE = "profile_delete";
        /**
        * 将某个用户的某些属性值设置为空。另外，为了与其它接口保持一致，在提交的数据上，属性的值请设置为非 null 的任何值，例如 true。
        **/
        public static string PROFILE_UNSET = "profile_unset";
    }

    public static class ReportProfileSubjectType
    {
        public static string USERS = "users";
        public static string DEVICES = "devices";
        public static string ROLES = "roles";
    }

    public static class ReportEventType
    {
        public static string TRACK = "track";
        public static string GAME = "game";
        public static string COIN = "coin";
        public static string LOGIN = "login";
        public static string PAY = "pay";
        public static string PUSH = "push";
        public static string PROFILE = "profile";
        public static string PREFORMANCE = "preformance";
        public static string ADBOX = "adbox";
        public static string SDK = "sdk";
        public static string ABTEST = "abtest";
    }

    public class ReportEventBuilder
    {
        public class ReportEvent
        {
            public string typeName;
            public string eventName;
            public string profileType;
            public string profileSubjectType;
            public string profileSubjectPrimary;
            public Dictionary<string, string> reportEvent;

            public ReportEvent()
            {
                reportEvent = new Dictionary<string, string>();
            }
        }

        private ReportEvent _event;

        public ReportEventBuilder()
        {
            _event = new ReportEvent();
        }

        public ReportEventBuilder setTypeName(string typeName)
        {
            _event.typeName = typeName;
            return this;
        }

        public ReportEventBuilder setEventName(string eventName)
        {
            _event.eventName = eventName;
            return this;
        }

        public ReportEventBuilder setProfileType(string profileType)
        {
            _event.profileType = profileType;
            return this;
        }

        public ReportEventBuilder setProfileSubjectType(string profileSubjectType)
        {
            _event.profileSubjectType = profileSubjectType;
            return this;
        }
        public ReportEventBuilder setProfileSubjectPrimary(string profileSubjectPrimary)
        {
            _event.profileSubjectPrimary = profileSubjectPrimary;
            return this;
        }

        public ReportEventBuilder addReportEvent(string key, string value)
        {
            _event.reportEvent.Add(key, value);
            return this;
        }

        public ReportEvent Build()
        {
            return _event;
        }
    }
    //*************************************************************

    //***** 服务器返回语言统一参数 *****//
    public static class ServerLanguage
    {
        public const string zh_CN = "zh_CN";      // 中文简体
        public const string zh_TW = "zh_TW";      // 中文繁体
        public const string en_US = "en_US";      // 英语
        public const string ja_JP = "ja_JP";      // 日语
        public const string ko_KR = "ko_KR";      // 韩语(朝鲜语)
        public const string vi_VN = "vi_VN";      // 越南语
        public const string tl_PH = "tl_PH";      // 菲律宾语
        public const string ar = "ar";            // 阿拉伯语
        public const string nl_NL = "nl_NL";      // 荷兰语
        public const string fr_FR = "fr_FR";      // 法语
        public const string de_DE = "de_DE";      // 德语
        public const string it_IT = "it_IT";      // 意大利语
        public const string pt_PT = "pt_PT";      // 葡萄牙语
        public const string es_ES = "es_ES";      // 西班牙语
        public const string bn_BD = "bn_BD";      // 孟加拉语
        public const string hr_HR = "hr_HR";      // 克罗地亚语
        public const string cs_CZ = "cs_CZ";      // 捷克语
        public const string da_DK = "da_DK";      // 丹麦语
        public const string el_GR = "el_GR";      // 希腊语
        public const string hi_IN = "hi_IN";      // 印度语
        public const string hu_HU = "hu_HU";      // 匈牙利语
        public const string in_ID = "in_ID";      // 印度尼西亚语
        public const string ms_MY = "ms_MY";      // 马来语
        public const string fa_IR = "fa_IR";      // 波斯语
        public const string pl_PL = "pl_PL";      // 波兰语
        public const string ro_RO = "ro_RO";      // 罗马尼亚语
        public const string ru_RU = "ru_RU";      // 俄罗斯语
        public const string sr_RS = "sr_RS";      // 塞尔维亚语
        public const string sv_SE = "sv_SE";      // 瑞典语
        public const string th_TH = "th_TH";      // 泰语
        public const string tr_TR = "tr_TR";      // 土耳其语
        public const string fi_FI = "fi_FI";      // 芬兰语
        public const string af_ZA = "af_ZA";      // 南非语
        public const string km_KH = "km_KH";      // 柬埔寨语
    }
    //*************************************************************

    //***** 易盾统一参数 *****//
    public static class YiDunOrientation
    {

    }
    public class YiDunEventBuilder
    {
        public class YiDunEvent
        {
            public string type;
        }

        public class YiDunFaceDetect : YiDunEvent
        {
            public string faceTrackId;
            public string authMsgOne;
            public string authMsgTwo;
        }

        public class YiDunCaptcha : YiDunEvent
        {
            public string captchaTrackId;
            public string captchaId;
        }

        public class YiDunLoginConfig : YiDunEvent
        {
            public string orientation;
            public List<string> hideLogin;
            public Dictionary<string, string> privacy;

            public YiDunLoginConfig()
            {
                hideLogin = new List<string>();
                privacy = new Dictionary<string, string>();
            }
        }

        private YiDunEvent _event;

        public YiDunEventBuilder SetType(string type)
        {
            if (type.Equals("face"))
            {
                _event = new YiDunFaceDetect();
            }
            else if (type.Equals("captcha"))
            {
                _event = new YiDunCaptcha();
            }
            else if (type.Equals("login"))
            {
                _event = new YiDunLoginConfig();
            }
            _event.type = type;
            return this;
        }

        public YiDunEventBuilder SetFaceTrackId(string faceTrackId)
        {
            (_event as YiDunFaceDetect).faceTrackId = faceTrackId;
            return this;
        }

        public YiDunEventBuilder SetAuthMsgOne(string authMsgOne)
        {
            (_event as YiDunFaceDetect).authMsgOne = authMsgOne;
            return this;
        }

        public YiDunEventBuilder SetAuthMsgTwo(string authMsgTwo)
        {
            (_event as YiDunFaceDetect).authMsgTwo = authMsgTwo;
            return this;
        }

        public YiDunEventBuilder SetCaptchaTrackId(string captchaTrackId)
        {
            (_event as YiDunCaptcha).captchaTrackId = captchaTrackId;
            return this;
        }

        public YiDunEventBuilder SetCaptchaId(string captchaId)
        {
            (_event as YiDunCaptcha).captchaId = captchaId;
            return this;
        }

        public YiDunEventBuilder SetYiDunOrientation(string orientation)
        {
            (_event as YiDunLoginConfig).orientation = orientation;
            return this;
        }

        public YiDunEventBuilder AddHidenType(string loginType)
        {
            (_event as YiDunLoginConfig).hideLogin.Add(loginType);
            return this;
        }

        public YiDunEventBuilder SetPrivacy(Dictionary<string, string> privacy)
        {
            (_event as YiDunLoginConfig).privacy = privacy;
            return this;
        }

        public YiDunEvent Build()
        {
            return _event;
        }
    }
    //*************************************************************

    //***** 分享统一参数 *****//
    public static class ShareChannel
    {
        public static string WX = "wx";
        public static string FB = "fb";
        public static string MINI = "min";
    }

    public static class ShareType
    {
        public static string TEXT = "text";
        public static string LINK = "link";
        public static string IMAGE = "image";
        public static string VIDEO = "video";
        public static string MiniData = "miniData";
    }

    //public static class WXShareTarget
    //{
    //    public static string FRIEND = "friend";
    //    public static string GROUP = "group";
    //    public static string FAVOURITE = "favourite";
    //}

    public class Resource
    {
        public string type;
        /**
        * 附加参数
        * 1. 微信分享时，extra 中可以设置 target 参数，用于指定分享目标，可选值为 0 - 朋友圈 1 - 微信对话, 默认为 0
        * 
        */
        public Dictionary<string, string> extra;
    }

    public class TextResource : Resource
    {
        public TextResource()
        {
            type = ShareType.TEXT;
        }
    }

    public class LinkResource : Resource
    {
        public string url; //链接地址 必填 分享的页面URL / 视频URL
        public string title; //链接标题
        public string des; //链接描述
        public string picResPath; //链接缩略图图片
        public string picRes;   //缩略图资源ID
        public LinkResource()
        {
            type = ShareType.LINK;
        }
    }

    public class ImageResource : Resource
    {
        public string path; //图片路径 必填
        public string des; //图片描述
        public string title; //图片标题
        public ImageResource()
        {
            type = ShareType.IMAGE;
        }
    }

    // 小程序分享
    public class MiniDataResource : Resource
    {
        public string appId; //小程序appId 小程序原始id
        public string miniPath; //小程序路径
        public string miniProgramType; //小程序类型  正式版:0，测试版:1，体验版:2
        public string title;
        public string desc;
        public string picResPath; //缩略图路径
        public MiniDataResource()
        {
            type = ShareType.MiniData;
        }
    }

    public class VideoResource : Resource
    {

    }

    public class MediaResource : Resource
    {
        public string sharePoint;
        public string sharePointId;
        public string shareSchemeId;
        public string title;
        public string desc;
        public string path;
        public string content;
        public string bgImgUrl;
        public string scImgUrl;
        public string imageUrl;
        public string extraParams;
        // 微信动态分享信息
        public string activityData;
        // 抖音分享
        public string shareTemplateId;
        public string shareTopic;
        public string videoContent;
        public string videoShareTemplateId;
        public string shareDefaultBgm;
        public string shareCutTemplateId;
        public string shareVideoPath;
        public bool useDefault;
    }

    public class ShareEventBuilder
    {
        public class ShareEvent
        {
            public string channel;
            public Resource resource;
        }

        //public class WXShareType : ShareEvent
        //{
        //    public string target;
        //}

        //public class FBShareType : ShareEvent
        //{

        //}

        //public class MINIShareType : ShareEvent
        //{

        //}

        private ShareEvent _event;

        public ShareEventBuilder()
        {
            _event = new ShareEvent();
        }

        public ShareEventBuilder SetChannel(string channel)
        {
            //if (channel.Equals(ShareChannel.WX))
            //{
            //    _event = new WXShareType();
            //} else if (channel.Equals(ShareChannel.FB))
            //{
            //    _event = new FBShareType();
            //} else
            //{
            //    _event = new MINIShareType();
            //}
            _event.channel = channel;
            return this;
        }

        //public ShareEventBuilder SetType(string type)
        //{
        //    if (type.Equals(ShareType.TEXT))
        //    {
        //        _event.resource = new TextResource();
        //    } else if(type.Equals(ShareType.LINK))
        //    {
        //        _event.resource = new LinkResource();
        //    } else if (type.Equals(ShareType.IMAGE))
        //    {
        //        _event.resource = new ImageResource();
        //    } else if (type.Equals(ShareType.LINK))
        //    {
        //        _event.resource = new LinkResource();
        //    }
        //    _event.type = type;
        //    return this;
        //}

        public ShareEventBuilder SetResource(Resource resource)
        {
            _event.resource = resource;
            return this;
        }

        public ShareEvent Build()
        {
            return _event;
        }
    }
    //*************************************************************

    //***** 抖音归因统一参数 *****//
    public class DYTrackEventBuilder
    {
        public class DYTrackEvent
        {
            public string userId;
            public string extraJson;
            public string indieToken;
            public string loginToken;
            public string appId;
        }

        private DYTrackEvent _event;

        public DYTrackEventBuilder()
        {
            _event = new DYTrackEvent();
        }

        public DYTrackEventBuilder SetUserId(string userId)
        {
            _event.userId = userId;
            return this;
        }

        public DYTrackEventBuilder SetExtraJson(string extraJson)
        {
            _event.extraJson = extraJson;
            return this;
        }

        public DYTrackEventBuilder SetIndieToken(string indieToken)
        {
            _event.indieToken = indieToken;
            return this;
        }

        public DYTrackEventBuilder SetLoginToken(string loginToken)
        {
            _event.loginToken = loginToken;
            return this;
        }

        public DYTrackEventBuilder SetAppId(string appId)
        {
            _event.appId = appId;
            return this;
        }

        public DYTrackEvent Build()
        {
            return _event;
        }
    }
    //*************************************************************

    //********************** 配置参数 **********************//
    public class ConfigEventBuilder
    {
        public class ConfigEvent
        {
            public string channelType;
            public Dictionary<string, object> configContent;
        }

        private ConfigEvent _event;

        public ConfigEventBuilder()
        {
            _event = new ConfigEvent();
        }

        public ConfigEventBuilder SetChannelType(string channelType)
        {
            _event.channelType = channelType;
            return this;
        }

        public ConfigEventBuilder SetConfigContent(Dictionary<string, object> configContent)
        {
            _event.configContent = configContent;
            return this;
        }

        public ConfigEvent Build()
        {
            return _event;
        }
    }
    //*************************************************************

    //***** 微信小游戏-广点通归因事件上报参数 *****//
    public class TxAdSDKReportEventBuilder
    {
        public class TxAdSDKReportEvent
        {
            public string actionType;
            public string actionParams;
        }

        private TxAdSDKReportEvent _event;

        public TxAdSDKReportEventBuilder()
        {
            _event = new TxAdSDKReportEvent();
        }

        public TxAdSDKReportEventBuilder setAction(string actionType)
        {
            _event.actionType = actionType;
            return this;
        }

        public TxAdSDKReportEventBuilder setExtraParams(string actionParams)
        {
            _event.actionParams = actionParams;
            return this;
        }

        public TxAdSDKReportEvent Build()
        {
            return _event;
        }
    }

    //*************************************

    //***** 微信小游戏设置用户信息 *****//
    public class SetWxUserInfoEventBuilder
    {
        public class SetWxUserInfoEvent
        {
            public WxUserInfo wxUserInfo;
        }

        private SetWxUserInfoEvent _event;

        public SetWxUserInfoEventBuilder()
        {
            _event = new SetWxUserInfoEvent();
        }

        public SetWxUserInfoEventBuilder setWxUserInfo(WxUserInfo wxUserInfo)
        {
            _event.wxUserInfo = wxUserInfo;
            return this;
        }

        public SetWxUserInfoEvent Build()
        {
            return _event;
        }

    }

    public class WxUserInfo
    {

    }

    public class SetWxUserInfo : WxUserInfo
    {
        public string province;
        public string nickName;
        public string avatarUrl;
        public string gender;
        public string city;
        public string country;
        public string language;
    }

    public class SetWxEncData : WxUserInfo
    {
        public string encryptedData;
        public string iv;
        public string setattr;
    }

    public class SetThreeWxEncData : WxUserInfo
    {
        public string wxOpenId;
        public string unionId;
        public string session_key;
    }

    //*************************************

    //***** 微信小游戏调起用户确认收款页面 *****//
    public class MchTransferBuilder
    {
        public class  MchTransferEvent
        {
            public string mch_id;
            public string package_info;
            public string game_order_id;
        }

        private MchTransferEvent _event;

        public MchTransferBuilder()
        {
            _event = new MchTransferEvent();
        }

        public MchTransferBuilder SetMchId(string mchId)
        {
            _event.mch_id = mchId;
            return this;
        }

        public MchTransferBuilder SetPackageInfo(string packageInfo)
        {
            _event.package_info = packageInfo;
            return this;
        }

        public MchTransferBuilder SetGameOrderId(string gameOrderId)
        {
            _event.game_order_id = gameOrderId;
            return this;
        }

        public MchTransferEvent Build()
        {
            return _event;
        }

    }
    //*************************************

}