package shop_setStorePackageFee_request

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

type ShopSetStorePackageFeeRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *ShopSetStorePackageFeeParam
}

func (c *ShopSetStorePackageFeeRequest) GetUrlPath() string {
	return "/shop/setStorePackageFee"
}

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

}

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

}

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

func (c *ShopSetStorePackageFeeRequest) GetParams() *ShopSetStorePackageFeeParam {
	return c.Param
}

type ShopSetStorePackageFeeParam struct {
	// 门店id
	StoreId int64 `json:"store_id"`
	// 打包费，单位分 0~200
	PackageFee int64 `json:"package_fee"`
}
