| "github.com/gophercloud/gophercloud" |
| "github.com/gophercloud/gophercloud/pagination" |
| // Role represents an API role resource. |
| // The unique ID for the role. |
| // The human-readable name of the role. |
| // The description of the role. |
| // The associated service for this role. |
| // RolePage is a single page of a user Role collection. |
| pagination.SinglePageBase |
| // IsEmpty determines whether or not a page of Tenants contains any results. |
| func (r RolePage) IsEmpty() (bool, error) { |
| users, err := ExtractRoles(r) |
| return len(users) == 0, err |
| // ExtractRoles returns a slice of roles contained in a single page of results. |
| func ExtractRoles(r pagination.Page) ([]Role, error) { |
| Roles []Role `json:"roles"` |
| err := (r.(RolePage)).ExtractInto(&s) |
| // UserRoleResult represents the result of either an AddUserRole or |
| // a DeleteUserRole operation. |
| type UserRoleResult struct { |