package superm_createVirtualMobile_request

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

type SupermCreateVirtualMobileRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermOrderDispatcherParam
}

func (c *SupermCreateVirtualMobileRequest) GetUrlPath() string {
	return "/superm/createVirtualMobile"
}

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

}

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

}

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

func (c *SupermCreateVirtualMobileRequest) GetParams() *SupermOrderDispatcherParam {
	return c.Param
}

type SupermOrderDispatcherParam struct {
	ShopOrderID int64 `json:"shopOrderID"` //店铺父订单号
}
