package superm_product_batchApplyStoreProductPrice_request

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

type SupermProductBatchApplyStoreProductPriceRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermProductBatchApplyStoreProductPriceParam
}

func (c *SupermProductBatchApplyStoreProductPriceRequest) GetUrlPath() string {
	return "/superm/product/batchApplyStoreProductPrice"
}

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

}

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

}

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

func (c *SupermProductBatchApplyStoreProductPriceRequest) GetParams() *SupermProductBatchApplyStoreProductPriceParam {
	return c.Param
}

type TaskParams struct {
	// 店铺主商品ID
	MainProductId int64 `json:"main_product_id"`
}
type SupermProductBatchApplyStoreProductPriceParam struct {
	// 异步任务参数
	TaskParams *TaskParams `json:"task_params"`
}
