using System.Text.Json.Serialization;
using System.Collections.Generic;
using Topsdk.Util;

namespace Topsdk.Top.Ability1826.Request;

public class TaobaoTbkDgVegasTljCreateRequest : AbstractTopApiRequest
{

    /*
        妈妈广告位Id
            */
    private long? adzoneId;


    /*
        必须传入0
            */
    private long? securityLevel;


    /*
        使用开始日期。相对时间，无需填写，以用户领取时间作为使用开始时间。绝对时间，格式 yyyy-MM-dd，例如，2019-01-29，表示从2019-01-29 00:00:00 开始,格式 yyyy-MM-dd HH:mm:ss，例如，2019-01-29 20:00:10，表示从2019-01-2920:00:10 开始
            */
    private string? useStartTime;


    /*
        结束日期的模式,1:相对时间，2:绝对时间
            */
    private long? useEndTimeMode;


    /*
        使用结束日期。如果是结束时间模式为相对时间，时间格式为1-7直接的整数, 例如，1（相对领取时间1天）； 如果是绝对时间，格式为yyyy-MM-dd，例如，2019-01-29，表示到2019-01-29 23:59:59结束,格式 yyyy-MM-dd HH:mm:ss，例如，2019-01-29 20:00:10，表示从2019-01-29 20:00:10 开始
            */
    private string? useEndTime;


    /*
        发放截止时间
            */
    private DateTime? sendEndTime;


    /*
        发放开始时间
            */
    private DateTime? sendStartTime;


    /*
        单个淘礼金面额，支持两位小数，单位元
            */
    private string? perFace;


    /*
        必须设置为true，默认开启安全
            */
    private bool? securitySwitch;


    /*
        单用户累计中奖次数上限
            */
    private long? userTotalWinNumLimit;


    /*
        淘礼金名称，最大10个字符
            */
    private string? name;


    /*
        淘礼金总个数
            */
    private long? totalNum;


    /*
        宝贝ID或营销ID
            */
    private string? itemId;


    /*
        已下线，后续不需要填写
            */
    private string? campaignType;


    /*
        淘礼金使用门槛，实付款大于等于门槛面额时才可使用此淘礼金；门槛值不能小于淘礼金面额
            */
    private string? useThreshold;


    /*
        淘礼金皮肤模版ID，1、日常模板（长期可用） 2、弹窗模板（长期可用） 3、近期大促活动模版
            */
    private string? awardImgTemplateId;


    [JsonPropertyName("adzone_id")]
    public long? AdzoneId
    {
        get => adzoneId;
        set => this.adzoneId = value;
    }

    [JsonPropertyName("security_level")]
    public long? SecurityLevel
    {
        get => securityLevel;
        set => this.securityLevel = value;
    }

    [JsonPropertyName("use_start_time")]
    public string? UseStartTime
    {
        get => useStartTime;
        set => this.useStartTime = value;
    }

    [JsonPropertyName("use_end_time_mode")]
    public long? UseEndTimeMode
    {
        get => useEndTimeMode;
        set => this.useEndTimeMode = value;
    }

    [JsonPropertyName("use_end_time")]
    public string? UseEndTime
    {
        get => useEndTime;
        set => this.useEndTime = value;
    }

    [JsonPropertyName("send_end_time")]
    public DateTime? SendEndTime
    {
        get => sendEndTime;
        set => this.sendEndTime = value;
    }

    [JsonPropertyName("send_start_time")]
    public DateTime? SendStartTime
    {
        get => sendStartTime;
        set => this.sendStartTime = value;
    }

    [JsonPropertyName("per_face")]
    public string? PerFace
    {
        get => perFace;
        set => this.perFace = value;
    }

    [JsonPropertyName("security_switch")]
    public bool? SecuritySwitch
    {
        get => securitySwitch;
        set => this.securitySwitch = value;
    }

