dsl struct tags; wip
diff --git a/openstack/identity/v3/roles/requests.go b/openstack/identity/v3/roles/requests.go
index 0264347..de65c51 100644
--- a/openstack/identity/v3/roles/requests.go
+++ b/openstack/identity/v3/roles/requests.go
@@ -17,34 +17,31 @@
// Effective lists effective assignments at the user, project, and domain level,
// allowing for the effects of group membership.
type ListAssignmentsOpts struct {
- GroupId string `q:"group.id"`
- RoleId string `q:"role.id"`
- ScopeDomainId string `q:"scope.domain.id"`
- ScopeProjectId string `q:"scope.project.id"`
- UserId string `q:"user.id"`
- Effective bool `q:"effective"`
+ GroupID string `q:"group.id"`
+ RoleID string `q:"role.id"`
+ ScopeDomainID string `q:"scope.domain.id"`
+ ScopeProjectID string `q:"scope.project.id"`
+ UserID string `q:"user.id"`
+ Effective *bool `q:"effective"`
}
// ToRolesListAssignmentsQuery formats a ListAssignmentsOpts into a query string.
func (opts ListAssignmentsOpts) ToRolesListAssignmentsQuery() (string, error) {
q, err := gophercloud.BuildQueryString(opts)
- if err != nil {
- return "", err
- }
- return q.String(), nil
+ return q.String(), err
}
// ListAssignments enumerates the roles assigned to a specified resource.
func ListAssignments(client *gophercloud.ServiceClient, opts ListAssignmentsOptsBuilder) pagination.Pager {
url := listAssignmentsURL(client)
- query, err := opts.ToRolesListAssignmentsQuery()
- if err != nil {
- return pagination.Pager{Err: err}
+ if opts != nil {
+ query, err := opts.ToRolesListAssignmentsQuery()
+ if err != nil {
+ return pagination.Pager{Err: err}
+ }
+ url += query
}
- url += query
- createPage := func(r pagination.PageResult) pagination.Page {
+ return pagination.NewPager(client, url, func(r pagination.PageResult) pagination.Page {
return RoleAssignmentPage{pagination.LinkedPageBase{PageResult: r}}
- }
-
- return pagination.NewPager(client, url, createPage)
+ })
}