func UpdateMetadata(client *gophercloud.ServiceClient, id string, opts UpdateMetadataOptsBuilder) UpdateMetadataResult {
	var res UpdateMetadataResult
	reqBody, err := opts.ToSnapshotUpdateMetadataMap()
	if err != nil {
		res.Err = err
		return res
	}
	_, res.Err = client.Request("PUT", updateMetadataURL(client, id), gophercloud.RequestOpts{
		OkCodes:      []int{200},
		JSONBody:     &reqBody,
		JSONResponse: &res.Body,
	})
	return res
}
UpdateMetadata will update the Snapshot with provided information. To
extract the updated Snapshot from the response, call the ExtractMetadata
method on the UpdateMetadataResult.
package snapshots
import (
	"fmt"
	"github.com/rackspace/gophercloud"
	"github.com/rackspace/gophercloud/pagination"
)
type CreateOptsBuilder interface {
	ToSnapshotCreateMap() (map[string]interface{}, error)
}
type CreateOpts struct {
	Description string
	Force bool
	Metadata map[string]interface{}
	Name string
	VolumeID string
}
func (opts CreateOpts) ToSnapshotCreateMap() (map[string]interface{}, error) {
	s := make(map[string]interface{})
	if opts.VolumeID == "" {
		return nil, fmt.Errorf("Required CreateOpts field 'VolumeID' not set.")
	}
	s["volume_id"] = opts.VolumeID
	if opts.Description != "" {
		s["display_description"] = opts.Description
	}
	if opts.Force == true {
		s["force"] = opts.Force
	}
	if opts.Metadata != nil {
		s["metadata"] = opts.Metadata
	}
	if opts.Name != "" {
		s["display_name"] = opts.Name
	}
	return map[string]interface{}{"snapshot": s}, nil
}
func Create(client *gophercloud.ServiceClient, opts CreateOptsBuilder) CreateResult {
	var res CreateResult
	reqBody, err := opts.ToSnapshotCreateMap()
	if err != nil {
		res.Err = err
		return res
	}
	_, res.Err = client.Request("POST", createURL(client), gophercloud.RequestOpts{
		OkCodes:      []int{200, 201},
		JSONBody:     &reqBody,
		JSONResponse: &res.Body,
	})
	return res
}
func Delete(client *gophercloud.ServiceClient, id string) DeleteResult {
	var res DeleteResult
	_, res.Err = client.Request("DELETE", deleteURL(client, id), gophercloud.RequestOpts{
		OkCodes: []int{202, 204},
	})
	return res
}
func Get(client *gophercloud.ServiceClient, id string) GetResult {
	var res GetResult
	_, res.Err = client.Request("GET", getURL(client, id), gophercloud.RequestOpts{
		OkCodes:      []int{200},
		JSONResponse: &res.Body,
	})
	return res
}
type ListOptsBuilder interface {
	ToSnapshotListQuery() (string, error)
}
type ListOpts struct {
	Name     string `q:"display_name"`
	Status   string `q:"status"`
	VolumeID string `q:"volume_id"`
}
func (opts ListOpts) ToSnapshotListQuery() (string, error) {
	q, err := gophercloud.BuildQueryString(opts)
	if err != nil {
		return "", err
	}
	return q.String(), nil
}
func List(client *gophercloud.ServiceClient, opts ListOptsBuilder) pagination.Pager {
	url := listURL(client)
	if opts != nil {
		query, err := opts.ToSnapshotListQuery()
		if err != nil {
			return pagination.Pager{Err: err}
		}
		url += query
	}
	createPage := func(r pagination.PageResult) pagination.Page {
		return ListResult{pagination.SinglePageBase(r)}
	}
	return pagination.NewPager(client, url, createPage)
}
type UpdateMetadataOptsBuilder interface {
	ToSnapshotUpdateMetadataMap() (map[string]interface{}, error)
}
type UpdateMetadataOpts struct {
	Metadata map[string]interface{}
}
func (opts UpdateMetadataOpts) ToSnapshotUpdateMetadataMap() (map[string]interface{}, error) {
	v := make(map[string]interface{})
	if opts.Metadata != nil {
		v["metadata"] = opts.Metadata
	}
	return v, nil
}