code styling, paging fix
diff --git a/openstack/identity/v3/roles/results.go b/openstack/identity/v3/roles/results.go
index 31cb7a3..d25abd2 100644
--- a/openstack/identity/v3/roles/results.go
+++ b/openstack/identity/v3/roles/results.go
@@ -8,10 +8,10 @@
// RoleAssignment is the result of a role assignments query.
type RoleAssignment struct {
- Role *Role `json:"role,omitempty"`
- Scope *Scope `json:"scope,omitempty"`
- User *User `json:"user,omitempty"`
- Group *Group `json:"group,omitempty"`
+ Role Role `json:"role,omitempty"`
+ Scope Scope `json:"scope,omitempty"`
+ User User `json:"user,omitempty"`
+ Group Group `json:"group,omitempty"`
}
type Role struct {
@@ -19,8 +19,8 @@
}
type Scope struct {
- Domain *Domain `json:"domain,omitempty"`
- Project *Project `json:"domain,omitempty"`
+ Domain Domain `json:"domain,omitempty"`
+ Project Project `json:"domain,omitempty"`
}
type Domain struct {
@@ -53,6 +53,23 @@
return len(roleAssignments) == 0, nil
}
+// NextPageURL uses the response's embedded link reference to navigate to the next page of results.
+func (page RoleAssignmentsPage) NextPageURL() (string, error) {
+ type resp struct {
+ Links struct {
+ Next string `mapstructure:"next"`
+ } `mapstructure:"links"`
+ }
+
+ var r resp
+ err := mapstructure.Decode(page.Body, &r)
+ if err != nil {
+ return "", err
+ }
+
+ return r.Links.Next, nil
+}
+
// ExtractRoleAssignments extracts a slice of RoleAssignments from a Collection acquired from List.
func ExtractRoleAssignments(page pagination.Page) ([]RoleAssignment, error) {
var response struct {