func (opts ListOpts) ToAllocationListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	return q.String(), err
}
ToAllocationListQuery formats a ListOpts into a query string.
package allocations
import (
	"github.com/gophercloud/gophercloud"
	"github.com/gophercloud/gophercloud/pagination"
)
type CreateOptsBuilder interface {
	ToAllocationCreateMap() (map[string]interface{}, error)
}
type CreateOpts struct {
	ResourceClass string `json:"resource_class" required:"true"`
	CandidateNodes []string `json:"candidate_nodes,omitempty"`
	Name string `json:"name,omitempty"`
	Traits []string `json:"traits,omitempty"`
	UUID string `json:"uuid,omitempty"`
	Extra map[string]string `json:"extra,omitempty"`
}
func (opts CreateOpts) ToAllocationCreateMap() (map[string]interface{}, error) {
	body, err := gophercloud.BuildRequestBody(opts, "")
	if err != nil {
		return nil, err
	}
	return body, nil
}
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) (r CreateResult) {
	reqBody, err := opts.ToAllocationCreateMap()
	if err != nil {
		r.Err = err
		return
	}
	resp, err := client.Post(createURL(client), reqBody, &r.Body, nil)
	_, r.Header, r.Err = gophercloud.ParseResponse(resp, err)
	return
}
type AllocationState string
var (
	Allocating AllocationState = "allocating"
	Active                     = "active"
	Error                      = "error"
)
type ListOptsBuilder interface {
	ToAllocationListQuery() (string, error)
}
type ListOpts struct {
	Node string `q:"node"`
	ResourceClass string `q:"resource_class"`
	State AllocationState `q:"state"`
	Fields []string `q:"fields"`
	Limit int `q:"limit"`
	Marker string `q:"marker"`
	SortDir string `q:"sort_dir"`
	SortKey string `q:"sort_key"`
}