//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 AssociateEIPWithShareBandwidth

package unet

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

// AssociateEIPWithShareBandwidthRequest is request schema for AssociateEIPWithShareBandwidth action
type AssociateEIPWithShareBandwidthRequest struct {
	request.CommonBase

	// [公共参数] 地域。
	// Region *string `required:"true"`

	// [公共参数] 项目ID。不填写为默认项目，子帐号必须填写。
	// ProjectId *string `required:"false"`

	// 要加入共享带宽的EIP的资源Id
	EIPIds []string `required:"true"`

	// 共享带宽ID
	ShareBandwidthId *string `required:"true"`
}

// AssociateEIPWithShareBandwidthResponse is response schema for AssociateEIPWithShareBandwidth action
type AssociateEIPWithShareBandwidthResponse struct {
	response.CommonBase
}

// NewAssociateEIPWithShareBandwidthRequest will create request of AssociateEIPWithShareBandwidth action.
func (c *UNetClient) NewAssociateEIPWithShareBandwidthRequest() *AssociateEIPWithShareBandwidthRequest {
	req := &AssociateEIPWithShareBandwidthRequest{}

	// 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
}

// AssociateEIPWithShareBandwidth - 将EIP加入共享带宽
func (c *UNetClient) AssociateEIPWithShareBandwidth(req *AssociateEIPWithShareBandwidthRequest) (*AssociateEIPWithShareBandwidthResponse, error) {
	var err error
	var res AssociateEIPWithShareBandwidthResponse

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

	return &res, nil
}
