func (c *Connection) GetVaultNotifications(name string) (*Notifications, error) {
	var results Notifications
	request, err := http.NewRequest("GET", c.vault(name)+"/notification-configuration", nil)
	if err != nil {
		return nil, err
	}
	request.Header.Add("x-amz-glacier-version", "2012-06-01")
	c.Signature.Sign(request, nil)
	response, err := c.client().Do(request)
	if err != nil {
		return nil, err
	}
	defer response.Body.Close()
	if response.StatusCode != http.StatusOK {
		return nil, aws.ParseError(response)
	}
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return nil, err
	}
	err = json.Unmarshal(body, &results)
	if err != nil {
		return nil, err
	}
	return &results, nil
}
This operation retrieves the notification-configuration subresource set on
the vault. If notification configuration for a vault is not set, the
operation returns a 404 Not Found error.
package glacier
import (
	"encoding/json"
	"io"
	"io/ioutil"
	"net/http"
	"strconv"
	"time"
	"github.com/rdwilliamson/aws"
)
type Vault struct {
	CreationDate      time.Time
	LastInventoryDate time.Time
	NumberOfArchives  int
	SizeInBytes       int64
	VaultARN          string
	VaultName         string
}
type vault struct {
	CreationDate      string
	LastInventoryDate *string
	NumberOfArchives  int
	SizeInBytes       int64
	VaultARN          string
	VaultName         string
}
type Notifications struct {
	Events   []string
	SNSTopic string
}
func (c *Connection) CreateVault(name string) error {
	request, err := http.NewRequest("PUT", c.vault(name), nil)
	if err != nil {
		return err
	}
	request.Header.Add("x-amz-glacier-version", "2012-06-01")
	c.Signature.Sign(request, nil)
	response, err := c.client().Do(request)
	if err != nil {
		return err
	}
	defer response.Body.Close()
	if response.StatusCode != http.StatusCreated {
		return aws.ParseError(response)
	}
	io.Copy(ioutil.Discard, response.Body)
	return nil
}
func (c *Connection) DeleteVault(name string) error {
	request, err := http.NewRequest("DELETE", c.vault(name), nil)
	if err != nil {
		return err
	}
	request.Header.Add("x-amz-glacier-version", "2012-06-01")
	c.Signature.Sign(request, nil)
	response, err := c.client().Do(request)
	if err != nil {
		return err
	}
	defer response.Body.Close()
	if response.StatusCode != http.StatusNoContent {
		return aws.ParseError(response)
	}
	io.Copy(ioutil.Discard, response.Body)
	return nil
}
func (c *Connection) DescribeVault(name string) (*Vault, error) {
	request, err := http.NewRequest("GET", c.vault(name), nil)
	if err != nil {
		return nil, err
	}
	request.Header.Add("x-amz-glacier-version", "2012-06-01")
	c.Signature.Sign(request, nil)
	response, err := c.client().Do(request)
	if err != nil {
		return nil, err
	}
	defer response.Body.Close()
	if response.StatusCode != http.StatusOK {
		return nil, aws.ParseError(response)
	}
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return nil, err
	}
	var v vault
	err = json.Unmarshal(body, &v)
	if err != nil {
		return nil, err
	}
	var result Vault
	result.CreationDate, err = time.Parse(time.RFC3339, v.CreationDate)
	if err != nil {
		return nil, err
	}
	if v.LastInventoryDate != nil {
		result.LastInventoryDate, err = time.Parse(time.RFC3339, *v.LastInventoryDate)
		if err != nil {
			return nil, err
		}
	}
	result.NumberOfArchives = v.NumberOfArchives
	result.SizeInBytes = v.SizeInBytes
	result.VaultARN = v.VaultARN
	result.VaultName = v.VaultName
	return &result, nil
}
func (c *Connection) ListVaults(marker string, limit int) ([]Vault, string, error) {
	parameters := parameters{}
	if limit > 0 {
		parameters.add("limit", strconv.Itoa(limit))
	}
	if marker != "" {
		parameters.add("marker", marker)
	}
	vaultURL := c.vault("")
	vaultURL = vaultURL[:len(vaultURL)-1]
	request, err := http.NewRequest("GET", vaultURL+parameters.encode(), nil)
	if err != nil {
		return nil, "", err
	}
	request.Header.Add("x-amz-glacier-version", "2012-06-01")
	c.Signature.Sign(request, nil)
	response, err := c.client().Do(request)
	if err != nil {
		return nil, "", err
	}
	defer response.Body.Close()
	if response.StatusCode != http.StatusOK {
		return nil, "", aws.ParseError(response)
	}
	body, err := ioutil.ReadAll(response.Body)
	if err != nil {
		return nil, "", err
	}
	var vaults struct {
		Marker    *string
		VaultList []vault
	}
	err = json.Unmarshal(body, &vaults)
	if err != nil {
		return nil, "", err
	}
	result := make([]Vault, len(vaults.VaultList))
	for i, v := range vaults.VaultList {
		result[i].CreationDate, err = time.Parse(time.RFC3339, v.CreationDate)
		if err != nil {
			return nil, "", err
		}
		if v.LastInventoryDate != nil {
			result[i].LastInventoryDate, err = time.Parse(time.RFC3339, *v.LastInventoryDate)
			if err != nil {
				return nil, "", err
			}
		}
		result[i].NumberOfArchives = v.NumberOfArchives
		result[i].SizeInBytes = v.SizeInBytes
		result[i].VaultARN = v.VaultARN
		result[i].VaultName = v.VaultName
	}
	var resultMarker string
	if vaults.Marker != nil {
		resultMarker = *vaults.Marker
	}
	return result, resultMarker, nil
}
func (c *Connection) SetVaultNotifications(name string, n *Notifications) error {
	body, err := json.Marshal(n)
	if err != nil {
		return err
	}
	request, err := http.NewRequest("PUT", c.vault(name)+"/notification-configuration", nil)
	if err != nil {
		return err
	}
	request.Header.Add("x-amz-glacier-version", "2012-06-01")
	c.Signature.Sign(request, aws.MemoryPayload(body))
	response, err := c.client().Do(request)
	if err != nil {
		return err
	}
	defer response.Body.Close()
	if response.StatusCode != http.StatusNoContent {
		return aws.ParseError(response)
	}
	io.Copy(ioutil.Discard, response.Body)
	return nil
}