package superm_getPlatformPickUpEstimatedCharge_request

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

type SupermGetPlatformPickUpEstimatedChargeRequest struct {
	doudian_sdk.BaseDoudianOpApiRequest
	Param *SupermGetPlatformPickUpEstimatedChargeParam
}

func (c *SupermGetPlatformPickUpEstimatedChargeRequest) GetUrlPath() string {
	return "/superm/getPlatformPickUpEstimatedCharge"
}

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

}

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

}

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

func (c *SupermGetPlatformPickUpEstimatedChargeRequest) GetParams() *SupermGetPlatformPickUpEstimatedChargeParam {
	return c.Param
}

type SupermGetPlatformPickUpEstimatedChargeParam struct {
	AfterSaleID int64 `json:"afterSaleID"` //售后单ID
	//SelectedCalendarPeriod *CalendarPeriod `json:"selectedCalendarPeriod"` //选择的时间段
	InquiryType int32 `json:"inquiryType"` //1配送 2取消 默认配送
}
type CalendarPeriod struct {
	TimeBeginTs int64 `json:"timeBeginTs"`
	TimeEndTs   int64 `json:"timeEndTs"`
}
