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

namespace Topsdk.Top.Ability414.Request;

public class TaobaoTbkOrderDetailsGetRequest : AbstractTopApiRequest
{

    /*
        查询时间类型，1：按照订单淘客创建时间查询，2:按照订单淘客付款时间查询，3:按照订单淘客结算时间查询，4:按照订单更新时间；
         默认值:1    */
    private long? queryType;


    /*
        位点，除第一页之外，都需要传递；前端原样返回。
            */
    private string? positionIndex;


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


    /*
        推广者角色类型,2:二方，3:三方，不传，表示所有角色
            */
    private long? memberType;


    /*
        淘客订单状态，11-拍下未付款，12-付款，13-关闭，14-确认收货，3-结算成功;不传，表示所有状态
            */
    private long? tkStatus;


    /*
        订单查询结束时间，订单开始时间至订单结束时间，中间时间段日常要求不超过3个小时，但如618、双11、年货节等大促期间预估时间段不可超过20分钟，超过会提示错误，调用时请务必注意时间段的选择，以保证亲能正常调用！
            */
    private string? endTime;


    /*
        订单查询开始时间
            */
    private string? startTime;


    /*
        跳转类型，当向前或者向后翻页必须提供,-1: 向前翻页,1：向后翻页
         默认值:1    */
    private long? jumpType;


    /*
        第几页，默认1，1~100
         默认值:1    */
    private long? pageNo;


    /*
        筛选订单类型，1:所有订单，2:渠道订单，3:会员运营订单，默认为1
         默认值:1    */
    private long? orderScene;


    [JsonPropertyName("query_type")]
    public long? QueryType
    {
        get => queryType;
        set => this.queryType = value;
    }

    [JsonPropertyName("position_index")]
    public string? PositionIndex
    {
        get => positionIndex;
        set => this.positionIndex = value;
    }

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

    [JsonPropertyName("member_type")]
    public long? MemberType
    {
        get => memberType;
        set => this.memberType = value;
    }

    [JsonPropertyName("tk_status")]
    public long? TkStatus
    {
        get => tkStatus;
        set => this.tkStatus = value;
    }

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

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

    [JsonPropertyName("jump_type")]
    public long? JumpType
    {
        get => jumpType;
        set => this.jumpType = value;
    }

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

    [JsonPropertyName("order_scene")]
    public long? OrderScene
    {
        get => orderScene;
        set => this.orderScene = value;
    }



    public override IDictionary<string, string> ToRequestParam()
    {
        IDictionary<string, string> requestParam = new Dictionary<string, string>();
        if(this.queryType != null)
        {
            requestParam.Add("query_type",TopUtils.ConvertBasicType(this.queryType));
        }
        if(this.positionIndex != null)
        {
            requestParam.Add("position_index",TopUtils.ConvertBasicType(this.positionIndex));
        }
        if(this.pageSize != null)
        {
            requestParam.Add("page_size",TopUtils.ConvertBasicType(this.pageSize));
        }
        if(this.memberType != null)
        {
            requestParam.Add("member_type",TopUtils.ConvertBasicType(this.memberType));
        }
        if(this.tkStatus != null)
        {
            requestParam.Add("tk_status",TopUtils.ConvertBasicType(this.tkStatus));
        }
        if(this.endTime != null)
        {
            requestParam.Add("end_time",TopUtils.ConvertBasicType(this.endTime));
        }
        if(this.startTime != null)
        {
            requestParam.Add("start_time",TopUtils.ConvertBasicType(this.startTime));
        }
        if(this.jumpType != null)
        {
            requestParam.Add("jump_type",TopUtils.ConvertBasicType(this.jumpType));
        }
        if(this.pageNo != null)
        {
            requestParam.Add("page_no",TopUtils.ConvertBasicType(this.pageNo));
        }
        if(this.orderScene != null)
        {
            requestParam.Add("order_scene",TopUtils.ConvertBasicType(this.orderScene));
        }
        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.order.details.get";
    }

}

