Identity v3 Projects Get (#164)
* Identity v3 Projects Get
* Renaming ToGetQuery to ToProjectGetQuery
* Fixing acceptance test
diff --git a/openstack/identity/v3/projects/results.go b/openstack/identity/v3/projects/results.go
index 33c70e1..2ec05a8 100644
--- a/openstack/identity/v3/projects/results.go
+++ b/openstack/identity/v3/projects/results.go
@@ -1,9 +1,19 @@
package projects
import (
+ "github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/pagination"
)
+type projectResult struct {
+ gophercloud.Result
+}
+
+// GetResult temporarily contains the response from the Get call.
+type GetResult struct {
+ projectResult
+}
+
// Project is a base unit of ownership.
type Project struct {
// IsDomain indicates whether the project is a domain.
@@ -62,3 +72,12 @@
err := (r.(ProjectPage)).ExtractInto(&s)
return s.Projects, err
}
+
+// Extract interprets any projectResults as a Project.
+func (r projectResult) Extract() (*Project, error) {
+ var s struct {
+ Project *Project `json:"project"`
+ }
+ err := r.ExtractInto(&s)
+ return s.Project, err
+}