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

package uhost

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

// DescribeIsolationGroupRequest is request schema for DescribeIsolationGroup action
type DescribeIsolationGroupRequest struct {
	request.CommonBase

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

	// [公共参数] 项目id
	// ProjectId *string `required:"false"`

	// 待查的硬件隔离组id
	GroupId *string `required:"false"`

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

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

// DescribeIsolationGroupResponse is response schema for DescribeIsolationGroup action
type DescribeIsolationGroupResponse struct {
	response.CommonBase

	// 硬件隔离组集合。参见数据结构IsolationGroup。
	IsolationGroupSet []IsolationGroup
}

// NewDescribeIsolationGroupRequest will create request of DescribeIsolationGroup action.
func (c *UHostClient) NewDescribeIsolationGroupRequest() *DescribeIsolationGroupRequest {
	req := &DescribeIsolationGroupRequest{}

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

// DescribeIsolationGroup - 查询硬件隔离组列表。
func (c *UHostClient) DescribeIsolationGroup(req *DescribeIsolationGroupRequest) (*DescribeIsolationGroupResponse, error) {
	var err error
	var res DescribeIsolationGroupResponse

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

	return &res, nil
}
