Updating account results to make them more consistent
diff --git a/openstack/objectstorage/v1/accounts/results.go b/openstack/objectstorage/v1/accounts/results.go
index 13a894b..8ec2eff 100644
--- a/openstack/objectstorage/v1/accounts/results.go
+++ b/openstack/objectstorage/v1/accounts/results.go
@@ -3,20 +3,36 @@
import (
"net/http"
"strings"
+
+ "github.com/rackspace/gophercloud"
)
-// GetResult is a *http.Response that is returned from a call to the Get function.
-type GetResult *http.Response
+type commonResult struct {
+ gophercloud.CommonResult
+ Resp *http.Response
+}
+
+// GetResult represents the result of a create operation.
+type GetResult struct {
+ commonResult
+}
+
+// UpdateResult represents the result of an update operation.
+type UpdateResult struct {
+ commonResult
+}
// ExtractMetadata is a function that takes a GetResult (of type *http.Response)
// and returns the custom metatdata associated with the account.
-func ExtractMetadata(gr GetResult) map[string]string {
+func (res commonResult) ExtractMetadata() map[string]string {
metadata := make(map[string]string)
- for k, v := range gr.Header {
+
+ for k, v := range res.Resp.Header {
if strings.HasPrefix(k, "X-Account-Meta-") {
key := strings.TrimPrefix(k, "X-Account-Meta-")
metadata[key] = v[0]
}
}
+
return metadata
}