package shop_getStoreSaleLimit_request

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

type ShopGetStoreSaleLimitRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *ShopGetStoreSaleLimitParam
}

func (c *ShopGetStoreSaleLimitRequest) GetUrlPath() string {
	return "/shop/getStoreSaleLimit"
}

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

}

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

}

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

func (c *ShopGetStoreSaleLimitRequest) GetParams() *ShopGetStoreSaleLimitParam {
	return c.Param
}

type ShopGetStoreSaleLimitParam struct {
	// 门店ID
	StoreId int64 `json:"store_id"`
}
