//Code is generated by ucloud code generator, don't modify it by hand, it will cause undefined behaviors.
//go:generate ucloud-gen-go-api UNet DescribeBandwidthPackage

package unet

import (
	"github.com/ucloud/ucloud-sdk-go/ucloud/request"
	"github.com/ucloud/ucloud-sdk-go/ucloud/response"
)

// DescribeBandwidthPackageRequest is request schema for DescribeBandwidthPackage action
type DescribeBandwidthPackageRequest struct {
	request.CommonBase

	// [公共参数] 地域。 参见 [地域和可用区列表](../summary/regionlist.html)
	// Region *string `required:"true"`

	// [公共参数] 项目ID。不填写为默认项目，子帐号必须填写。 请参考[GetProjectList接口](../summary/get_project_list.html)
	// ProjectId *string `required:"false"`

	// 返回数据分页值, 取值范围为 [0,10000000] 之间的整数, 默认为20
	Limit *int `required:"false"`

	// 返回数据偏移量, 默认为0
	Offset *int `required:"false"`
}

// DescribeBandwidthPackageResponse is response schema for DescribeBandwidthPackage action
type DescribeBandwidthPackageResponse struct {
	response.CommonBase

	// 满足条件的带宽包总数
	TotalCount int

	// 带宽包详细信息, 参见 UnetBandwidthPackageSet
	DataSets []UnetBandwidthPackageSet
}

// NewDescribeBandwidthPackageRequest will create request of DescribeBandwidthPackage action.
func (c *UNetClient) NewDescribeBandwidthPackageRequest() *DescribeBandwidthPackageRequest {
	req := &DescribeBandwidthPackageRequest{}

	// setup request with client config
	c.Client.SetupRequest(req)

	// setup retryable with default retry policy (retry for non-create action and common error)
	req.SetRetryable(true)
	return req
}

// DescribeBandwidthPackage - 获取某地域下的带宽包信息
func (c *UNetClient) DescribeBandwidthPackage(req *DescribeBandwidthPackageRequest) (*DescribeBandwidthPackageResponse, error) {
	var err error
	var res DescribeBandwidthPackageResponse

	err = c.Client.InvokeAction("DescribeBandwidthPackage", req, &res)
	if err != nil {
		return &res, err
	}

	return &res, nil
}
