diff --git a/models/apis/s3/2006-03-01/api-2.json b/models/apis/s3/2006-03-01/api-2.json index 04015d257a4..66a9f6ec12e 100644 --- a/models/apis/s3/2006-03-01/api-2.json +++ b/models/apis/s3/2006-03-01/api-2.json @@ -158,6 +158,15 @@ "documentationUrl":"http://docs.amazonwebservices.com/AmazonS3/latest/API/multiobjectdeleteapi.html", "alias":"DeleteMultipleObjects" }, + "GetBucketAccelerateConfiguration":{ + "name":"GetBucketAccelerateConfiguration", + "http":{ + "method":"GET", + "requestUri":"/{Bucket}?accelerate" + }, + "input":{"shape":"GetBucketAccelerateConfigurationRequest"}, + "output":{"shape":"GetBucketAccelerateConfigurationOutput"} + }, "GetBucketAcl":{ "name":"GetBucketAcl", "http":{ @@ -413,6 +422,14 @@ "output":{"shape":"ListPartsOutput"}, "documentationUrl":"http://docs.amazonwebservices.com/AmazonS3/latest/API/mpUploadListParts.html" }, + "PutBucketAccelerateConfiguration":{ + "name":"PutBucketAccelerateConfiguration", + "http":{ + "method":"PUT", + "requestUri":"/{Bucket}?accelerate" + }, + "input":{"shape":"PutBucketAccelerateConfigurationRequest"} + }, "PutBucketAcl":{ "name":"PutBucketAcl", "http":{ @@ -636,6 +653,12 @@ } }, "AbortRuleId":{"type":"string"}, + "AccelerateConfiguration":{ + "type":"structure", + "members":{ + "Status":{"shape":"BucketAccelerateStatus"} + } + }, "AcceptRanges":{"type":"string"}, "AccessControlPolicy":{ "type":"structure", @@ -673,6 +696,13 @@ "CreationDate":{"shape":"CreationDate"} } }, + "BucketAccelerateStatus":{ + "type":"string", + "enum":[ + "Enabled", + "Suspended" + ] + }, "BucketAlreadyExists":{ "type":"structure", "members":{ @@ -1712,6 +1742,23 @@ ] }, "FilterRuleValue":{"type":"string"}, + "GetBucketAccelerateConfigurationOutput":{ + "type":"structure", + "members":{ + "Status":{"shape":"BucketAccelerateStatus"} + } + }, + "GetBucketAccelerateConfigurationRequest":{ + "type":"structure", + "required":["Bucket"], + "members":{ + "Bucket":{ + "shape":"BucketName", + "location":"uri", + "locationName":"Bucket" + } + } + }, "GetBucketAclOutput":{ "type":"structure", "members":{ @@ -3142,6 +3189,26 @@ "https" ] }, + "PutBucketAccelerateConfigurationRequest":{ + "type":"structure", + "required":[ + "Bucket", + "AccelerateConfiguration" + ], + "members":{ + "Bucket":{ + "shape":"BucketName", + "location":"uri", + "locationName":"Bucket" + }, + "AccelerateConfiguration":{ + "shape":"AccelerateConfiguration", + "locationName":"AccelerateConfiguration", + "xmlNamespace":{"uri":"http://s3.amazonaws.com/doc/2006-03-01/"} + } + }, + "payload":"AccelerateConfiguration" + }, "PutBucketAclRequest":{ "type":"structure", "required":["Bucket"], @@ -3550,6 +3617,11 @@ "shape":"RequestPayer", "location":"header", "locationName":"x-amz-request-payer" + }, + "VersionId":{ + "shape":"ObjectVersionId", + "location":"querystring", + "locationName":"versionId" } }, "payload":"AccessControlPolicy" diff --git a/models/apis/s3/2006-03-01/docs-2.json b/models/apis/s3/2006-03-01/docs-2.json index 72eb16eaef7..b57d6538981 100644 --- a/models/apis/s3/2006-03-01/docs-2.json +++ b/models/apis/s3/2006-03-01/docs-2.json @@ -16,6 +16,7 @@ "DeleteBucketWebsite": "This operation removes the website configuration from the bucket.", "DeleteObject": "Removes the null version (if there is one) of an object and inserts a delete marker, which becomes the latest version of the object. If there isn't a null version, Amazon S3 does not remove any objects.", "DeleteObjects": "This operation enables you to delete multiple objects from a bucket using a single HTTP request. You may specify up to 1000 keys.", + "GetBucketAccelerateConfiguration": "Returns the accelerate configuration of a bucket.", "GetBucketAcl": "Gets the access control policy for the bucket.", "GetBucketCors": "Returns the cors configuration for the bucket.", "GetBucketLifecycle": "Deprecated, see the GetBucketLifecycleConfiguration operation.", @@ -40,6 +41,7 @@ "ListObjectVersions": "Returns metadata about all of the versions of objects in a bucket.", "ListObjects": "Returns some or all (up to 1000) of the objects in a bucket. You can use the request parameters as selection criteria to return a subset of the objects in a bucket.", "ListParts": "Lists the parts that have been uploaded for a specific multipart upload.", + "PutBucketAccelerateConfiguration": "Sets the accelerate configuration of an existing bucket.", "PutBucketAcl": "Sets the permissions on a bucket using access control lists (ACL).", "PutBucketCors": "Sets the cors configuration for a bucket.", "PutBucketLifecycle": "Deprecated, see the PutBucketLifecycleConfiguration operation.", @@ -91,6 +93,12 @@ "ListPartsOutput$AbortRuleId": "Id of the lifecycle rule that makes a multipart upload eligible for abort operation." } }, + "AccelerateConfiguration": { + "base": null, + "refs": { + "PutBucketAccelerateConfigurationRequest$AccelerateConfiguration": "Specifies the Accelerate Configuration you want to set for the bucket." + } + }, "AcceptRanges": { "base": null, "refs": { @@ -156,6 +164,13 @@ "Buckets$member": null } }, + "BucketAccelerateStatus": { + "base": null, + "refs": { + "AccelerateConfiguration$Status": "The accelerate configuration of the bucket.", + "GetBucketAccelerateConfigurationOutput$Status": "The accelerate configuration of the bucket." + } + }, "BucketAlreadyExists": { "base": "The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.", "refs": { @@ -219,6 +234,7 @@ "DeleteObjectRequest$Bucket": null, "DeleteObjectsRequest$Bucket": null, "Destination$Bucket": "Amazon resource name (ARN) of the bucket where you want Amazon S3 to store replicas of the object identified by the rule.", + "GetBucketAccelerateConfigurationRequest$Bucket": "Name of the bucket for which the accelerate configuration is retrieved.", "GetBucketAclRequest$Bucket": null, "GetBucketCorsRequest$Bucket": null, "GetBucketLifecycleConfigurationRequest$Bucket": null, @@ -245,6 +261,7 @@ "ListObjectsRequest$Bucket": null, "ListPartsOutput$Bucket": "Name of the bucket to which the multipart upload was initiated.", "ListPartsRequest$Bucket": null, + "PutBucketAccelerateConfigurationRequest$Bucket": "Name of the bucket for which the accelerate configuration is set.", "PutBucketAclRequest$Bucket": null, "PutBucketCorsRequest$Bucket": null, "PutBucketLifecycleConfigurationRequest$Bucket": null, @@ -865,6 +882,16 @@ "FilterRule$Value": null } }, + "GetBucketAccelerateConfigurationOutput": { + "base": null, + "refs": { + } + }, + "GetBucketAccelerateConfigurationRequest": { + "base": null, + "refs": { + } + }, "GetBucketAclOutput": { "base": null, "refs": { @@ -1656,6 +1683,7 @@ "HeadObjectRequest$VersionId": "VersionId used to reference a specific version of the object.", "ObjectIdentifier$VersionId": "VersionId for the specific version of the object to delete.", "ObjectVersion$VersionId": "Version ID of an object.", + "PutObjectAclRequest$VersionId": "VersionId used to reference a specific version of the object.", "PutObjectOutput$VersionId": "Version of the object.", "RestoreObjectRequest$VersionId": null } @@ -1756,6 +1784,11 @@ "RedirectAllRequestsTo$Protocol": "Protocol to use (http, https) when redirecting requests. The default is the protocol that is used in the original request." } }, + "PutBucketAccelerateConfigurationRequest": { + "base": null, + "refs": { + } + }, "PutBucketAclRequest": { "base": null, "refs": { diff --git a/service/s3/api.go b/service/s3/api.go index 4f170986b9b..224bbd9e977 100644 --- a/service/s3/api.go +++ b/service/s3/api.go @@ -419,6 +419,33 @@ func (c *S3) DeleteObjects(input *DeleteObjectsInput) (*DeleteObjectsOutput, err return out, err } +const opGetBucketAccelerateConfiguration = "GetBucketAccelerateConfiguration" + +// GetBucketAccelerateConfigurationRequest generates a request for the GetBucketAccelerateConfiguration operation. +func (c *S3) GetBucketAccelerateConfigurationRequest(input *GetBucketAccelerateConfigurationInput) (req *request.Request, output *GetBucketAccelerateConfigurationOutput) { + op := &request.Operation{ + Name: opGetBucketAccelerateConfiguration, + HTTPMethod: "GET", + HTTPPath: "/{Bucket}?accelerate", + } + + if input == nil { + input = &GetBucketAccelerateConfigurationInput{} + } + + req = c.newRequest(op, input, output) + output = &GetBucketAccelerateConfigurationOutput{} + req.Data = output + return +} + +// Returns the accelerate configuration of a bucket. +func (c *S3) GetBucketAccelerateConfiguration(input *GetBucketAccelerateConfigurationInput) (*GetBucketAccelerateConfigurationOutput, error) { + req, out := c.GetBucketAccelerateConfigurationRequest(input) + err := req.Send() + return out, err +} + const opGetBucketAcl = "GetBucketAcl" // GetBucketAclRequest generates a request for the GetBucketAcl operation. @@ -1137,6 +1164,35 @@ func (c *S3) ListPartsPages(input *ListPartsInput, fn func(p *ListPartsOutput, l }) } +const opPutBucketAccelerateConfiguration = "PutBucketAccelerateConfiguration" + +// PutBucketAccelerateConfigurationRequest generates a request for the PutBucketAccelerateConfiguration operation. +func (c *S3) PutBucketAccelerateConfigurationRequest(input *PutBucketAccelerateConfigurationInput) (req *request.Request, output *PutBucketAccelerateConfigurationOutput) { + op := &request.Operation{ + Name: opPutBucketAccelerateConfiguration, + HTTPMethod: "PUT", + HTTPPath: "/{Bucket}?accelerate", + } + + if input == nil { + input = &PutBucketAccelerateConfigurationInput{} + } + + req = c.newRequest(op, input, output) + req.Handlers.Unmarshal.Remove(restxml.UnmarshalHandler) + req.Handlers.Unmarshal.PushBackNamed(protocol.UnmarshalDiscardBodyHandler) + output = &PutBucketAccelerateConfigurationOutput{} + req.Data = output + return +} + +// Sets the accelerate configuration of an existing bucket. +func (c *S3) PutBucketAccelerateConfiguration(input *PutBucketAccelerateConfigurationInput) (*PutBucketAccelerateConfigurationOutput, error) { + req, out := c.PutBucketAccelerateConfigurationRequest(input) + err := req.Send() + return out, err +} + const opPutBucketAcl = "PutBucketAcl" // PutBucketAclRequest generates a request for the PutBucketAcl operation. @@ -1736,6 +1792,23 @@ func (s AbortMultipartUploadOutput) GoString() string { return s.String() } +type AccelerateConfiguration struct { + _ struct{} `type:"structure"` + + // The accelerate configuration of the bucket. + Status *string `type:"string" enum:"BucketAccelerateStatus"` +} + +// String returns the string representation +func (s AccelerateConfiguration) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s AccelerateConfiguration) GoString() string { + return s.String() +} + type AccessControlPolicy struct { _ struct{} `type:"structure"` @@ -2939,6 +3012,40 @@ func (s FilterRule) GoString() string { return s.String() } +type GetBucketAccelerateConfigurationInput struct { + _ struct{} `type:"structure"` + + // Name of the bucket for which the accelerate configuration is retrieved. + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s GetBucketAccelerateConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAccelerateConfigurationInput) GoString() string { + return s.String() +} + +type GetBucketAccelerateConfigurationOutput struct { + _ struct{} `type:"structure"` + + // The accelerate configuration of the bucket. + Status *string `type:"string" enum:"BucketAccelerateStatus"` +} + +// String returns the string representation +func (s GetBucketAccelerateConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s GetBucketAccelerateConfigurationOutput) GoString() string { + return s.String() +} + type GetBucketAclInput struct { _ struct{} `type:"structure"` @@ -4758,6 +4865,40 @@ func (s Part) GoString() string { return s.String() } +type PutBucketAccelerateConfigurationInput struct { + _ struct{} `type:"structure" payload:"AccelerateConfiguration"` + + // Specifies the Accelerate Configuration you want to set for the bucket. + AccelerateConfiguration *AccelerateConfiguration `locationName:"AccelerateConfiguration" type:"structure" required:"true"` + + // Name of the bucket for which the accelerate configuration is set. + Bucket *string `location:"uri" locationName:"Bucket" type:"string" required:"true"` +} + +// String returns the string representation +func (s PutBucketAccelerateConfigurationInput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAccelerateConfigurationInput) GoString() string { + return s.String() +} + +type PutBucketAccelerateConfigurationOutput struct { + _ struct{} `type:"structure"` +} + +// String returns the string representation +func (s PutBucketAccelerateConfigurationOutput) String() string { + return awsutil.Prettify(s) +} + +// GoString returns the string representation +func (s PutBucketAccelerateConfigurationOutput) GoString() string { + return s.String() +} + type PutBucketAclInput struct { _ struct{} `type:"structure" payload:"AccessControlPolicy"` @@ -5235,6 +5376,9 @@ type PutObjectAclInput struct { // Documentation on downloading objects from requester pays buckets can be found // at http://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html RequestPayer *string `location:"header" locationName:"x-amz-request-payer" type:"string" enum:"RequestPayer"` + + // VersionId used to reference a specific version of the object. + VersionId *string `location:"querystring" locationName:"versionId" type:"string"` } // String returns the string representation @@ -6135,6 +6279,13 @@ func (s WebsiteConfiguration) GoString() string { return s.String() } +const ( + // @enum BucketAccelerateStatus + BucketAccelerateStatusEnabled = "Enabled" + // @enum BucketAccelerateStatus + BucketAccelerateStatusSuspended = "Suspended" +) + const ( // @enum BucketCannedACL BucketCannedACLPrivate = "private" diff --git a/service/s3/examples_test.go b/service/s3/examples_test.go index 61a5fdc7849..bbc67ba37d1 100644 --- a/service/s3/examples_test.go +++ b/service/s3/examples_test.go @@ -378,6 +378,25 @@ func ExampleS3_DeleteObjects() { fmt.Println(resp) } +func ExampleS3_GetBucketAccelerateConfiguration() { + svc := s3.New(session.New()) + + params := &s3.GetBucketAccelerateConfigurationInput{ + Bucket: aws.String("BucketName"), // Required + } + resp, err := svc.GetBucketAccelerateConfiguration(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + func ExampleS3_GetBucketAcl() { svc := s3.New(session.New()) @@ -887,6 +906,28 @@ func ExampleS3_ListParts() { fmt.Println(resp) } +func ExampleS3_PutBucketAccelerateConfiguration() { + svc := s3.New(session.New()) + + params := &s3.PutBucketAccelerateConfigurationInput{ + AccelerateConfiguration: &s3.AccelerateConfiguration{ // Required + Status: aws.String("BucketAccelerateStatus"), + }, + Bucket: aws.String("BucketName"), // Required + } + resp, err := svc.PutBucketAccelerateConfiguration(params) + + if err != nil { + // Print the error, cast err to awserr.Error to get the Code and + // Message from an error. + fmt.Println(err.Error()) + return + } + + // Pretty-print the response data. + fmt.Println(resp) +} + func ExampleS3_PutBucketAcl() { svc := s3.New(session.New()) @@ -1504,6 +1545,7 @@ func ExampleS3_PutObjectAcl() { GrantWrite: aws.String("GrantWrite"), GrantWriteACP: aws.String("GrantWriteACP"), RequestPayer: aws.String("RequestPayer"), + VersionId: aws.String("ObjectVersionId"), } resp, err := svc.PutObjectAcl(params) diff --git a/service/s3/s3iface/interface.go b/service/s3/s3iface/interface.go index 9e66afb3456..f271294898c 100644 --- a/service/s3/s3iface/interface.go +++ b/service/s3/s3iface/interface.go @@ -66,6 +66,10 @@ type S3API interface { DeleteObjects(*s3.DeleteObjectsInput) (*s3.DeleteObjectsOutput, error) + GetBucketAccelerateConfigurationRequest(*s3.GetBucketAccelerateConfigurationInput) (*request.Request, *s3.GetBucketAccelerateConfigurationOutput) + + GetBucketAccelerateConfiguration(*s3.GetBucketAccelerateConfigurationInput) (*s3.GetBucketAccelerateConfigurationOutput, error) + GetBucketAclRequest(*s3.GetBucketAclInput) (*request.Request, *s3.GetBucketAclOutput) GetBucketAcl(*s3.GetBucketAclInput) (*s3.GetBucketAclOutput, error) @@ -170,6 +174,10 @@ type S3API interface { ListPartsPages(*s3.ListPartsInput, func(*s3.ListPartsOutput, bool) bool) error + PutBucketAccelerateConfigurationRequest(*s3.PutBucketAccelerateConfigurationInput) (*request.Request, *s3.PutBucketAccelerateConfigurationOutput) + + PutBucketAccelerateConfiguration(*s3.PutBucketAccelerateConfigurationInput) (*s3.PutBucketAccelerateConfigurationOutput, error) + PutBucketAclRequest(*s3.PutBucketAclInput) (*request.Request, *s3.PutBucketAclOutput) PutBucketAcl(*s3.PutBucketAclInput) (*s3.PutBucketAclOutput, error)