func (opts ListOpts) ToResourceEventsListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
ToResourceEventsListQuery formats a ListOpts into a query string.
package stackevents
import (
	"github.com/rackspace/gophercloud"
	"github.com/rackspace/gophercloud/pagination"
)
func Find(c *gophercloud.ServiceClient, stackName string) FindResult {
	var res FindResult
	_, res.Err = c.Request("GET", findURL(c, stackName), gophercloud.RequestOpts{
		JSONResponse: &res.Body,
		OkCodes:      []int{200},
	})
	return res
}
type SortDir string
type SortKey string
type ResourceStatus string
type ResourceAction string
var (
	ResourceStatusInProgress ResourceStatus = "IN_PROGRESS"
	ResourceStatusComplete ResourceStatus = "COMPLETE"
	ResourceStatusFailed ResourceStatus = "FAILED"
	ResourceActionCreate ResourceAction = "CREATE"
	ResourceActionDelete ResourceAction = "DELETE"
	ResourceActionUpdate ResourceAction = "UPDATE"
	ResourceActionRollback ResourceAction = "ROLLBACK"
	ResourceActionSuspend ResourceAction = "SUSPEND"
	ResourceActionResume ResourceAction = "RESUME"
	ResourceActionAbandon ResourceAction = "ABANDON"
	SortAsc SortDir = "asc"
	SortDesc SortDir = "desc"
	SortName SortKey = "name"
	SortResourceType SortKey = "resource_type"
	SortCreatedAt SortKey = "created_at"
)
type ListOptsBuilder interface {
	ToStackEventListQuery() (string, error)
}
type ListOpts struct {
	Marker string `q:"marker"`
	Limit int `q:"limit"`
	ResourceActions []ResourceAction `q:"resource_action"`
	ResourceStatuses []ResourceStatus `q:"resource_status"`
	ResourceNames []string `q:"resource_name"`
	ResourceTypes []string `q:"resource_type"`
	SortKey SortKey `q:"sort_keys"`
	SortDir SortDir `q:"sort_dir"`
}
func (opts ListOpts) ToStackEventListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
func List(client *gophercloud.ServiceClient, stackName, stackID string, opts ListOptsBuilder) pagination.Pager {
	url := listURL(client, stackName, stackID)
	if opts != nil {
		query, err := opts.ToStackEventListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	createPageFn := func(r pagination.PageResult) pagination.Page {
		p := EventPage{pagination.MarkerPageBase{PageResult: r}}
		p.MarkerPageBase.Owner = p
		return p
	}
	return pagination.NewPager(client, url, createPageFn)
}
type ListResourceEventsOptsBuilder interface {
	ToResourceEventListQuery() (string, error)
}
type ListResourceEventsOpts struct {
	Marker string `q:"marker"`
	Limit int `q:"limit"`
	ResourceActions []string `q:"resource_action"`
	ResourceStatuses []string `q:"resource_status"`
	ResourceNames []string `q:"resource_name"`
	ResourceTypes []string `q:"resource_type"`
	SortKey SortKey `q:"sort_keys"`
	SortDir SortDir `q:"sort_dir"`
}