package superm_getShipmentInfo_request

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

type SupermGetShipmentInfoRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermGetShipmentInfoParam
}

func (c *SupermGetShipmentInfoRequest) GetUrlPath() string {
	return "/superm/getShipmentInfo"
}

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

}

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

}

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

func (c *SupermGetShipmentInfoRequest) GetParams() *SupermGetShipmentInfoParam {
	return c.Param
}

type SupermGetShipmentInfoParam struct {
	ShopOrderID int64 `json:"shop_order_id"` //店铺父订单号
	//AfterSaleID  int64 `json:"aftersale_id"`  //售后单号
	ShipmentType int64 `json:"shipment_type"` //履约类型
}
