package instantShopping_getDeliveryListByOrderId_request

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

type InstantShoppingGetDeliveryListByOrderIdRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *InstantShoppingGetDeliveryListByOrderIdParam
}

func (c *InstantShoppingGetDeliveryListByOrderIdRequest) GetUrlPath() string {
	return "/instantShopping/getDeliveryListByOrderId"
}

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

}

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

}

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

func (c *InstantShoppingGetDeliveryListByOrderIdRequest) GetParams() *InstantShoppingGetDeliveryListByOrderIdParam {
	return c.Param
}

type InstantShoppingGetDeliveryListByOrderIdParam struct {
	// 抖音电商shop order单id
	ShopOrderId string `json:"shop_order_id"`
}