    [JsonPropertyName("user_total_win_num_limit")]
    public long? UserTotalWinNumLimit
    {
        get => userTotalWinNumLimit;
        set => this.userTotalWinNumLimit = value;
    }

    [JsonPropertyName("name")]
    public string? Name
    {
        get => name;
        set => this.name = value;
    }

    [JsonPropertyName("total_num")]
    public long? TotalNum
    {
        get => totalNum;
        set => this.totalNum = value;
    }

    [JsonPropertyName("item_id")]
    public string? ItemId
    {
        get => itemId;
        set => this.itemId = value;
    }

    [JsonPropertyName("campaign_type")]
    public string? CampaignType
    {
        get => campaignType;
        set => this.campaignType = value;
    }

    [JsonPropertyName("use_threshold")]
    public string? UseThreshold
    {
        get => useThreshold;
        set => this.useThreshold = value;
    }

    [JsonPropertyName("award_img_template_id")]
    public string? AwardImgTemplateId
    {
        get => awardImgTemplateId;
        set => this.awardImgTemplateId = value;
    }



    public override IDictionary<string, string> ToRequestParam()
    {
        IDictionary<string, string> requestParam = new Dictionary<string, string>();
        if(this.adzoneId != null)
        {
            requestParam.Add("adzone_id",TopUtils.ConvertBasicType(this.adzoneId));
        }
        if(this.securityLevel != null)
        {
            requestParam.Add("security_level",TopUtils.ConvertBasicType(this.securityLevel));
        }
        if(this.useStartTime != null)
        {
            requestParam.Add("use_start_time",TopUtils.ConvertBasicType(this.useStartTime));
        }
        if(this.useEndTimeMode != null)
        {
            requestParam.Add("use_end_time_mode",TopUtils.ConvertBasicType(this.useEndTimeMode));
        }
        if(this.useEndTime != null)
        {
            requestParam.Add("use_end_time",TopUtils.ConvertBasicType(this.useEndTime));
        }
        if(this.sendEndTime != null)
        {
            requestParam.Add("send_end_time",TopUtils.ConvertBasicType(this.sendEndTime));
        }
        if(this.sendStartTime != null)
        {
            requestParam.Add("send_start_time",TopUtils.ConvertBasicType(this.sendStartTime));
        }
        if(this.perFace != null)
        {
            requestParam.Add("per_face",TopUtils.ConvertBasicType(this.perFace));
        }
        if(this.securitySwitch != null)
        {
            requestParam.Add("security_switch",TopUtils.ConvertBasicType(this.securitySwitch));
        }
        if(this.userTotalWinNumLimit != null)
        {
            requestParam.Add("user_total_win_num_limit",TopUtils.ConvertBasicType(this.userTotalWinNumLimit));
        }
        if(this.name != null)
        {
            requestParam.Add("name",TopUtils.ConvertBasicType(this.name));
        }
        if(this.totalNum != null)
        {
            requestParam.Add("total_num",TopUtils.ConvertBasicType(this.totalNum));
        }
        if(this.itemId != null)
        {
            requestParam.Add("item_id",TopUtils.ConvertBasicType(this.itemId));
        }
        if(this.campaignType != null)
        {
            requestParam.Add("campaign_type",TopUtils.ConvertBasicType(this.campaignType));
        }
        if(this.useThreshold != null)
        {
            requestParam.Add("use_threshold",TopUtils.ConvertBasicType(this.useThreshold));
        }
        if(this.awardImgTemplateId != null)
        {
            requestParam.Add("award_img_template_id",TopUtils.ConvertBasicType(this.awardImgTemplateId));
        }
        return requestParam;
    }

    public override IDictionary<string, TopFileItem> ToFileParam()
    {
        IDictionary<string, TopFileItem> fileParam = new Dictionary<string, TopFileItem>();
        return fileParam;
    }

    public override string GetApiCode()
    {
        return "taobao.tbk.dg.vegas.tlj.create";
    }

}

