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

package unet

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

// GetEIPPayModeRequest is request schema for GetEIPPayMode action
type GetEIPPayModeRequest struct {
	request.CommonBase

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

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

	// 弹性IP的资源Id
	EIPId []string `required:"true"`
}

// GetEIPPayModeResponse is response schema for GetEIPPayMode action
type GetEIPPayModeResponse struct {
	response.CommonBase

	// EIP的计费模式, 参见 EIPPayModeSet
	EIPPayMode []EIPPayModeSet
}

// NewGetEIPPayModeRequest will create request of GetEIPPayMode action.
func (c *UNetClient) NewGetEIPPayModeRequest() *GetEIPPayModeRequest {
	req := &GetEIPPayModeRequest{}

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

// GetEIPPayMode - 获取弹性IP计费模式
func (c *UNetClient) GetEIPPayMode(req *GetEIPPayModeRequest) (*GetEIPPayModeResponse, error) {
	var err error
	var res GetEIPPayModeResponse

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

	return &res, nil
}
