package trade_batchGetTradeLimitTemplateList_request

import (
	"encoding/json"
	trade_batchGetTradeLimitTemplateList_response "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/api/trade_batchGetTradeLimitTemplateList/response"
	doudian_sdk "git.rosy.net.cn/baseapi/platformapi/tiktok_shop/sdk-golang/core"
)

type TradeBatchGetTradeLimitTemplateListRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *TradeBatchGetTradeLimitTemplateListParam
}

func (c *TradeBatchGetTradeLimitTemplateListRequest) GetUrlPath() string {
	return "/trade/batchGetTradeLimitTemplateList"
}

func New() *TradeBatchGetTradeLimitTemplateListRequest {
	request := &TradeBatchGetTradeLimitTemplateListRequest{
		Param: &TradeBatchGetTradeLimitTemplateListParam{},
	}
	request.SetConfig(doudian_sdk.GlobalConfig)
	request.SetClient(doudian_sdk.DefaultDoudianOpApiClient)
	return request

}

func (c *TradeBatchGetTradeLimitTemplateListRequest) Execute(accessToken *doudian_sdk.AccessToken) (*trade_batchGetTradeLimitTemplateList_response.TradeBatchGetTradeLimitTemplateListResponse, error) {
	responseJson, err := c.GetClient().Request(c, accessToken)
	if err != nil {
		return nil, err
	}
	response := &trade_batchGetTradeLimitTemplateList_response.TradeBatchGetTradeLimitTemplateListResponse{}
	_ = json.Unmarshal([]byte(responseJson), response)
	return response, nil

}

func (c *TradeBatchGetTradeLimitTemplateListRequest) GetParamObject() interface{} {
	return c.Param
}

func (c *TradeBatchGetTradeLimitTemplateListRequest) GetParams() *TradeBatchGetTradeLimitTemplateListParam {
	return c.Param
}

type TradeBatchGetTradeLimitTemplateListParam struct {
	// 限购模板ID列表
	TradeLimitTemplateIdList *[]int64 `json:"trade_limit_template_id_list,omitempty"`
}
