package shop_getStorePackageFee_request

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

type ShopGetStorePackageFeeRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *ShopGetStorePackageFeeParam
}

func (c *ShopGetStorePackageFeeRequest) GetUrlPath() string {
	return "/shop/getStorePackageFee"
}

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

}

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

}

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

func (c *ShopGetStorePackageFeeRequest) GetParams() *ShopGetStorePackageFeeParam {
	return c.Param
}

type ShopGetStorePackageFeeParam struct {
	// 门店id
	StoreId int64 `json:"store_id"`
}
