package superm_cancelPlatformPickUp_request

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

type SupermCancelPlatformPickUpRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermCancelPlatformPickUpParam
}

func (c *SupermCancelPlatformPickUpRequest) GetUrlPath() string {
	return "/superm/cancelPlatformPickUp"
}

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

}

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

}

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

func (c *SupermCancelPlatformPickUpRequest) GetParams() *SupermCancelPlatformPickUpParam {
	return c.Param
}

type SupermCancelPlatformPickUpParam struct {
	AfterSaleID int64 `json:"afterSaleID"` //售后单ID
	//CancelReason string `json:"cancelReason"` //取消原因
}
