dsl struct tags; wip
diff --git a/openstack/identity/v2/extensions/admin/roles/requests.go b/openstack/identity/v2/extensions/admin/roles/requests.go
index 891ab62..d80c53f 100644
--- a/openstack/identity/v2/extensions/admin/roles/requests.go
+++ b/openstack/identity/v2/extensions/admin/roles/requests.go
@@ -8,26 +8,25 @@
// List is the operation responsible for listing all available global roles
// that a user can adopt.
func List(client *gophercloud.ServiceClient) pagination.Pager {
- createPage := func(r pagination.PageResult) pagination.Page {
+ return pagination.NewPager(client, rootURL(client), func(r pagination.PageResult) pagination.Page {
return RolePage{pagination.SinglePageBase(r)}
- }
- return pagination.NewPager(client, rootURL(client), createPage)
+ })
}
-// AddUserRole is the operation responsible for assigning a particular role to
+// AddUser is the operation responsible for assigning a particular role to
// a user. This is confined to the scope of the user's tenant - so the tenant
// ID is a required argument.
-func AddUserRole(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult {
- var result UserRoleResult
- _, result.Err = client.Put(userRoleURL(client, tenantID, userID, roleID), nil, nil, nil)
- return result
+func AddUser(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult {
+ var r UserRoleResult
+ _, r.Err = client.Put(userRoleURL(client, tenantID, userID, roleID), nil, nil, nil)
+ return r
}
-// DeleteUserRole is the operation responsible for deleting a particular role
+// DeleteUser is the operation responsible for deleting a particular role
// from a user. This is confined to the scope of the user's tenant - so the
// tenant ID is a required argument.
-func DeleteUserRole(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult {
- var result UserRoleResult
- _, result.Err = client.Delete(userRoleURL(client, tenantID, userID, roleID), nil)
- return result
+func DeleteUser(client *gophercloud.ServiceClient, tenantID, userID, roleID string) UserRoleResult {
+ var r UserRoleResult
+ _, r.Err = client.Delete(userRoleURL(client, tenantID, userID, roleID), nil)
+ return r
}
diff --git a/openstack/identity/v2/extensions/admin/roles/requests_test.go b/openstack/identity/v2/extensions/admin/roles/requests_test.go
index af809a5..cf3402d 100644
--- a/openstack/identity/v2/extensions/admin/roles/requests_test.go
+++ b/openstack/identity/v2/extensions/admin/roles/requests_test.go
@@ -41,24 +41,24 @@
th.AssertEquals(t, 1, count)
}
-func TestAddUserRole(t *testing.T) {
+func TestAddUser(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
MockAddUserRoleResponse(t)
- err := AddUserRole(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
+ err := AddUser(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
th.AssertNoErr(t, err)
}
-func TestDeleteUserRole(t *testing.T) {
+func TestDeleteUser(t *testing.T) {
th.SetupHTTP()
defer th.TeardownHTTP()
MockDeleteUserRoleResponse(t)
- err := DeleteUserRole(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
+ err := DeleteUser(client.ServiceClient(), "{tenant_id}", "{user_id}", "{role_id}").ExtractErr()
th.AssertNoErr(t, err)
}