vendor: update qingstor
dep ensure needed to do this, probably after various vendor merges
This commit is contained in:
+74
-36
@@ -19,6 +19,7 @@ package service
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/yunify/qingstor-sdk-go/config"
|
||||
@@ -29,6 +30,7 @@ import (
|
||||
|
||||
var _ fmt.State
|
||||
var _ io.Reader
|
||||
var _ http.Header
|
||||
var _ time.Time
|
||||
var _ config.Config
|
||||
|
||||
@@ -62,7 +64,7 @@ func (s *Bucket) Delete() (*DeleteBucketOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -71,9 +73,11 @@ func (s *Bucket) Delete() (*DeleteBucketOutput, error) {
|
||||
// DeleteRequest creates request and output object of DeleteBucket.
|
||||
func (s *Bucket) DeleteRequest() (*request.Request, *DeleteBucketOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "DELETE Bucket",
|
||||
RequestMethod: "DELETE",
|
||||
RequestURI: "/<bucket-name>",
|
||||
@@ -112,7 +116,7 @@ func (s *Bucket) DeleteCORS() (*DeleteBucketCORSOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -121,9 +125,11 @@ func (s *Bucket) DeleteCORS() (*DeleteBucketCORSOutput, error) {
|
||||
// DeleteCORSRequest creates request and output object of DeleteBucketCORS.
|
||||
func (s *Bucket) DeleteCORSRequest() (*request.Request, *DeleteBucketCORSOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "DELETE Bucket CORS",
|
||||
RequestMethod: "DELETE",
|
||||
RequestURI: "/<bucket-name>?cors",
|
||||
@@ -162,7 +168,7 @@ func (s *Bucket) DeleteExternalMirror() (*DeleteBucketExternalMirrorOutput, erro
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -171,9 +177,11 @@ func (s *Bucket) DeleteExternalMirror() (*DeleteBucketExternalMirrorOutput, erro
|
||||
// DeleteExternalMirrorRequest creates request and output object of DeleteBucketExternalMirror.
|
||||
func (s *Bucket) DeleteExternalMirrorRequest() (*request.Request, *DeleteBucketExternalMirrorOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "DELETE Bucket External Mirror",
|
||||
RequestMethod: "DELETE",
|
||||
RequestURI: "/<bucket-name>?mirror",
|
||||
@@ -212,7 +220,7 @@ func (s *Bucket) DeletePolicy() (*DeleteBucketPolicyOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -221,9 +229,11 @@ func (s *Bucket) DeletePolicy() (*DeleteBucketPolicyOutput, error) {
|
||||
// DeletePolicyRequest creates request and output object of DeleteBucketPolicy.
|
||||
func (s *Bucket) DeletePolicyRequest() (*request.Request, *DeleteBucketPolicyOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "DELETE Bucket Policy",
|
||||
RequestMethod: "DELETE",
|
||||
RequestURI: "/<bucket-name>?policy",
|
||||
@@ -262,7 +272,7 @@ func (s *Bucket) DeleteMultipleObjects(input *DeleteMultipleObjectsInput) (*Dele
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -275,9 +285,11 @@ func (s *Bucket) DeleteMultipleObjectsRequest(input *DeleteMultipleObjectsInput)
|
||||
input = &DeleteMultipleObjectsInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "Delete Multiple Objects",
|
||||
RequestMethod: "POST",
|
||||
RequestURI: "/<bucket-name>?delete",
|
||||
@@ -351,7 +363,7 @@ func (s *Bucket) GetACL() (*GetBucketACLOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -360,9 +372,11 @@ func (s *Bucket) GetACL() (*GetBucketACLOutput, error) {
|
||||
// GetACLRequest creates request and output object of GetBucketACL.
|
||||
func (s *Bucket) GetACLRequest() (*request.Request, *GetBucketACLOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Bucket ACL",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>?acl",
|
||||
@@ -406,7 +420,7 @@ func (s *Bucket) GetCORS() (*GetBucketCORSOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -415,9 +429,11 @@ func (s *Bucket) GetCORS() (*GetBucketCORSOutput, error) {
|
||||
// GetCORSRequest creates request and output object of GetBucketCORS.
|
||||
func (s *Bucket) GetCORSRequest() (*request.Request, *GetBucketCORSOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Bucket CORS",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>?cors",
|
||||
@@ -459,7 +475,7 @@ func (s *Bucket) GetExternalMirror() (*GetBucketExternalMirrorOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -468,9 +484,11 @@ func (s *Bucket) GetExternalMirror() (*GetBucketExternalMirrorOutput, error) {
|
||||
// GetExternalMirrorRequest creates request and output object of GetBucketExternalMirror.
|
||||
func (s *Bucket) GetExternalMirrorRequest() (*request.Request, *GetBucketExternalMirrorOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Bucket External Mirror",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>?mirror",
|
||||
@@ -512,7 +530,7 @@ func (s *Bucket) GetPolicy() (*GetBucketPolicyOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -521,9 +539,11 @@ func (s *Bucket) GetPolicy() (*GetBucketPolicyOutput, error) {
|
||||
// GetPolicyRequest creates request and output object of GetBucketPolicy.
|
||||
func (s *Bucket) GetPolicyRequest() (*request.Request, *GetBucketPolicyOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Bucket Policy",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>?policy",
|
||||
@@ -565,7 +585,7 @@ func (s *Bucket) GetStatistics() (*GetBucketStatisticsOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -574,9 +594,11 @@ func (s *Bucket) GetStatistics() (*GetBucketStatisticsOutput, error) {
|
||||
// GetStatisticsRequest creates request and output object of GetBucketStatistics.
|
||||
func (s *Bucket) GetStatisticsRequest() (*request.Request, *GetBucketStatisticsOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Bucket Statistics",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>?stats",
|
||||
@@ -631,7 +653,7 @@ func (s *Bucket) Head() (*HeadBucketOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -640,9 +662,11 @@ func (s *Bucket) Head() (*HeadBucketOutput, error) {
|
||||
// HeadRequest creates request and output object of HeadBucket.
|
||||
func (s *Bucket) HeadRequest() (*request.Request, *HeadBucketOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "HEAD Bucket",
|
||||
RequestMethod: "HEAD",
|
||||
RequestURI: "/<bucket-name>",
|
||||
@@ -681,7 +705,7 @@ func (s *Bucket) ListMultipartUploads(input *ListMultipartUploadsInput) (*ListMu
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -694,9 +718,11 @@ func (s *Bucket) ListMultipartUploadsRequest(input *ListMultipartUploadsInput) (
|
||||
input = &ListMultipartUploadsInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "List Multipart Uploads",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>?uploads",
|
||||
@@ -770,7 +796,7 @@ func (s *Bucket) ListObjects(input *ListObjectsInput) (*ListObjectsOutput, error
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -783,9 +809,11 @@ func (s *Bucket) ListObjectsRequest(input *ListObjectsInput) (*request.Request,
|
||||
input = &ListObjectsInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Bucket (List Objects)",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>",
|
||||
@@ -861,7 +889,7 @@ func (s *Bucket) Put() (*PutBucketOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -870,9 +898,11 @@ func (s *Bucket) Put() (*PutBucketOutput, error) {
|
||||
// PutRequest creates request and output object of PutBucket.
|
||||
func (s *Bucket) PutRequest() (*request.Request, *PutBucketOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "PUT Bucket",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>",
|
||||
@@ -911,7 +941,7 @@ func (s *Bucket) PutACL(input *PutBucketACLInput) (*PutBucketACLOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -924,9 +954,11 @@ func (s *Bucket) PutACLRequest(input *PutBucketACLInput) (*request.Request, *Put
|
||||
input = &PutBucketACLInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "PUT Bucket ACL",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>?acl",
|
||||
@@ -993,7 +1025,7 @@ func (s *Bucket) PutCORS(input *PutBucketCORSInput) (*PutBucketCORSOutput, error
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -1006,9 +1038,11 @@ func (s *Bucket) PutCORSRequest(input *PutBucketCORSInput) (*request.Request, *P
|
||||
input = &PutBucketCORSInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "PUT Bucket CORS",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>?cors",
|
||||
@@ -1075,7 +1109,7 @@ func (s *Bucket) PutExternalMirror(input *PutBucketExternalMirrorInput) (*PutBuc
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -1088,9 +1122,11 @@ func (s *Bucket) PutExternalMirrorRequest(input *PutBucketExternalMirrorInput) (
|
||||
input = &PutBucketExternalMirrorInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "PUT Bucket External Mirror",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>?mirror",
|
||||
@@ -1149,7 +1185,7 @@ func (s *Bucket) PutPolicy(input *PutBucketPolicyInput) (*PutBucketPolicyOutput,
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -1162,9 +1198,11 @@ func (s *Bucket) PutPolicyRequest(input *PutBucketPolicyInput) (*request.Request
|
||||
input = &PutBucketPolicyInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "PUT Bucket Policy",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>?policy",
|
||||
|
||||
+62
-40
@@ -19,6 +19,7 @@ package service
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/yunify/qingstor-sdk-go/config"
|
||||
@@ -29,6 +30,7 @@ import (
|
||||
|
||||
var _ fmt.State
|
||||
var _ io.Reader
|
||||
var _ http.Header
|
||||
var _ time.Time
|
||||
var _ config.Config
|
||||
|
||||
@@ -46,7 +48,7 @@ func (s *Bucket) AbortMultipartUpload(objectKey string, input *AbortMultipartUpl
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -59,9 +61,13 @@ func (s *Bucket) AbortMultipartUploadRequest(objectKey string, input *AbortMulti
|
||||
input = &AbortMultipartUploadInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "Abort Multipart Upload",
|
||||
RequestMethod: "DELETE",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -70,8 +76,6 @@ func (s *Bucket) AbortMultipartUploadRequest(objectKey string, input *AbortMulti
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &AbortMultipartUploadOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -122,7 +126,7 @@ func (s *Bucket) CompleteMultipartUpload(objectKey string, input *CompleteMultip
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -135,9 +139,13 @@ func (s *Bucket) CompleteMultipartUploadRequest(objectKey string, input *Complet
|
||||
input = &CompleteMultipartUploadInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "Complete multipart upload",
|
||||
RequestMethod: "POST",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -146,8 +154,6 @@ func (s *Bucket) CompleteMultipartUploadRequest(objectKey string, input *Complet
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &CompleteMultipartUploadOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -217,7 +223,7 @@ func (s *Bucket) DeleteObject(objectKey string) (*DeleteObjectOutput, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -226,9 +232,13 @@ func (s *Bucket) DeleteObject(objectKey string) (*DeleteObjectOutput, error) {
|
||||
// DeleteObjectRequest creates request and output object of DeleteObject.
|
||||
func (s *Bucket) DeleteObjectRequest(objectKey string) (*request.Request, *DeleteObjectOutput, error) {
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "DELETE Object",
|
||||
RequestMethod: "DELETE",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -237,8 +247,6 @@ func (s *Bucket) DeleteObjectRequest(objectKey string) (*request.Request, *Delet
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &DeleteObjectOutput{}
|
||||
r, err := request.New(o, nil, x)
|
||||
if err != nil {
|
||||
@@ -269,7 +277,7 @@ func (s *Bucket) GetObject(objectKey string, input *GetObjectInput) (*GetObjectO
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -282,9 +290,13 @@ func (s *Bucket) GetObjectRequest(objectKey string, input *GetObjectInput) (*req
|
||||
input = &GetObjectInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "GET Object",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -296,8 +308,6 @@ func (s *Bucket) GetObjectRequest(objectKey string, input *GetObjectInput) (*req
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &GetObjectOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -379,7 +389,7 @@ func (s *Bucket) HeadObject(objectKey string, input *HeadObjectInput) (*HeadObje
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -392,9 +402,13 @@ func (s *Bucket) HeadObjectRequest(objectKey string, input *HeadObjectInput) (*r
|
||||
input = &HeadObjectInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "HEAD Object",
|
||||
RequestMethod: "HEAD",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -403,8 +417,6 @@ func (s *Bucket) HeadObjectRequest(objectKey string, input *HeadObjectInput) (*r
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &HeadObjectOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -469,7 +481,7 @@ func (s *Bucket) InitiateMultipartUpload(objectKey string, input *InitiateMultip
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -482,9 +494,13 @@ func (s *Bucket) InitiateMultipartUploadRequest(objectKey string, input *Initiat
|
||||
input = &InitiateMultipartUploadInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "Initiate Multipart Upload",
|
||||
RequestMethod: "POST",
|
||||
RequestURI: "/<bucket-name>/<object-key>?uploads",
|
||||
@@ -493,8 +509,6 @@ func (s *Bucket) InitiateMultipartUploadRequest(objectKey string, input *Initiat
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &InitiateMultipartUploadOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -553,7 +567,7 @@ func (s *Bucket) ListMultipart(objectKey string, input *ListMultipartInput) (*Li
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -566,9 +580,13 @@ func (s *Bucket) ListMultipartRequest(objectKey string, input *ListMultipartInpu
|
||||
input = &ListMultipartInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "List Multipart",
|
||||
RequestMethod: "GET",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -577,8 +595,6 @@ func (s *Bucket) ListMultipartRequest(objectKey string, input *ListMultipartInpu
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &ListMultipartOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -638,7 +654,7 @@ func (s *Bucket) OptionsObject(objectKey string, input *OptionsObjectInput) (*Op
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -651,9 +667,13 @@ func (s *Bucket) OptionsObjectRequest(objectKey string, input *OptionsObjectInpu
|
||||
input = &OptionsObjectInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "OPTIONS Object",
|
||||
RequestMethod: "OPTIONS",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -662,8 +682,6 @@ func (s *Bucket) OptionsObjectRequest(objectKey string, input *OptionsObjectInpu
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &OptionsObjectOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -736,7 +754,7 @@ func (s *Bucket) PutObject(objectKey string, input *PutObjectInput) (*PutObjectO
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -749,9 +767,13 @@ func (s *Bucket) PutObjectRequest(objectKey string, input *PutObjectInput) (*req
|
||||
input = &PutObjectInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "PUT Object",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -760,8 +782,6 @@ func (s *Bucket) PutObjectRequest(objectKey string, input *PutObjectInput) (*req
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &PutObjectOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
@@ -841,7 +861,7 @@ func (s *Bucket) UploadMultipart(objectKey string, input *UploadMultipartInput)
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
@@ -854,9 +874,13 @@ func (s *Bucket) UploadMultipartRequest(objectKey string, input *UploadMultipart
|
||||
input = &UploadMultipartInput{}
|
||||
}
|
||||
|
||||
properties := *s.Properties
|
||||
|
||||
properties.ObjectKey = &objectKey
|
||||
|
||||
o := &data.Operation{
|
||||
Config: s.Config,
|
||||
Properties: s.Properties,
|
||||
Properties: &properties,
|
||||
APIName: "Upload Multipart",
|
||||
RequestMethod: "PUT",
|
||||
RequestURI: "/<bucket-name>/<object-key>",
|
||||
@@ -865,8 +889,6 @@ func (s *Bucket) UploadMultipartRequest(objectKey string, input *UploadMultipart
|
||||
},
|
||||
}
|
||||
|
||||
s.Properties.ObjectKey = &objectKey
|
||||
|
||||
x := &UploadMultipartOutput{}
|
||||
r, err := request.New(o, input, x)
|
||||
if err != nil {
|
||||
|
||||
+5
-1
@@ -18,11 +18,15 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/yunify/qingstor-sdk-go/config"
|
||||
"github.com/yunify/qingstor-sdk-go/request"
|
||||
"github.com/yunify/qingstor-sdk-go/request/data"
|
||||
)
|
||||
|
||||
var _ http.Header
|
||||
|
||||
// Service QingStor provides low-cost and reliable online storage service with unlimited storage space, high read and write performance, high reliability and data safety, fine-grained access control, and easy to use API.
|
||||
type Service struct {
|
||||
Config *config.Config
|
||||
@@ -47,7 +51,7 @@ func (s *Service) ListBuckets(input *ListBucketsInput) (*ListBucketsOutput, erro
|
||||
return nil, err
|
||||
}
|
||||
|
||||
requestID := r.HTTPResponse.Header.Get("X-Qs-Request-Id")
|
||||
requestID := r.HTTPResponse.Header.Get(http.CanonicalHeaderKey("X-QS-Request-ID"))
|
||||
x.RequestID = &requestID
|
||||
|
||||
return x, err
|
||||
|
||||
Reference in New Issue
Block a user