github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/waf/v1/whiteblackip_rules/results.go (about) 1 package whiteblackip_rules 2 3 import ( 4 "github.com/huaweicloud/golangsdk" 5 ) 6 7 type WhiteBlackIP struct { 8 // WhiteBlackIP Rule ID 9 Id string `json:"id"` 10 // WhiteBlackIP Rule Addr 11 Addr string `json:"addr"` 12 // IP address type 13 White int `json:"white"` 14 // Policy ID 15 PolicyID string `json:"policy_id"` 16 } 17 18 type commonResult struct { 19 golangsdk.Result 20 } 21 22 // Extract is a function that accepts a result and extracts a whiteblackip rule. 23 func (r commonResult) Extract() (*WhiteBlackIP, error) { 24 var response WhiteBlackIP 25 err := r.ExtractInto(&response) 26 return &response, err 27 } 28 29 // CreateResult represents the result of a create operation. Call its Extract 30 // method to interpret it as a WhiteBlackIP rule. 31 type CreateResult struct { 32 commonResult 33 } 34 35 // UpdateResult represents the result of a update operation. Call its Extract 36 // method to interpret it as a WhiteBlackIP rule. 37 type UpdateResult struct { 38 commonResult 39 } 40 41 // GetResult represents the result of a get operation. Call its Extract 42 // method to interpret it as a WhiteBlackIP rule. 43 type GetResult struct { 44 commonResult 45 } 46 47 // DeleteResult represents the result of a delete operation. Call its ExtractErr 48 // method to determine if the request succeeded or failed. 49 type DeleteResult struct { 50 golangsdk.ErrResult 51 }