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

namespace Topsdk.Top.Ability304.Request;

public class TaobaoTopAuthTokenRefreshRequest : AbstractTopApiRequest
{

    /*
        grantType==refresh_token 时需要
            */
    private string? refreshToken;


    [JsonPropertyName("refresh_token")]
    public string? RefreshToken
    {
        get => refreshToken;
        set => this.refreshToken = value;
    }



    public override IDictionary<string, string> ToRequestParam()
    {
        IDictionary<string, string> requestParam = new Dictionary<string, string>();
        if(this.refreshToken != null)
        {
            requestParam.Add("refresh_token",TopUtils.ConvertBasicType(this.refreshToken));
        }
        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.refresh";
    }

}

