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

package unet

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

// DescribeFirewallResourceRequest is request schema for DescribeFirewallResource action
type DescribeFirewallResourceRequest struct {
	request.CommonBase

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

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

	// 防火墙ID
	FWId *string `required:"true"`

	// 返回数据长度，默认为20，最大10000000
	Limit *string `required:"false"`

	// 列表起始位置偏移量，默认为0
	Offset *string `required:"false"`
}

// DescribeFirewallResourceResponse is response schema for DescribeFirewallResource action
type DescribeFirewallResourceResponse struct {
	response.CommonBase

	// 资源列表，见 ResourceSet
	ResourceSet []ResourceSet

	// 绑定资源总数
	TotalCount int
}

// NewDescribeFirewallResourceRequest will create request of DescribeFirewallResource action.
func (c *UNetClient) NewDescribeFirewallResourceRequest() *DescribeFirewallResourceRequest {
	req := &DescribeFirewallResourceRequest{}

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

// DescribeFirewallResource - 获取防火墙组所绑定资源的外网IP
func (c *UNetClient) DescribeFirewallResource(req *DescribeFirewallResourceRequest) (*DescribeFirewallResourceResponse, error) {
	var err error
	var res DescribeFirewallResourceResponse

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

	return &res, nil
}
