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