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