github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/iec/v1/security/rules/results.go (about)

     1  package rules
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  	"github.com/huaweicloud/golangsdk/openstack/iec/v1/common"
     6  )
     7  
     8  type commonResult struct {
     9  	golangsdk.Result
    10  }
    11  
    12  //RespSecurityGroupRule 获取安全组规则详情的结构体
    13  type RespSecurityGroupRule struct {
    14  	SecurityGroupRule common.RespSecurityGroupRuleEntity `json:"security_group_rule"`
    15  }
    16  
    17  type CreateResult struct {
    18  	commonResult
    19  }
    20  
    21  func (r CreateResult) Extract() (*RespSecurityGroupRule, error) {
    22  	var entity RespSecurityGroupRule
    23  	err := r.ExtractIntoStructPtr(&entity, "")
    24  	return &entity, err
    25  }
    26  
    27  type DeleteResult struct {
    28  	golangsdk.ErrResult
    29  }
    30  
    31  type GetResult struct {
    32  	commonResult
    33  }
    34  
    35  func (r GetResult) Extract() (*RespSecurityGroupRule, error) {
    36  	var entity RespSecurityGroupRule
    37  	err := r.ExtractIntoStructPtr(&entity, "")
    38  	return &entity, err
    39  }