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

namespace Topsdk.Top.Ability304.Request;

public class TaobaoTopAuthTokenCreateRequest : AbstractTopApiRequest
{

    /*
        授权code，grantType==authorization_code 时需要
            */
    private string? code;


    /*
        非必填，与生成code的uuid配对，使用方式参考文档
            */
    private string? uuid;


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

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



    public override IDictionary<string, string> ToRequestParam()
    {
        IDictionary<string, string> requestParam = new Dictionary<string, string>();
        if(this.code != null)
        {
            requestParam.Add("code",TopUtils.ConvertBasicType(this.code));
        }
        if(this.uuid != null)
        {
            requestParam.Add("uuid",TopUtils.ConvertBasicType(this.uuid));
        }
        return requestParam;
    }

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

    public override string GetApiCode()
    {
        return "taobao.top.auth.token.create";
    }

}

