Add Identity HTTP operations
diff --git a/openstack/identity/v2/users/requests.go b/openstack/identity/v2/users/requests.go
index 8aa1a20..88be45e 100644
--- a/openstack/identity/v2/users/requests.go
+++ b/openstack/identity/v2/users/requests.go
@@ -90,10 +90,8 @@
return res
}
- _, res.Err = client.Request("POST", rootURL(client), gophercloud.RequestOpts{
- JSONResponse: &res.Body,
- JSONBody: reqBody,
- OkCodes: []int{200, 201},
+ _, res.Err = client.Post(rootURL(client), reqBody, &res.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200, 201},
})
return res
@@ -102,11 +100,7 @@
// Get requests details on a single user, either by ID.
func Get(client *gophercloud.ServiceClient, id string) GetResult {
var result GetResult
-
- _, result.Err = client.Request("GET", ResourceURL(client, id), gophercloud.RequestOpts{
- JSONResponse: &result.Body,
- })
-
+ _, result.Err = client.Get(ResourceURL(client, id), &result.Body, nil)
return result
}
@@ -144,22 +138,17 @@
// Update is the operation responsible for updating exist users by their UUID.
func Update(client *gophercloud.ServiceClient, id string, opts UpdateOptsBuilder) UpdateResult {
var result UpdateResult
-
- _, result.Err = client.Request("PUT", ResourceURL(client, id), gophercloud.RequestOpts{
- JSONResponse: &result.Body,
- JSONBody: opts.ToUserUpdateMap(),
- OkCodes: []int{200},
+ reqBody := opts.ToUserUpdateMap()
+ _, result.Err = client.Put(ResourceURL(client, id), reqBody, &result.Body, &gophercloud.RequestOpts{
+ OkCodes: []int{200},
})
-
return result
}
// Delete is the operation responsible for permanently deleting an API user.
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
var result DeleteResult
-
- _, result.Err = client.Request("DELETE", ResourceURL(client, id), gophercloud.RequestOpts{})
-
+ _, result.Err = client.Delete(ResourceURL(client, id), nil)
return result
}