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

namespace Topsdk.Top.Ability2138.Request;

public class TaobaoTbkDgNewuserOrderGetRequest : AbstractTopApiRequest
{

    /*
        页大小，默认20，1~100
         默认值:20    */
    private long? pageSize;


    /*
        页码，默认1
         默认值:1    */
    private long? pageNo;


    /*
        mm_xxx_xxx_xxx的第三位
            */
    private long? adzoneId;


    /*
        开始时间，当活动为淘宝活动，表示最早注册时间；当活动为支付宝活动，表示最早绑定时间；当活动为天猫活动，表示最早领取红包时间
            */
    private DateTime? startTime;


    /*
        结束时间，当活动为淘宝活动，表示最晚结束时间；当活动为支付宝活动，表示最晚绑定时间；当活动为天猫活动，表示最晚领取红包的时间
            */
    private DateTime? endTime;


    /*
        活动id， 活动名称与活动ID列表（该字段已废弃）
            */
    private string? activityId;


    [JsonPropertyName("page_size")]
    public long? PageSize
    {
        get => pageSize;
        set => this.pageSize = value;
    }

    [JsonPropertyName("page_no")]
    public long? PageNo
    {
        get => pageNo;
        set => this.pageNo = value;
    }

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

    [JsonPropertyName("start_time")]
    public DateTime? StartTime
    {
        get => startTime;
        set => this.startTime = value;
    }

    [JsonPropertyName("end_time")]
    public DateTime? EndTime
    {
        get => endTime;
        set => this.endTime = value;
    }

    [JsonPropertyName("activity_id")]
    public string? ActivityId
    {
        get => activityId;
        set => this.activityId = value;
    }



    public override IDictionary<string, string> ToRequestParam()
    {
        IDictionary<string, string> requestParam = new Dictionary<string, string>();
        if(this.pageSize != null)
        {
            requestParam.Add("page_size",TopUtils.ConvertBasicType(this.pageSize));
        }
        if(this.pageNo != null)
        {
            requestParam.Add("page_no",TopUtils.ConvertBasicType(this.pageNo));
        }
        if(this.adzoneId != null)
        {
            requestParam.Add("adzone_id",TopUtils.ConvertBasicType(this.adzoneId));
        }
        if(this.startTime != null)
        {
            requestParam.Add("start_time",TopUtils.ConvertBasicType(this.startTime));
        }
        if(this.endTime != null)
        {
            requestParam.Add("end_time",TopUtils.ConvertBasicType(this.endTime));
        }
        if(this.activityId != null)
        {
            requestParam.Add("activity_id",TopUtils.ConvertBasicType(this.activityId));
        }
        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.newuser.order.get";
    }

}

