Adding DeleteResult for v3.endpoints.Delete
diff --git a/openstack/identity/v3/endpoints/requests.go b/openstack/identity/v3/endpoints/requests.go
index 4bec427..66bdb0e 100644
--- a/openstack/identity/v3/endpoints/requests.go
+++ b/openstack/identity/v3/endpoints/requests.go
@@ -134,10 +134,11 @@
}
// Delete removes an endpoint from the service catalog.
-func Delete(client *gophercloud.ServiceClient, endpointID string) error {
- _, err := perigee.Request("DELETE", endpointURL(client, endpointID), perigee.Options{
+func Delete(client *gophercloud.ServiceClient, endpointID string) DeleteResult {
+ var res DeleteResult
+ _, res.Err = perigee.Request("DELETE", endpointURL(client, endpointID), perigee.Options{
MoreHeaders: client.AuthenticatedHeaders(),
OkCodes: []int{204},
})
- return err
+ return res
}
diff --git a/openstack/identity/v3/endpoints/requests_test.go b/openstack/identity/v3/endpoints/requests_test.go
index 381461c..80687c4 100644
--- a/openstack/identity/v3/endpoints/requests_test.go
+++ b/openstack/identity/v3/endpoints/requests_test.go
@@ -221,8 +221,6 @@
w.WriteHeader(http.StatusNoContent)
})
- err := Delete(client.ServiceClient(), "34")
- if err != nil {
- t.Fatalf("Unexpected error from Delete: %v", err)
- }
+ res := Delete(client.ServiceClient(), "34")
+ testhelper.AssertNoErr(t, res.Err)
}
diff --git a/openstack/identity/v3/endpoints/results.go b/openstack/identity/v3/endpoints/results.go
index f559b9a..9f41eca 100644
--- a/openstack/identity/v3/endpoints/results.go
+++ b/openstack/identity/v3/endpoints/results.go
@@ -41,6 +41,11 @@
commonResult
}
+// DeleteResult is the deferred result of an Delete call.
+type DeleteResult struct {
+ commonResult
+}
+
// Endpoint describes the entry point for another service's API.
type Endpoint struct {
ID string `mapstructure:"id" json:"id"`