comment types; remove ok codes
diff --git a/openstack/storage/v1/objects/objects.go b/openstack/storage/v1/objects/objects.go
index 9575e0f..ab390fa 100644
--- a/openstack/storage/v1/objects/objects.go
+++ b/openstack/storage/v1/objects/objects.go
@@ -7,14 +7,17 @@
"strings"
)
+// Object is a structure that holds information related to a storage object.
type Object map[string]interface{}
+// ListOpts is a structure that holds parameters for listing objects.
type ListOpts struct {
Container string
Full bool
Params map[string]string
}
+// DownloadOpts is a structure that holds parameters for downloading an object.
type DownloadOpts struct {
Container string
Name string
@@ -22,6 +25,7 @@
Params map[string]string
}
+// CreateOpts is a structure that holds parameters for creating an object.
type CreateOpts struct {
Container string
Name string
@@ -31,6 +35,7 @@
Params map[string]string
}
+// CopyOpts is a structure that holds parameters for copying one object to another.
type CopyOpts struct {
Container string
Name string
@@ -40,12 +45,14 @@
Headers map[string]string
}
+// DeleteOpts is a structure that holds parameters for deleting an object.
type DeleteOpts struct {
Container string
Name string
Params map[string]string
}
+// GetOpts is a structure that holds parameters for getting an object's metadata.
type GetOpts struct {
Container string
Name string
@@ -53,6 +60,8 @@
Params map[string]string
}
+// UpdateOpts is a structure that holds parameters for updating, creating, or deleting an
+// object's metadata.
type UpdateOpts struct {
Container string
Name string
diff --git a/openstack/storage/v1/objects/requests.go b/openstack/storage/v1/objects/requests.go
index 615a59d..a7dff40 100644
--- a/openstack/storage/v1/objects/requests.go
+++ b/openstack/storage/v1/objects/requests.go
@@ -8,8 +8,13 @@
"net/http"
)
+// ListResult is a *http.Response that is returned from a call to the List function.
type ListResult *http.Response
+
+// DownloadResult is a *http.Response that is returned from a call to the Download function.
type DownloadResult *http.Response
+
+// GetResult is a *http.Response that is returned from a call to the Get function.
type GetResult *http.Response
// List is a function that retrieves all objects in a container. It also returns the details
@@ -32,7 +37,6 @@
url := c.GetContainerURL(opts.Container) + query
resp, err := perigee.Request("GET", url, perigee.Options{
MoreHeaders: h,
- OkCodes: []int{200, 204},
Accept: contentType,
})
return &resp.HttpResponse, err
@@ -56,7 +60,6 @@
url := c.GetObjectURL(opts.Container, opts.Name) + query
resp, err := perigee.Request("GET", url, perigee.Options{
MoreHeaders: h,
- OkCodes: []int{200},
})
return &resp.HttpResponse, err
}
@@ -93,7 +96,6 @@
_, err = perigee.Request("PUT", url, perigee.Options{
ReqBody: reqBody,
MoreHeaders: h,
- OkCodes: []int{201},
})
return err
}
@@ -114,7 +116,6 @@
url := c.GetObjectURL(opts.Container, opts.Name)
_, err = perigee.Request("COPY", url, perigee.Options{
MoreHeaders: h,
- OkCodes: []int{201},
})
return err
}
@@ -131,7 +132,6 @@
url := c.GetObjectURL(opts.Container, opts.Name) + query
_, err = perigee.Request("DELETE", url, perigee.Options{
MoreHeaders: h,
- OkCodes: []int{204},
})
return err
}
@@ -151,7 +151,6 @@
url := c.GetObjectURL(opts.Container, opts.Name)
resp, err := perigee.Request("HEAD", url, perigee.Options{
MoreHeaders: h,
- OkCodes: []int{204},
})
return &resp.HttpResponse, err
}
@@ -174,7 +173,6 @@
url := c.GetObjectURL(opts.Container, opts.Name)
_, err = perigee.Request("POST", url, perigee.Options{
MoreHeaders: h,
- OkCodes: []int{202, 204},
})
return err
}