blob: fddc125ac639a2131057a1060b4e8dcdec58cc09 [file] [log] [blame]
Jon Perritt0ce24ad2014-10-20 21:59:45 -05001package bulk
2
3import (
Jon Perritt260e0882014-10-20 23:31:23 -05004 "github.com/rackspace/gophercloud"
Jon Perritt0ce24ad2014-10-20 21:59:45 -05005
Jon Perritt260e0882014-10-20 23:31:23 -05006 "github.com/mitchellh/mapstructure"
7)
Jon Perritt0ce24ad2014-10-20 21:59:45 -05008
Jon Perritt260e0882014-10-20 23:31:23 -05009// DeleteResult represents the result of a bulk delete operation.
Jon Perritt0ce24ad2014-10-20 21:59:45 -050010type DeleteResult struct {
11 gophercloud.Result
12}
13
Jon Perritt260e0882014-10-20 23:31:23 -050014// DeleteRespBody is the form of the response body returned by a bulk delete request.
15type DeleteRespBody 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"`
Jon Perritt0ce24ad2014-10-20 21:59:45 -050021}
22
Jon Perritt260e0882014-10-20 23:31:23 -050023// ExtractBody will extract the body returned by the bulk extract request.
24func (dr DeleteResult) ExtractBody() (DeleteRespBody, error) {
25 var resp DeleteRespBody
26 err := mapstructure.Decode(dr.Body, &resp)
27 return resp, err
Jon Perritt0ce24ad2014-10-20 21:59:45 -050028}