github.com/chnsz/golangsdk@v0.0.0-20240506093406-85a3fbfa605b/openstack/waf_hw/v1/datamasking_rules/results.go (about)

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