github.com/huaweicloud/golangsdk@v0.0.0-20210831081626-d823fe11ceba/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/huaweicloud/golangsdk" 9 ) 10 11 type DataMasking struct { 12 // DataMasking Rule ID 13 Id string `json:"id"` 14 // DataMaksing Rule URL 15 Path string `json:"url"` 16 // Masked Field 17 Category string `json:"category"` 18 // Masked Subfield 19 Index string `json:"index"` 20 } 21 22 type commonResult struct { 23 golangsdk.Result 24 } 25 26 // Extract is a function that accepts a result and extracts a datamasking rule. 27 func (r commonResult) Extract() (*DataMasking, error) { 28 var response DataMasking 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 DataMasking 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 DataMasking 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 DataMasking 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 }