more consistent naming
diff --git a/openstack/identity/v3/endpoints/results.go b/openstack/identity/v3/endpoints/results.go
index 09e58e5..2788f16 100644
--- a/openstack/identity/v3/endpoints/results.go
+++ b/openstack/identity/v3/endpoints/results.go
@@ -55,17 +55,16 @@
}
// IsEmpty returns true if no Endpoints were returned.
-func (p EndpointPage) IsEmpty() (bool, error) {
- es, err := ExtractEndpoints(p)
+func (r EndpointPage) IsEmpty() (bool, error) {
+ es, err := ExtractEndpoints(r)
return len(es) == 0, err
}
// ExtractEndpoints extracts an Endpoint slice from a Page.
-func ExtractEndpoints(page pagination.Page) ([]Endpoint, error) {
- r := page.(EndpointPage)
+func ExtractEndpoints(r pagination.Page) ([]Endpoint, error) {
var s struct {
Endpoints []Endpoint `json:"endpoints"`
}
- err := r.ExtractInto(&s)
+ err := (r.(EndpointPage)).ExtractInto(&s)
return s.Endpoints, err
}
diff --git a/openstack/identity/v3/roles/requests.go b/openstack/identity/v3/roles/requests.go
index f825627..0264347 100644
--- a/openstack/identity/v3/roles/requests.go
+++ b/openstack/identity/v3/roles/requests.go
@@ -43,7 +43,7 @@
}
url += query
createPage := func(r pagination.PageResult) pagination.Page {
- return RoleAssignmentsPage{pagination.LinkedPageBase{PageResult: r}}
+ return RoleAssignmentPage{pagination.LinkedPageBase{PageResult: r}}
}
return pagination.NewPager(client, url, createPage)
diff --git a/openstack/identity/v3/roles/results.go b/openstack/identity/v3/roles/results.go
index 86f21a0..e8a3aa9 100644
--- a/openstack/identity/v3/roles/results.go
+++ b/openstack/identity/v3/roles/results.go
@@ -35,34 +35,33 @@
ID string `json:"id,omitempty"`
}
-// RoleAssignmentsPage is a single page of RoleAssignments results.
-type RoleAssignmentsPage struct {
+// RoleAssignmentPage is a single page of RoleAssignments results.
+type RoleAssignmentPage struct {
pagination.LinkedPageBase
}
// IsEmpty returns true if the page contains no results.
-func (p RoleAssignmentsPage) IsEmpty() (bool, error) {
- roleAssignments, err := ExtractRoleAssignments(p)
+func (r RoleAssignmentPage) IsEmpty() (bool, error) {
+ roleAssignments, err := ExtractRoleAssignments(r)
return len(roleAssignments) == 0, err
}
// NextPageURL uses the response's embedded link reference to navigate to the next page of results.
-func (page RoleAssignmentsPage) NextPageURL() (string, error) {
+func (r RoleAssignmentPage) NextPageURL() (string, error) {
var s struct {
Links struct {
Next string `json:"next"`
} `json:"links"`
}
- err := page.ExtractInto(&s)
+ err := r.ExtractInto(&s)
return s.Links.Next, err
}
// ExtractRoleAssignments extracts a slice of RoleAssignments from a Collection acquired from List.
-func ExtractRoleAssignments(page pagination.Page) ([]RoleAssignment, error) {
- r := page.(RoleAssignmentsPage)
+func ExtractRoleAssignments(r pagination.Page) ([]RoleAssignment, error) {
var s struct {
RoleAssignments []RoleAssignment `json:"role_assignments"`
}
- err := r.ExtractInto(&s)
+ err := (r.(RoleAssignmentPage)).ExtractInto(&s)
return s.RoleAssignments, err
}
diff --git a/openstack/identity/v3/services/results.go b/openstack/identity/v3/services/results.go
index 45040c6..b0d36fb 100644
--- a/openstack/identity/v3/services/results.go
+++ b/openstack/identity/v3/services/results.go
@@ -59,11 +59,10 @@
}
// ExtractServices extracts a slice of Services from a Collection acquired from List.
-func ExtractServices(page pagination.Page) ([]Service, error) {
- r := page.(ServicePage)
+func ExtractServices(r pagination.Page) ([]Service, error) {
var s struct {
Services []Service `json:"services"`
}
- err := r.ExtractInto(&s)
+ err := (r.(ServicePage)).ExtractInto(&s)
return s.Services, err
}