package superm_getDispatcherInfo_request

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

type SupermGetDispatcherInfoRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermGetDispatcherInfoParam
}

func (c *SupermGetDispatcherInfoRequest) GetUrlPath() string {
	return "/superm/getDispatcherInfo"
}

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

}

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

}

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

func (c *SupermGetDispatcherInfoRequest) GetParams() *SupermGetDispatcherInfoParam {
	return c.Param
}

type SupermGetDispatcherInfoParam struct {
	StoreID           int64  `json:"store_id"`
	ShopOrderID       string `json:"shop_order_id"`
	DispatcherFeeType int32  `json:"dispatcher_fee_type"`
}
