Jon Perritt | 0ce24ad | 2014-10-20 21:59:45 -0500 | [diff] [blame^] | 1 | package bulk |
| 2 | |
| 3 | import ( |
| 4 | "github.com/rackspace/gophercloud" |
| 5 | |
| 6 | "github.com/mitchellh/mapstructure" |
| 7 | |
| 8 | ) |
| 9 | |
| 10 | // DeleteResult represents the result of a delete operation. |
| 11 | type DeleteResult struct { |
| 12 | gophercloud.Result |
| 13 | } |
| 14 | |
| 15 | type DeleteBody struct { |
| 16 | NumberNotFound int `mapstructure:"Number Not Found"` |
| 17 | ResponseStatus string `mapstructure:"Response Status"` |
| 18 | Errors []string `mapstructure:"Errors"` |
| 19 | NumberDeleted int `mapstructure:"Number Deleted"` |
| 20 | ResponseBody string `mapstructure:"Response Body"` |
| 21 | } |
| 22 | |
| 23 | func (dr DeleteResult) ExtractBody() (DeleteBody, error) { |
| 24 | var resp DeleteBody |
| 25 | err := mapstructure.Decode(dr.Body, &resp) |
| 26 | return resp, err |
| 27 | } |
| 28 | |
| 29 | type ExtractResult struct { |
| 30 | gophercloud.Result |
| 31 | } |