github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/openstack/waf_hw/v1/webtamperprotection_rules/results.go (about)

     1  /*
     2   Copyright (c) Huawei Technologies Co., Ltd. 2021. All rights reserved.
     3  */
     4  
     5  package webtamperprotection_rules
     6  
     7  import (
     8  	"github.com/huaweicloud/golangsdk"
     9  )
    10  
    11  type WebTamper struct {
    12  	Id          string `json:"id"`
    13  	PolicyID    string `json:"policyid"`
    14  	Hostname    string `json:"hostname"`
    15  	Url         string `json:"url"`
    16  	TimeStamp   int64  `json:"timestamp"`
    17  	Description string `json:"description"`
    18  	Status      int    `json:"status"`
    19  }
    20  
    21  type commonResult struct {
    22  	golangsdk.Result
    23  }
    24  
    25  // Extract is a function that accepts a result and extracts a web tamper protection rule.
    26  func (r commonResult) Extract() (*WebTamper, error) {
    27  	var response WebTamper
    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 Web Tamper Protection rule.
    34  type CreateResult struct {
    35  	commonResult
    36  }
    37  
    38  // UpdateResult represents the result of a update operation. Call its Extract
    39  // method to interpret it as a Web Tamper Protection rule.
    40  type UpdateResult struct {
    41  	commonResult
    42  }
    43  
    44  // GetResult represents the result of a get operation. Call its Extract
    45  // method to interpret it as a Web Tamper Protection rule.
    46  type GetResult struct {
    47  	commonResult
    48  }
    49  
    50  // DeleteResult represents the result of a delete operation. Call its ExtractErr
    51  // method to determine if the request succeeded or failed.
    52  type DeleteResult struct {
    53  	golangsdk.ErrResult
    54  }