github.com/opentelekomcloud/gophertelekomcloud@v0.9.3/openstack/waf/v1/ccattackprotection_rules/results.go (about)

     1  package ccattackprotection_rules
     2  
     3  import (
     4  	"github.com/opentelekomcloud/gophertelekomcloud"
     5  )
     6  
     7  type CcAttack struct {
     8  	Id           string       `json:"id"`
     9  	PolicyID     string       `json:"policy_id"`
    10  	Path         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  }
    20  
    21  type commonResult struct {
    22  	golangsdk.Result
    23  }
    24  
    25  // Extract is a function that accepts a result and extracts a cc attack protection rule.
    26  func (r commonResult) Extract() (*CcAttack, error) {
    27  	var response CcAttack
    28  	err := r.ExtractInto(&response)
    29  	return &response, err
    30  }
    31  
    32  // CreateResult represents the result of a create operation. Call its Extract
    33  // method to interpret it as a cc attack protection rule.
    34  type CreateResult struct {
    35  	commonResult
    36  }
    37  
    38  // GetResult represents the result of a get operation. Call its Extract
    39  // method to interpret it as a cc attack 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  }