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

     1  package datamasking_rules
     2  
     3  import (
     4  	"github.com/huaweicloud/golangsdk"
     5  )
     6  
     7  type DataMasking struct {
     8  	// DataMasking Rule ID
     9  	Id string `json:"id"`
    10  	// Policy ID
    11  	PolicyID string `json:"policy_id"`
    12  	// DataMaksing Rule URL
    13  	Path string `json:"path"`
    14  	// Masked Field
    15  	Category string `json:"category"`
    16  	// Masked Subfield
    17  	Index string `json:"index"`
    18  }
    19  
    20  type commonResult struct {
    21  	golangsdk.Result
    22  }
    23  
    24  // Extract is a function that accepts a result and extracts a datamasking rule.
    25  func (r commonResult) Extract() (*DataMasking, error) {
    26  	var response DataMasking
    27  	err := r.ExtractInto(&response)
    28  	return &response, err
    29  }
    30  
    31  // CreateResult represents the result of a create operation. Call its Extract
    32  // method to interpret it as a DataMasking rule.
    33  type CreateResult struct {
    34  	commonResult
    35  }
    36  
    37  // UpdateResult represents the result of a update operation. Call its Extract
    38  // method to interpret it as a DataMasking rule.
    39  type UpdateResult struct {
    40  	commonResult
    41  }
    42  
    43  // GetResult represents the result of a get operation. Call its Extract
    44  // method to interpret it as a DataMasking rule.
    45  type GetResult struct {
    46  	commonResult
    47  }
    48  
    49  // DeleteResult represents the result of a delete operation. Call its ExtractErr
    50  // method to determine if the request succeeded or failed.
    51  type DeleteResult struct {
    52  	golangsdk.ErrResult
    53  }