github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/waf/v1/ccattackprotection_rules/results.go (about) 1 package ccattackprotection_rules 2 3 import ( 4 "github.com/huaweicloud/golangsdk" 5 ) 6 7 type CcAttack struct { 8 Id string `json:"id"` 9 PolicyID string `json:"policy_id"` 10 Url string `json:"path"` 11 LimitNum int `json:"limit_num"` 12 LimitPeriod int `json:"limit_period"` 13 LockTime int `json:"lock_time"` 14 TagType string `json:"tag_type"` 15 TagIndex string `json:"tag_index"` 16 TagCondition TagCondition `json:"tag_condition"` 17 Action Action `json:"action"` 18 Default bool `json:"default"` 19 TimeStamp int `json:"timestamp"` 20 } 21 22 type commonResult struct { 23 golangsdk.Result 24 } 25 26 // Extract is a function that accepts a result and extracts a cc attack protection rule. 27 func (r commonResult) Extract() (*CcAttack, error) { 28 var response CcAttack 29 err := r.ExtractInto(&response) 30 return &response, err 31 } 32 33 // CreateResult represents the result of a create operation. Call its Extract 34 // method to interpret it as a cc attack protection rule. 35 type CreateResult struct { 36 commonResult 37 } 38 39 // UpdateResult represents the result of a update operation. Call its Extract 40 // method to interpret it as a cc attack protection rule. 41 type UpdateResult struct { 42 commonResult 43 } 44 45 // GetResult represents the result of a get operation. Call its Extract 46 // method to interpret it as a cc attack protection rule. 47 type GetResult struct { 48 commonResult 49 } 50 51 // DeleteResult represents the result of a delete operation. Call its ExtractErr 52 // method to determine if the request succeeded or failed. 53 type DeleteResult struct { 54 golangsdk.ErrResult 55 }