chore: upgrade dependencies

This commit is contained in:
2022-06-09 12:30:53 +02:00
parent 7203f3d6a1
commit dcb93ec8f7
518 changed files with 27809 additions and 3222 deletions

View File

@@ -1,3 +1,94 @@
# v1.26.11 (2022-06-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.10 (2022-05-17)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.9 (2022-05-06)
* No change notes available for this release.
# v1.26.8 (2022-05-03)
* **Documentation**: Documentation only update for doc bug fixes for the S3 API docs.
# v1.26.7 (2022-04-27)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.6 (2022-04-25)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.5 (2022-04-12)
* **Bug Fix**: Fixes an issue that caused the unexported constructor function names for EventStream types to be swapped for the event reader and writer respectivly.
# v1.26.4 (2022-04-07)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.3 (2022-03-30)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.2 (2022-03-24)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.1 (2022-03-23)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.26.0 (2022-03-08)
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
* **Dependency Update**: Updated to the latest SDK module versions
# v1.25.0 (2022-02-24)
* **Feature**: API client updated
* **Feature**: Adds RetryMaxAttempts and RetryMod to API client Options. This allows the API clients' default Retryer to be configured from the shared configuration files or environment variables. Adding a new Retry mode of `Adaptive`. `Adaptive` retry mode is an experimental mode, adding client rate limiting when throttles reponses are received from an API. See [retry.AdaptiveMode](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/aws/retry#AdaptiveMode) for more details, and configuration options.
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
* **Bug Fix**: Fixes the AWS Sigv4 signer to trim header value's whitespace when computing the canonical headers block of the string to sign.
* **Dependency Update**: Updated to the latest SDK module versions
# v1.24.1 (2022-01-28)
* **Bug Fix**: Updates SDK API client deserialization to pre-allocate byte slice and string response payloads, [#1565](https://github.com/aws/aws-sdk-go-v2/pull/1565). Thanks to [Tyson Mote](https://github.com/tysonmote) for submitting this PR.
# v1.24.0 (2022-01-14)
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
* **Dependency Update**: Updated to the latest SDK module versions
# v1.23.0 (2022-01-07)
* **Feature**: Updated `github.com/aws/smithy-go` to latest version
* **Documentation**: API client updated
* **Dependency Update**: Updated to the latest SDK module versions
# v1.22.0 (2021-12-21)
* **Feature**: API Paginators now support specifying the initial starting token, and support stopping on empty string tokens.
* **Feature**: Updated to latest service endpoints
# v1.21.0 (2021-12-02)
* **Feature**: API client updated
* **Bug Fix**: Fixes a bug that prevented aws.EndpointResolverWithOptions from being used by the service client. ([#1514](https://github.com/aws/aws-sdk-go-v2/pull/1514))
* **Dependency Update**: Updated to the latest SDK module versions
# v1.20.0 (2021-11-30)
* **Feature**: API client updated
# v1.19.1 (2021-11-19)
* **Dependency Update**: Updated to the latest SDK module versions
# v1.19.0 (2021-11-12)
* **Feature**: Waiters now have a `WaitForOutput` method, which can be used to retrieve the output of the successful wait operation. Thank you to [Andrew Haines](https://github.com/haines) for contributing this feature.

View File

@@ -6,22 +6,25 @@ import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/defaults"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources"
"github.com/aws/aws-sdk-go-v2/internal/v4a"
acceptencodingcust "github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
presignedurlcust "github.com/aws/aws-sdk-go-v2/service/internal/presigned-url"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
s3sharedconfig "github.com/aws/aws-sdk-go-v2/service/internal/s3shared/config"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/internal/v4a"
smithy "github.com/aws/smithy-go"
smithydocument "github.com/aws/smithy-go/document"
"github.com/aws/smithy-go/logging"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"net"
"net/http"
"time"
)
@@ -43,6 +46,8 @@ func New(options Options, optFns ...func(*Options)) *Client {
resolveDefaultLogger(&options)
setResolvedDefaultsMode(&options)
resolveRetryer(&options)
resolveHTTPClient(&options)
@@ -78,6 +83,10 @@ type Options struct {
// The credentials object to use when signing requests.
Credentials aws.CredentialsProvider
// The configuration DefaultsMode that the SDK should use when constructing the
// clients initial default settings.
DefaultsMode aws.DefaultsMode
// Allows you to disable S3 Multi-Region access points feature.
DisableMultiRegionAccessPoints bool
@@ -96,10 +105,36 @@ type Options struct {
// The region to send requests to. (Required)
Region string
// RetryMaxAttempts specifies the maximum number attempts an API client will call
// an operation that fails with a retryable error. A value of 0 is ignored, and
// will not be used to configure the API client created default retryer, or modify
// per operation call's retry max attempts. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. If specified in an operation call's functional
// options with a value that is different than the constructed client's Options,
// the Client's Retryer will be wrapped to use the operation's specific
// RetryMaxAttempts value.
RetryMaxAttempts int
// RetryMode specifies the retry mode the API client will be created with, if
// Retryer option is not also specified. When creating a new API Clients this
// member will only be used if the Retryer Options member is nil. This value will
// be ignored if Retryer is not nil. Currently does not support per operation call
// overrides, may in the future.
RetryMode aws.RetryMode
// Retryer guides how HTTP requests should be retried in case of recoverable
// failures. When nil the API client will use a default retryer.
// failures. When nil the API client will use a default retryer. The kind of
// default retry created by the API client can be changed with the RetryMode
// option.
Retryer aws.Retryer
// The RuntimeEnvironment configuration, only populated if the DefaultsMode is set
// to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You
// should not populate this structure programmatically, or rely on the values here
// within your applications.
RuntimeEnvironment aws.RuntimeEnvironment
// Allows you to enable arn region support for the service.
UseARNRegion bool
@@ -126,6 +161,12 @@ type Options struct {
// Signature Version 4a (SigV4a) Signer
httpSignerV4a httpSignerV4a
// The initial DefaultsMode used when the client options were constructed. If the
// DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved
// value was at that point in time. Currently does not support per operation call
// overrides, may in the future.
resolvedDefaultsMode aws.DefaultsMode
// The HTTP client to invoke API calls with. Defaults to client's default HTTP
// implementation if nil.
HTTPClient HTTPClient
@@ -156,6 +197,7 @@ func (o Options) Copy() Options {
to := o
to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions))
copy(to.APIOptions, o.APIOptions)
return to
}
func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) {
@@ -168,6 +210,8 @@ func (c *Client) invokeOperation(ctx context.Context, opID string, params interf
setSafeEventStreamClientLogMode(&options, opID)
finalizeRetryMaxAttemptOptions(&options, *c)
finalizeClientEndpointResolverOptions(&options)
resolveCredentialProvider(&options)
@@ -209,17 +253,36 @@ func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error {
return middleware.AddSetLoggerMiddleware(stack, o.Logger)
}
func setResolvedDefaultsMode(o *Options) {
if len(o.resolvedDefaultsMode) > 0 {
return
}
var mode aws.DefaultsMode
mode.SetFromString(string(o.DefaultsMode))
if mode == aws.DefaultsModeAuto {
mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment)
}
o.resolvedDefaultsMode = mode
}
// NewFromConfig returns a new client from the provided config.
func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
opts := Options{
Region: cfg.Region,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
Region: cfg.Region,
DefaultsMode: cfg.DefaultsMode,
RuntimeEnvironment: cfg.RuntimeEnvironment,
HTTPClient: cfg.HTTPClient,
Credentials: cfg.Credentials,
APIOptions: cfg.APIOptions,
Logger: cfg.Logger,
ClientLogMode: cfg.ClientLogMode,
}
resolveAWSRetryerProvider(cfg, &opts)
resolveAWSRetryMaxAttempts(cfg, &opts)
resolveAWSRetryMode(cfg, &opts)
resolveAWSEndpointResolver(cfg, &opts)
resolveUseARNRegion(cfg, &opts)
resolveUseDualStackEndpoint(cfg, &opts)
@@ -228,17 +291,71 @@ func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client {
}
func resolveHTTPClient(o *Options) {
var buildable *awshttp.BuildableClient
if o.HTTPClient != nil {
return
var ok bool
buildable, ok = o.HTTPClient.(*awshttp.BuildableClient)
if !ok {
return
}
} else {
buildable = awshttp.NewBuildableClient()
}
o.HTTPClient = awshttp.NewBuildableClient()
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) {
if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok {
dialer.Timeout = dialerTimeout
}
})
buildable = buildable.WithTransportOptions(func(transport *http.Transport) {
if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok {
transport.TLSHandshakeTimeout = tlsHandshakeTimeout
}
})
}
o.HTTPClient = buildable
}
func resolveRetryer(o *Options) {
if o.Retryer != nil {
return
}
o.Retryer = retry.NewStandard()
if len(o.RetryMode) == 0 {
modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode)
if err == nil {
o.RetryMode = modeConfig.RetryMode
}
}
if len(o.RetryMode) == 0 {
o.RetryMode = aws.RetryModeStandard
}
var standardOptions []func(*retry.StandardOptions)
if v := o.RetryMaxAttempts; v != 0 {
standardOptions = append(standardOptions, func(so *retry.StandardOptions) {
so.MaxAttempts = v
})
}
switch o.RetryMode {
case aws.RetryModeAdaptive:
var adaptiveOptions []func(*retry.AdaptiveModeOptions)
if len(standardOptions) != 0 {
adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) {
ao.StandardOptions = append(ao.StandardOptions, standardOptions...)
})
}
o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...)
default:
o.Retryer = retry.NewStandard(standardOptions...)
}
}
func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
@@ -248,8 +365,29 @@ func resolveAWSRetryerProvider(cfg aws.Config, o *Options) {
o.Retryer = cfg.Retryer()
}
func resolveAWSRetryMode(cfg aws.Config, o *Options) {
if len(cfg.RetryMode) == 0 {
return
}
o.RetryMode = cfg.RetryMode
}
func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) {
if cfg.RetryMaxAttempts == 0 {
return
}
o.RetryMaxAttempts = cfg.RetryMaxAttempts
}
func finalizeRetryMaxAttemptOptions(o *Options, client Client) {
if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts {
return
}
o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts)
}
func resolveAWSEndpointResolver(cfg aws.Config, o *Options) {
if cfg.EndpointResolver == nil {
if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil {
return
}
o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver())
@@ -344,6 +482,7 @@ func resolveCredentialProvider(o *Options) {
if o.Credentials == nil {
return
}
if _, ok := o.Credentials.(v4a.CredentialsProvider); ok {
return
}
@@ -351,11 +490,11 @@ func resolveCredentialProvider(o *Options) {
switch o.Credentials.(type) {
case aws.AnonymousCredentials, *aws.AnonymousCredentials:
return
}
o.Credentials = &v4a.SymmetricCredentialAdaptor{SymmetricProvider: o.Credentials}
}
func swapWithCustomHTTPSignerMiddleware(stack *middleware.Stack, o Options) error {
mw := s3cust.NewSignHTTPRequestMiddleware(s3cust.SignHTTPRequestMiddlewareOptions{
CredentialsProvider: o.Credentials,
@@ -363,11 +502,14 @@ func swapWithCustomHTTPSignerMiddleware(stack *middleware.Stack, o Options) erro
V4aSigner: o.httpSignerV4a,
LogSigning: o.ClientLogMode.IsSigning(),
})
return s3cust.RegisterSigningMiddleware(stack, mw)
}
type httpSignerV4a interface {
SignHTTP(ctx context.Context, credentials v4a.Credentials, r *http.Request, payloadHash string, service string, regionSet []string, signingTime time.Time, optFns ...func(*v4a.SignerOptions)) error
SignHTTP(ctx context.Context, credentials v4a.Credentials, r *http.Request, payloadHash,
service string, regionSet []string, signingTime time.Time,
optFns ...func(*v4a.SignerOptions)) error
}
func resolveHTTPSignerV4a(o *Options) {
@@ -389,6 +531,53 @@ func addMetadataRetrieverMiddleware(stack *middleware.Stack) error {
return s3shared.AddMetadataRetrieverMiddleware(stack)
}
// ComputedInputChecksumsMetadata provides information about the algorithms used to
// compute the checksum(s) of the input payload.
type ComputedInputChecksumsMetadata struct {
// ComputedChecksums is a map of algorithm name to checksum value of the computed
// input payload's checksums.
ComputedChecksums map[string]string
}
// GetComputedInputChecksumsMetadata retrieves from the result metadata the map of
// algorithms and input payload checksums values.
func GetComputedInputChecksumsMetadata(m middleware.Metadata) (ComputedInputChecksumsMetadata, bool) {
values, ok := internalChecksum.GetComputedInputChecksums(m)
if !ok {
return ComputedInputChecksumsMetadata{}, false
}
return ComputedInputChecksumsMetadata{
ComputedChecksums: values,
}, true
}
// ChecksumValidationMetadata contains metadata such as the checksum algorithm used
// for data integrity validation.
type ChecksumValidationMetadata struct {
// AlgorithmsUsed is the set of the checksum algorithms used to validate the
// response payload. The response payload must be completely read in order for the
// checksum validation to be performed. An error is returned by the operation
// output's response io.ReadCloser if the computed checksums are invalid.
AlgorithmsUsed []string
}
// GetChecksumValidationMetadata returns the set of algorithms that will be used to
// validate the response payload with. The response payload must be completely read
// in order for the checksum validation to be performed. An error is returned by
// the operation output's response io.ReadCloser if the computed checksums are
// invalid. Returns false if no checksum algorithm used metadata was found.
func GetChecksumValidationMetadata(m middleware.Metadata) (ChecksumValidationMetadata, bool) {
values, ok := internalChecksum.GetOutputValidationAlgorithmsUsed(m)
if !ok {
return ChecksumValidationMetadata{}, false
}
return ChecksumValidationMetadata{
AlgorithmsUsed: append(make([]string, 0, len(values)), values...),
}, true
}
// nopGetBucketAccessor is no-op accessor for operation that don't support bucket
// member as input
func nopGetBucketAccessor(input interface{}) (*string, bool) {

View File

@@ -74,9 +74,9 @@ type AbortMultipartUploadInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -94,13 +94,14 @@ type AbortMultipartUploadInput struct {
UploadId *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -31,10 +31,13 @@ import (
// determine whether the request succeeded. Note that if CompleteMultipartUpload
// fails, applications should be prepared to retry the failed requests. For more
// information, see Amazon S3 Error Best Practices
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html). For
// more information about multipart uploads, see Uploading Objects Using Multipart
// Upload (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html).
// For information about permissions required to use the multipart upload API, see
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ErrorBestPractices.html). You
// cannot use Content-Type: application/x-www-form-urlencoded with Complete
// Multipart Upload requests. Also, if you do not provide a Content-Type header,
// CompleteMultipartUpload returns a 200 OK response. For more information about
// multipart uploads, see Uploading Objects Using Multipart Upload
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). For
// information about permissions required to use the multipart upload API, see
// Multipart Upload and Permissions
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html).
// CompleteMultipartUpload has the following special errors:
@@ -124,9 +127,9 @@ type CompleteMultipartUploadInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -143,8 +146,41 @@ type CompleteMultipartUploadInput struct {
// This member is required.
UploadId *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 32-bit CRC32 checksum of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 32-bit CRC32C checksum of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 160-bit SHA-1 digest of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 256-bit SHA-256 digest of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The container for the multipart upload request information.
@@ -152,12 +188,33 @@ type CompleteMultipartUploadInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
// The server-side encryption (SSE) algorithm used to encrypt the object. This
// parameter is needed only when the object was created using a checksum algorithm.
// For more information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerAlgorithm *string
// The server-side encryption (SSE) customer managed key. This parameter is needed
// only when the object was created using a checksum algorithm. For more
// information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerKey *string
// The MD5 server-side encryption (SSE) customer managed key. This parameter is
// needed only when the object was created using a checksum algorithm. For more
// information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerKeyMD5 *string
noSmithyDocumentSerde
}
@@ -176,9 +233,9 @@ type CompleteMultipartUploadOutput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
Bucket *string
@@ -187,16 +244,51 @@ type CompleteMultipartUploadOutput struct {
// encryption with Amazon Web Services KMS (SSE-KMS).
BucketKeyEnabled bool
// The base64-encoded, 32-bit CRC32 checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// The base64-encoded, 32-bit CRC32C checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// The base64-encoded, 160-bit SHA-1 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// The base64-encoded, 256-bit SHA-256 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Entity tag that identifies the newly created object's data. Objects with
// different object data will have different entity tags. The entity tag is an
// opaque string. The entity tag may or may not be an MD5 digest of the object
// data. If the entity tag is not an MD5 digest of the object data, it will contain
// one or more nonhexadecimal characters and/or will consist of less than 32 or
// more than 32 hexadecimal digits.
// more than 32 hexadecimal digits. For more information about how the entity tag
// is calculated, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ETag *string
// If the object expiration is configured, this will contain the expiration date
// (expiry-date) and rule ID (rule-id). The value of rule-id is URL encoded.
// (expiry-date) and rule ID (rule-id). The value of rule-id is URL-encoded.
Expiration *string
// The object key of the newly created object.

View File

@@ -17,7 +17,8 @@ import (
// individual objects of up to 5 TB in Amazon S3. You create a copy of your object
// up to 5 GB in size in a single atomic action using this API. However, to copy an
// object greater than 5 GB, you must use the multipart upload Upload Part - Copy
// API. For more information, see Copy Object Using the REST Multipart Upload API
// (UploadPartCopy) API. For more information, see Copy Object Using the REST
// Multipart Upload API
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/CopyingObjctsUsingRESTMPUapi.html).
// All copy requests must be authenticated. Additionally, you must have read access
// to the source object and write access to the destination bucket. For more
@@ -113,10 +114,24 @@ import (
// List (ACL) Overview
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) and Managing
// ACLs Using the REST API
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html).
// Storage Class Options You can use the CopyObject action to change the storage
// class of an object that is already stored in Amazon S3 using the StorageClass
// parameter. For more information, see Storage Classes
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html). If
// the bucket that you're copying objects to uses the bucket owner enforced setting
// for S3 Object Ownership, ACLs are disabled and no longer affect permissions.
// Buckets that use this setting only accept PUT requests that don't specify an ACL
// or PUT requests that specify bucket owner full control ACLs, such as the
// bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed
// in the XML format. For more information, see Controlling ownership of objects
// and disabling ACLs
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. If your bucket uses the bucket owner enforced
// setting for Object Ownership, all objects written to the bucket by any account
// will be owned by the bucket owner. Checksums When copying an object, if it has a
// checksum, that checksum will be copied to the new object by default. When you
// copy the object over, you may optionally specify a different checksum algorithm
// to use with the x-amz-checksum-algorithm header. Storage Class Options You can
// use the CopyObject action to change the storage class of an object that is
// already stored in Amazon S3 using the StorageClass parameter. For more
// information, see Storage Classes
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) in
// the Amazon S3 User Guide. Versioning By default, x-amz-copy-source identifies
// the current version of an object to copy. If the current version is a delete
@@ -171,9 +186,9 @@ type CopyObjectInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -189,7 +204,7 @@ type CopyObjectInput struct {
// For objects not accessed through an access point, specify the name of the source
// bucket and the key of the source object, separated by a slash (/). For example,
// to copy the object reports/january.pdf from the bucket awsexamplebucket, use
// awsexamplebucket/reports/january.pdf. The value must be URL encoded.
// awsexamplebucket/reports/january.pdf. The value must be URL-encoded.
//
// * For
// objects accessed through access points, specify the Amazon Resource Name (ARN)
@@ -206,7 +221,7 @@ type CopyObjectInput struct {
// reports/january.pdf through outpost my-outpost owned by account 123456789012 in
// Region us-west-2, use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf.
// The value must be URL encoded.
// The value must be URL-encoded.
//
// To copy a specific version of an object, append
// ?versionId= to the value (for example,
@@ -236,6 +251,12 @@ type CopyObjectInput struct {
// Specifies caching behavior along the request/reply chain.
CacheControl *string
// Indicates the algorithm you want Amazon S3 to use to create the checksum for the
// object. For more information, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumAlgorithm types.ChecksumAlgorithm
// Specifies presentational information for the object.
ContentDisposition *string
@@ -277,13 +298,13 @@ type CopyObjectInput struct {
CopySourceSSECustomerKeyMD5 *string
// The account ID of the expected destination bucket owner. If the destination
// bucket is owned by a different account, the request will fail with an HTTP 403
// (Access Denied) error.
// bucket is owned by a different account, the request fails with the HTTP status
// code 403 Forbidden (access denied).
ExpectedBucketOwner *string
// The account ID of the expected source bucket owner. If the source bucket is
// owned by a different account, the request will fail with an HTTP 403 (Access
// Denied) error.
// owned by a different account, the request fails with the HTTP status code 403
// Forbidden (access denied).
ExpectedSourceBucketOwner *string
// The date and time at which the object is no longer cacheable.
@@ -312,7 +333,7 @@ type CopyObjectInput struct {
// metadata provided in the request.
MetadataDirective types.MetadataDirective
// Specifies whether you want to apply a Legal Hold to the copied object.
// Specifies whether you want to apply a legal hold to the copied object.
ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus
// The Object Lock mode that you want to apply to the copied object.
@@ -323,8 +344,8 @@ type CopyObjectInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -34,15 +34,23 @@ import (
// created. If you create a bucket in a Region other than US East (N. Virginia),
// your application must be able to handle 307 redirect. For more information, see
// Virtual hosting of buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html). When
// creating a bucket using this operation, you can optionally specify the accounts
// or groups that should be granted specific permissions on the bucket. There are
// two ways to grant the appropriate permissions using the request headers.
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html). Access
// control lists (ACLs) When creating a bucket using this operation, you can
// optionally configure the bucket ACL to specify the accounts or groups that
// should be granted specific permissions on the bucket. If your CreateBucket
// request sets bucket owner enforced for S3 Object Ownership and specifies a
// bucket ACL that provides access to an external Amazon Web Services account, your
// request fails with a 400 error and returns the
// InvalidBucketAclWithObjectOwnership error code. For more information, see
// Controlling object ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. There are two ways to grant the appropriate
// permissions using the request headers.
//
// *
// Specify a canned ACL using the x-amz-acl request header. Amazon S3 supports a
// set of predefined ACLs, known as canned ACLs. Each canned ACL has a predefined
// set of grantees and permissions. For more information, see Canned ACL
// * Specify a canned ACL using the
// x-amz-acl request header. Amazon S3 supports a set of predefined ACLs, known as
// canned ACLs. Each canned ACL has a predefined set of grantees and permissions.
// For more information, see Canned ACL
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL).
//
// *
@@ -51,41 +59,41 @@ import (
// x-amz-grant-full-control headers. These headers map to the set of permissions
// Amazon S3 supports in an ACL. For more information, see Access control list
// (ACL) overview
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html). You specify
// each grantee as a type=value pair, where the type is one of the following:
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html). You
// specify each grantee as a type=value pair, where the type is one of the
// following:
//
// * id
// if the value specified is the canonical user ID of an Amazon Web Services
// account
// * id if the value specified is the canonical user ID of an Amazon
// Web Services account
//
// * uri if you are granting permissions to a predefined group
// * uri if you are granting permissions to a predefined
// group
//
// *
// emailAddress if the value specified is the email address of an Amazon Web
// Services account Using email addresses to specify a grantee is only supported in
// the following Amazon Web Services Regions:
// * emailAddress if the value specified is the email address of an Amazon
// Web Services account Using email addresses to specify a grantee is only
// supported in the following Amazon Web Services Regions:
//
// * US East (N. Virginia)
// * US East (N.
// Virginia)
//
// * US West
// (N. California)
// * US West (N. California)
//
// * US West (Oregon)
//
// * Asia Pacific (Singapore)
//
// * Asia Pacific
// (Sydney)
// (Singapore)
//
// * Asia Pacific (Sydney)
//
// * Asia Pacific (Tokyo)
//
// * Europe (Ireland)
// * Europe
// (Ireland)
//
// * South America (São
// Paulo)
// * South America (São Paulo)
//
// For a list of all the Amazon S3 supported Regions and endpoints, see
// Regions and Endpoints
// For a list of all the Amazon S3
// supported Regions and endpoints, see Regions and Endpoints
// (https://docs.aws.amazon.com/general/latest/gr/rande.html#s3_region) in the
// Amazon Web Services General Reference.
//
@@ -95,15 +103,27 @@ import (
// id="11112222333", id="444455556666"
//
// You can use either a canned ACL or specify
// access permissions explicitly. You cannot do both. Permissions If your
// CreateBucket request specifies ACL permissions and the ACL is public-read,
// public-read-write, authenticated-read, or if you specify access permissions
// explicitly through any other ACL, both s3:CreateBucket and s3:PutBucketAcl
// permissions are needed. If the ACL the CreateBucket request is private, only
// s3:CreateBucket permission is needed. If ObjectLockEnabledForBucket is set to
// true in your CreateBucket request, s3:PutBucketObjectLockConfiguration and
// s3:PutBucketVersioning permissions are required. The following operations are
// related to CreateBucket:
// access permissions explicitly. You cannot do both. Permissions In addition to
// s3:CreateBucket, the following permissions are required when your CreateBucket
// includes specific headers:
//
// * ACLs - If your CreateBucket request specifies ACL
// permissions and the ACL is public-read, public-read-write, authenticated-read,
// or if you specify access permissions explicitly through any other ACL, both
// s3:CreateBucket and s3:PutBucketAcl permissions are needed. If the ACL the
// CreateBucket request is private or doesn't specify any ACLs, only
// s3:CreateBucket permission is needed.
//
// * Object Lock - If
// ObjectLockEnabledForBucket is set to true in your CreateBucket request,
// s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning permissions are
// required.
//
// * S3 Object Ownership - If your CreateBucket request includes the the
// x-amz-object-ownership header, s3:PutBucketOwnershipControls permission is
// required.
//
// The following operations are related to CreateBucket:
//
// * PutObject
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html)
@@ -160,14 +180,25 @@ type CreateBucketInput struct {
// Specifies whether you want S3 Object Lock to be enabled for the new bucket.
ObjectLockEnabledForBucket bool
// The container element for object ownership for a bucket's ownership controls.
// BucketOwnerPreferred - Objects uploaded to the bucket change ownership to the
// bucket owner if the objects are uploaded with the bucket-owner-full-control
// canned ACL. ObjectWriter - The uploading account will own the object if the
// object is uploaded with the bucket-owner-full-control canned ACL.
// BucketOwnerEnforced - Access control lists (ACLs) are disabled and no longer
// affect permissions. The bucket owner automatically owns and has full control
// over every object in the bucket. The bucket only accepts PUT requests that don't
// specify an ACL or bucket owner full control ACLs, such as the
// bucket-owner-full-control canned ACL or an equivalent form of this ACL expressed
// in the XML format.
ObjectOwnership types.ObjectOwnership
noSmithyDocumentSerde
}
type CreateBucketOutput struct {
// Specifies the Region where the bucket will be created. If you are creating a
// bucket on the US East (N. Virginia) Region (us-east-1), you do not need to
// specify the location.
// A forward slash followed by the name of the bucket.
Location *string
// Metadata pertaining to the operation's result.

View File

@@ -262,9 +262,9 @@ type CreateMultipartUploadInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -290,6 +290,12 @@ type CreateMultipartUploadInput struct {
// Specifies caching behavior along the request/reply chain.
CacheControl *string
// Indicates the algorithm you want Amazon S3 to use to create the checksum for the
// object. For more information, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumAlgorithm types.ChecksumAlgorithm
// Specifies presentational information for the object.
ContentDisposition *string
@@ -305,7 +311,8 @@ type CreateMultipartUploadInput struct {
ContentType *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The date and time at which the object is no longer cacheable.
@@ -330,7 +337,7 @@ type CreateMultipartUploadInput struct {
// A map of metadata to store with the object in S3.
Metadata map[string]string
// Specifies whether you want to apply a Legal Hold to the uploaded object.
// Specifies whether you want to apply a legal hold to the uploaded object.
ObjectLockLegalHoldStatus types.ObjectLockLegalHoldStatus
// Specifies the Object Lock mode that you want to apply to the uploaded object.
@@ -341,8 +348,8 @@ type CreateMultipartUploadInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -433,9 +440,9 @@ type CreateMultipartUploadOutput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
Bucket *string
@@ -444,6 +451,9 @@ type CreateMultipartUploadOutput struct {
// encryption with Amazon Web Services KMS (SSE-KMS).
BucketKeyEnabled bool
// The algorithm that was used to create a checksum of the object.
ChecksumAlgorithm types.ChecksumAlgorithm
// Object key for which the multipart upload was initiated.
Key *string

View File

@@ -44,7 +44,8 @@ type DeleteBucketInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -64,7 +64,8 @@ type DeleteBucketAnalyticsConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -47,7 +47,8 @@ type DeleteBucketCorsInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -55,7 +55,8 @@ type DeleteBucketEncryptionInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -15,16 +15,16 @@ import (
// S3 Intelligent-Tiering storage class is designed to optimize storage costs by
// automatically moving data to the most cost-effective storage access tier,
// without performance impact or operational overhead. S3 Intelligent-Tiering
// delivers automatic cost savings in two low latency and high throughput access
// tiers. For data that can be accessed asynchronously, you can choose to activate
// automatic archiving capabilities within the S3 Intelligent-Tiering storage
// class. The S3 Intelligent-Tiering storage class is the ideal storage class for
// data with unknown, changing, or unpredictable access patterns, independent of
// object size or retention period. If the size of an object is less than 128 KB,
// it is not eligible for auto-tiering. Smaller objects can be stored, but they are
// always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering
// storage class. For more information, see Storage class for automatically
// optimizing frequently and infrequently accessed objects
// delivers automatic cost savings in three low latency and high throughput access
// tiers. To get the lowest storage cost on data that can be accessed in minutes to
// hours, you can choose to activate additional archiving capabilities. The S3
// Intelligent-Tiering storage class is the ideal storage class for data with
// unknown, changing, or unpredictable access patterns, independent of object size
// or retention period. If the size of an object is less than 128 KB, it is not
// monitored and not eligible for auto-tiering. Smaller objects can be stored, but
// they are always charged at the Frequent Access tier rates in the S3
// Intelligent-Tiering storage class. For more information, see Storage class for
// automatically optimizing frequently and infrequently accessed objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access).
// Operations related to DeleteBucketIntelligentTieringConfiguration include:
//

View File

@@ -63,7 +63,8 @@ type DeleteBucketInventoryConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -53,7 +53,8 @@ type DeleteBucketLifecycleInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -69,7 +69,8 @@ type DeleteBucketMetricsConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -46,7 +46,8 @@ type DeleteBucketOwnershipControlsInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -56,7 +56,8 @@ type DeleteBucketPolicyInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -54,7 +54,8 @@ type DeleteBucketReplicationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -45,7 +45,8 @@ type DeleteBucketTaggingInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -54,7 +54,8 @@ type DeleteBucketWebsiteInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -65,9 +65,9 @@ type DeleteObjectInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -81,11 +81,12 @@ type DeleteObjectInput struct {
// Indicates whether S3 Object Lock should bypass Governance-mode restrictions to
// process this operation. To use this header, you must have the
// s3:PutBucketPublicAccessBlock permission.
// s3:BypassGovernanceRetention permission.
BypassGovernanceRetention bool
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The concatenation of the authentication device's serial number, a space, and the
@@ -95,8 +96,8 @@ type DeleteObjectInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -55,9 +55,9 @@ type DeleteObjectTaggingInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -70,7 +70,8 @@ type DeleteObjectTaggingInput struct {
Key *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The versionId of the object that the tag-set will be removed from.

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -86,9 +87,9 @@ type DeleteObjectsInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -102,11 +103,25 @@ type DeleteObjectsInput struct {
// Specifies whether you want to delete this object even if it has a
// Governance-type Object Lock in place. To use this header, you must have the
// s3:PutBucketPublicAccessBlock permission.
// s3:BypassGovernanceRetention permission.
BypassGovernanceRetention bool
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter. This checksum algorithm must
// be the same for all parts and it match the checksum value supplied in the
// CreateMultipartUpload request.
ChecksumAlgorithm types.ChecksumAlgorithm
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The concatenation of the authentication device's serial number, a space, and the
@@ -116,8 +131,8 @@ type DeleteObjectsInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -193,9 +208,6 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpDeleteObjectsValidationMiddleware(stack); err != nil {
return err
}
@@ -205,6 +217,9 @@ func (c *Client) addOperationDeleteObjectsMiddlewares(stack *middleware.Stack, o
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addDeleteObjectsInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addDeleteObjectsUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -232,6 +247,26 @@ func newServiceMetadataMiddleware_opDeleteObjects(region string) *awsmiddleware.
}
}
// getDeleteObjectsRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getDeleteObjectsRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*DeleteObjectsInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addDeleteObjectsInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getDeleteObjectsRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getDeleteObjectsBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -58,7 +58,8 @@ type DeletePublicAccessBlockInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -59,7 +59,8 @@ type GetBucketAccelerateConfigurationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -16,7 +16,13 @@ import (
// access control list (ACL) of a bucket. To use GET to return the ACL of the
// bucket, you must have READ_ACP access to the bucket. If READ_ACP permission is
// granted to the anonymous user, you can return the ACL of the bucket without
// using an authorization header. Related Resources
// using an authorization header. If your bucket uses the bucket owner enforced
// setting for S3 Object Ownership, requests to read ACLs are still supported and
// return the bucket-owner-full-control ACL with the owner being the account that
// created the bucket. For more information, see Controlling object ownership and
// disabling ACLs
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. Related Resources
//
// * ListObjects
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html)
@@ -43,7 +49,8 @@ type GetBucketAclInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -65,7 +65,8 @@ type GetBucketAnalyticsConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -12,10 +12,11 @@ import (
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Returns the cors configuration information set for the bucket. To use this
// operation, you must have permission to perform the s3:GetBucketCORS action. By
// default, the bucket owner has this permission and can grant it to others. For
// more information about cors, see Enabling Cross-Origin Resource Sharing
// Returns the Cross-Origin Resource Sharing (CORS) configuration information set
// for the bucket. To use this operation, you must have permission to perform the
// s3:GetBucketCORS action. By default, the bucket owner has this permission and
// can grant it to others. For more information about CORS, see Enabling
// Cross-Origin Resource Sharing
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html). The following
// operations are related to GetBucketCors:
//
@@ -48,7 +49,8 @@ type GetBucketCorsInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -59,7 +59,8 @@ type GetBucketEncryptionInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -16,16 +16,16 @@ import (
// Intelligent-Tiering storage class is designed to optimize storage costs by
// automatically moving data to the most cost-effective storage access tier,
// without performance impact or operational overhead. S3 Intelligent-Tiering
// delivers automatic cost savings in two low latency and high throughput access
// tiers. For data that can be accessed asynchronously, you can choose to activate
// automatic archiving capabilities within the S3 Intelligent-Tiering storage
// class. The S3 Intelligent-Tiering storage class is the ideal storage class for
// data with unknown, changing, or unpredictable access patterns, independent of
// object size or retention period. If the size of an object is less than 128 KB,
// it is not eligible for auto-tiering. Smaller objects can be stored, but they are
// always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering
// storage class. For more information, see Storage class for automatically
// optimizing frequently and infrequently accessed objects
// delivers automatic cost savings in three low latency and high throughput access
// tiers. To get the lowest storage cost on data that can be accessed in minutes to
// hours, you can choose to activate additional archiving capabilities. The S3
// Intelligent-Tiering storage class is the ideal storage class for data with
// unknown, changing, or unpredictable access patterns, independent of object size
// or retention period. If the size of an object is less than 128 KB, it is not
// monitored and not eligible for auto-tiering. Smaller objects can be stored, but
// they are always charged at the Frequent Access tier rates in the S3
// Intelligent-Tiering storage class. For more information, see Storage class for
// automatically optimizing frequently and infrequently accessed objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access).
// Operations related to GetBucketIntelligentTieringConfiguration include:
//

View File

@@ -63,7 +63,8 @@ type GetBucketInventoryConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -80,7 +80,8 @@ type GetBucketLifecycleConfigurationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -57,7 +57,8 @@ type GetBucketLocationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -45,7 +45,8 @@ type GetBucketLoggingInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -70,7 +70,8 @@ type GetBucketMetricsConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -50,7 +50,8 @@ type GetBucketNotificationConfigurationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -60,6 +61,9 @@ type GetBucketNotificationConfigurationInput struct {
// element is empty, notifications are turned off for the bucket.
type GetBucketNotificationConfigurationOutput struct {
// Enables delivery of events to Amazon EventBridge.
EventBridgeConfiguration *types.EventBridgeConfiguration
// Describes the Lambda functions to invoke and the events for which to invoke
// them.
LambdaFunctionConfigurations []types.LambdaFunctionConfiguration

View File

@@ -14,10 +14,10 @@ import (
// Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you
// must have the s3:GetBucketOwnershipControls permission. For more information
// about Amazon S3 permissions, see Specifying Permissions in a Policy
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html).
// about Amazon S3 permissions, see Specifying permissions in a policy
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html).
// For information about Amazon S3 Object Ownership, see Using Object Ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html).
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html).
// The following operations are related to GetBucketOwnershipControls:
//
// *
@@ -47,7 +47,8 @@ type GetBucketOwnershipControlsInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -55,8 +56,8 @@ type GetBucketOwnershipControlsInput struct {
type GetBucketOwnershipControlsOutput struct {
// The OwnershipControls (BucketOwnerPreferred or ObjectWriter) currently in effect
// for this Amazon S3 bucket.
// The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or
// ObjectWriter) currently in effect for this Amazon S3 bucket.
OwnershipControls *types.OwnershipControls
// Metadata pertaining to the operation's result.

View File

@@ -51,7 +51,8 @@ type GetBucketPolicyInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -60,7 +60,8 @@ type GetBucketPolicyStatusInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -58,7 +58,8 @@ type GetBucketReplicationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -43,7 +43,8 @@ type GetBucketRequestPaymentInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -17,16 +17,15 @@ import (
// bucket owner has this permission and can grant this permission to others.
// GetBucketTagging has the following special error:
//
// * Error code:
// NoSuchTagSetError
//
// * Description: There is no tag set associated with the
// bucket.
//
// The following operations are related to GetBucketTagging:
// * Error code: NoSuchTagSet
//
// *
// PutBucketTagging
// Description: There is no tag set associated with the bucket.
//
// The following
// operations are related to GetBucketTagging:
//
// * PutBucketTagging
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketTagging.html)
//
// *
@@ -55,7 +54,8 @@ type GetBucketTaggingInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -52,7 +52,8 @@ type GetBucketVersioningInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -51,7 +51,8 @@ type GetBucketWebsiteInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -29,10 +30,7 @@ import (
// specify the resource as /examplebucket/photos/2006/February/sample.jpg. For more
// information about request types, see HTTP Host Header Bucket Specification
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingSpecifyBucket).
// To distribute large files to many people, you can save bandwidth costs by using
// BitTorrent. For more information, see Amazon S3 Torrent
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/S3Torrent.html). For more
// information about returning the ACL of an object, see GetObjectAcl
// For more information about returning the ACL of an object, see GetObjectAcl
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html). If the
// object you are retrieving is stored in the S3 Glacier or S3 Glacier Deep Archive
// storage class, or S3 Intelligent-Tiering Archive or S3 Intelligent-Tiering Deep
@@ -84,15 +82,17 @@ import (
// Versioning By default, the GET action returns the current version of an
// object. To return a different version, use the versionId subresource.
//
// * You
// need the s3:GetObjectVersion permission to access a specific version of an
// object.
// * If you
// supply a versionId, you need the s3:GetObjectVersion permission to access a
// specific version of an object. If you request a specific version, you do not
// need to have the s3:GetObject permission.
//
// * If the current version of the object is a delete marker, Amazon S3
// behaves as if the object was deleted and includes x-amz-delete-marker: true in
// the response.
// * If the current version of the
// object is a delete marker, Amazon S3 behaves as if the object was deleted and
// includes x-amz-delete-marker: true in the response.
//
// For more information about versioning, see PutBucketVersioning
// For more information about
// versioning, see PutBucketVersioning
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketVersioning.html).
// Overriding Response Header Values There are times when you want to override
// certain response header values in a GET response. For example, you might
@@ -171,9 +171,9 @@ type GetObjectInput struct {
// action with Amazon S3 on Outposts, you must direct requests to the S3 on
// Outposts hostname. The S3 on Outposts hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -185,24 +185,28 @@ type GetObjectInput struct {
// This member is required.
Key *string
// To retrieve the checksum, this mode must be enabled.
ChecksumMode types.ChecksumMode
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Return the object only if its entity tag (ETag) is the same as the one
// specified, otherwise return a 412 (precondition failed).
// specified; otherwise, return a 412 (precondition failed) error.
IfMatch *string
// Return the object only if it has been modified since the specified time,
// otherwise return a 304 (not modified).
// Return the object only if it has been modified since the specified time;
// otherwise, return a 304 (not modified) error.
IfModifiedSince *time.Time
// Return the object only if its entity tag (ETag) is different from the one
// specified, otherwise return a 304 (not modified).
// specified; otherwise, return a 304 (not modified) error.
IfNoneMatch *string
// Return the object only if it has not been modified since the specified time,
// otherwise return a 412 (precondition failed).
// Return the object only if it has not been modified since the specified time;
// otherwise, return a 412 (precondition failed) error.
IfUnmodifiedSince *time.Time
// Part number of the object being read. This is a positive integer between 1 and
@@ -219,8 +223,8 @@ type GetObjectInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -280,6 +284,38 @@ type GetObjectOutput struct {
// Specifies caching behavior along the request/reply chain.
CacheControl *string
// The base64-encoded, 32-bit CRC32 checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// The base64-encoded, 32-bit CRC32C checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// The base64-encoded, 160-bit SHA-1 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// The base64-encoded, 256-bit SHA-256 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Specifies presentational information for the object.
ContentDisposition *string
@@ -304,14 +340,14 @@ type GetObjectOutput struct {
// Marker. If false, this response header does not appear in the response.
DeleteMarker bool
// An ETag is an opaque identifier assigned by a web server to a specific version
// of a resource found at a URL.
// An entity tag (ETag) is an opaque identifier assigned by a web server to a
// specific version of a resource found at a URL.
ETag *string
// If the object expiration is configured (see PUT Bucket lifecycle), the response
// includes this header. It includes the expiry-date and rule-id key-value pairs
// providing object expiration information. The value of the rule-id is URL
// encoded.
// providing object expiration information. The value of the rule-id is
// URL-encoded.
Expiration *string
// The date and time at which the object is no longer cacheable.
@@ -341,7 +377,8 @@ type GetObjectOutput struct {
// The date and time when this object's Object Lock will expire.
ObjectLockRetainUntilDate *time.Time
// The count of parts this object has.
// The count of parts this object has. This value is only returned if you specify
// partNumber in your request and the object was uploaded as a multipart upload.
PartsCount int32
// Amazon S3 can return this if your request involves a bucket that is either a
@@ -449,6 +486,9 @@ func (c *Client) addOperationGetObjectMiddlewares(stack *middleware.Stack, optio
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addGetObjectOutputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addGetObjectUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -476,6 +516,26 @@ func newServiceMetadataMiddleware_opGetObject(region string) *awsmiddleware.Regi
}
}
// getGetObjectRequestValidationModeMember gets the request checksum validation
// mode provided as input.
func getGetObjectRequestValidationModeMember(input interface{}) (string, bool) {
in := input.(*GetObjectInput)
if len(in.ChecksumMode) == 0 {
return "", false
}
return string(in.ChecksumMode), true
}
func addGetObjectOutputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddOutputMiddleware(stack, internalChecksum.OutputMiddlewareOptions{
GetValidationMode: getGetObjectRequestValidationModeMember,
ValidationAlgorithms: []string{"CRC32", "CRC32C", "SHA256", "SHA1"},
IgnoreMultipartValidation: true,
LogValidationSkipped: true,
LogMultipartValidationSkipped: true,
})
}
// getGetObjectBucketMember returns a pointer to string denoting a provided bucket
// member valueand a boolean indicating if the input has a modeled bucket name,
func getGetObjectBucketMember(input interface{}) (*string, bool) {

View File

@@ -13,16 +13,29 @@ import (
)
// Returns the access control list (ACL) of an object. To use this operation, you
// must have READ_ACP access to the object. This action is not supported by Amazon
// S3 on Outposts. Versioning By default, GET returns ACL information about the
// current version of an object. To return ACL information about a different
// version, use the versionId subresource. The following operations are related to
// must have s3:GetObjectAcl permissions or READ_ACP access to the object. For more
// information, see Mapping of ACL permissions and access policy permissions
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/acl-overview.html#acl-access-policy-permission-mapping)
// in the Amazon S3 User Guide This action is not supported by Amazon S3 on
// Outposts. Versioning By default, GET returns ACL information about the current
// version of an object. To return ACL information about a different version, use
// the versionId subresource. If your bucket uses the bucket owner enforced setting
// for S3 Object Ownership, requests to read ACLs are still supported and return
// the bucket-owner-full-control ACL with the owner being the account that created
// the bucket. For more information, see Controlling object ownership and
// disabling ACLs
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. The following operations are related to
// GetObjectAcl:
//
// * GetObject
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html)
//
// *
// GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
//
// *
// DeleteObject
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html)
//
@@ -64,13 +77,14 @@ type GetObjectAclInput struct {
Key *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -0,0 +1,363 @@
// Code generated by smithy-go-codegen DO NOT EDIT.
package s3
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
"time"
)
// Retrieves all the metadata from an object without returning the object itself.
// This action is useful if you're interested only in an object's metadata. To use
// GetObjectAttributes, you must have READ access to the object.
// GetObjectAttributes combines the functionality of GetObjectAcl,
// GetObjectLegalHold, GetObjectLockConfiguration, GetObjectRetention,
// GetObjectTagging, HeadObject, and ListParts. All of the data returned with each
// of those individual calls can be returned with a single call to
// GetObjectAttributes. If you encrypt an object by using server-side encryption
// with customer-provided encryption keys (SSE-C) when you store the object in
// Amazon S3, then when you retrieve the metadata from the object, you must use the
// following headers:
//
// * x-amz-server-side-encryption-customer-algorithm
//
// *
// x-amz-server-side-encryption-customer-key
//
// *
// x-amz-server-side-encryption-customer-key-MD5
//
// For more information about SSE-C,
// see Server-Side Encryption (Using Customer-Provided Encryption Keys)
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
//
// * Encryption request headers, such as
// x-amz-server-side-encryption, should not be sent for GET requests if your object
// uses server-side encryption with Amazon Web Services KMS keys stored in Amazon
// Web Services Key Management Service (SSE-KMS) or server-side encryption with
// Amazon S3 managed encryption keys (SSE-S3). If your object does use these types
// of keys, you'll get an HTTP 400 Bad Request error.
//
// * The last modified property
// in this case is the creation date of the object.
//
// Consider the following when
// using request headers:
//
// * If both of the If-Match and If-Unmodified-Since
// headers are present in the request as follows, then Amazon S3 returns the HTTP
// status code 200 OK and the data requested:
//
// * If-Match condition evaluates to
// true.
//
// * If-Unmodified-Since condition evaluates to false.
//
// * If both of the
// If-None-Match and If-Modified-Since headers are present in the request as
// follows, then Amazon S3 returns the HTTP status code 304 Not Modified:
//
// *
// If-None-Match condition evaluates to false.
//
// * If-Modified-Since condition
// evaluates to true.
//
// For more information about conditional requests, see RFC
// 7232 (https://tools.ietf.org/html/rfc7232). Permissions The permissions that you
// need to use this operation depend on whether the bucket is versioned. If the
// bucket is versioned, you need both the s3:GetObjectVersion and
// s3:GetObjectVersionAttributes permissions for this operation. If the bucket is
// not versioned, you need the s3:GetObject and s3:GetObjectAttributes permissions.
// For more information, see Specifying Permissions in a Policy
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html) in
// the Amazon S3 User Guide. If the object that you request does not exist, the
// error Amazon S3 returns depends on whether you also have the s3:ListBucket
// permission.
//
// * If you have the s3:ListBucket permission on the bucket, Amazon S3
// returns an HTTP status code 404 Not Found ("no such key") error.
//
// * If you don't
// have the s3:ListBucket permission, Amazon S3 returns an HTTP status code 403
// Forbidden ("access denied") error.
//
// The following actions are related to
// GetObjectAttributes:
//
// * GetObject
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html)
//
// *
// GetObjectAcl
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAcl.html)
//
// *
// GetObjectLegalHold
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLegalHold.html)
//
// *
// GetObjectLockConfiguration
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectLockConfiguration.html)
//
// *
// GetObjectRetention
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectRetention.html)
//
// *
// GetObjectTagging
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html)
//
// *
// HeadObject
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html)
//
// *
// ListParts (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html)
func (c *Client) GetObjectAttributes(ctx context.Context, params *GetObjectAttributesInput, optFns ...func(*Options)) (*GetObjectAttributesOutput, error) {
if params == nil {
params = &GetObjectAttributesInput{}
}
result, metadata, err := c.invokeOperation(ctx, "GetObjectAttributes", params, optFns, c.addOperationGetObjectAttributesMiddlewares)
if err != nil {
return nil, err
}
out := result.(*GetObjectAttributesOutput)
out.ResultMetadata = metadata
return out, nil
}
type GetObjectAttributesInput struct {
// The name of the bucket that contains the object. When using this action with an
// access point, you must direct requests to the access point hostname. The access
// point hostname takes the form
// AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this
// action with an access point through the Amazon Web Services SDKs, you provide
// the access point ARN in place of the bucket name. For more information about
// access point ARNs, see Using access points
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-access-points.html)
// in the Amazon S3 User Guide. When using this action with Amazon S3 on Outposts,
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
// This member is required.
Bucket *string
// The object key.
//
// This member is required.
Key *string
// An XML header that specifies the fields at the root level that you want returned
// in the response. Fields that you do not specify are not returned.
//
// This member is required.
ObjectAttributes []types.ObjectAttributes
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Sets the maximum number of parts to return.
MaxParts int32
// Specifies the part after which listing should begin. Only parts with higher part
// numbers will be listed.
PartNumberMarker *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
// Specifies the algorithm to use when encrypting the object (for example, AES256).
SSECustomerAlgorithm *string
// Specifies the customer-provided encryption key for Amazon S3 to use in
// encrypting data. This value is used to store the object and then it is
// discarded; Amazon S3 does not store the encryption key. The key must be
// appropriate for use with the algorithm specified in the
// x-amz-server-side-encryption-customer-algorithm header.
SSECustomerKey *string
// Specifies the 128-bit MD5 digest of the encryption key according to RFC 1321.
// Amazon S3 uses this header for a message integrity check to ensure that the
// encryption key was transmitted without error.
SSECustomerKeyMD5 *string
// The version ID used to reference a specific version of the object.
VersionId *string
noSmithyDocumentSerde
}
type GetObjectAttributesOutput struct {
// The checksum or digest of the object.
Checksum *types.Checksum
// Specifies whether the object retrieved was (true) or was not (false) a delete
// marker. If false, this response header does not appear in the response.
DeleteMarker bool
// An ETag is an opaque identifier assigned by a web server to a specific version
// of a resource found at a URL.
ETag *string
// The creation date of the object.
LastModified *time.Time
// A collection of parts associated with a multipart upload.
ObjectParts *types.GetObjectAttributesParts
// The size of the object in bytes.
ObjectSize int64
// If present, indicates that the requester was successfully charged for the
// request.
RequestCharged types.RequestCharged
// Provides the storage class information of the object. Amazon S3 returns this
// header for all objects except for S3 Standard storage class objects. For more
// information, see Storage Classes
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html).
StorageClass types.StorageClass
// The version ID of the object.
VersionId *string
// Metadata pertaining to the operation's result.
ResultMetadata middleware.Metadata
noSmithyDocumentSerde
}
func (c *Client) addOperationGetObjectAttributesMiddlewares(stack *middleware.Stack, options Options) (err error) {
err = stack.Serialize.Add(&awsRestxml_serializeOpGetObjectAttributes{}, middleware.After)
if err != nil {
return err
}
err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetObjectAttributes{}, middleware.After)
if err != nil {
return err
}
if err = addSetLoggerMiddleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil {
return err
}
if err = addResolveEndpointMiddleware(stack, options); err != nil {
return err
}
if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil {
return err
}
if err = addRetryMiddlewares(stack, options); err != nil {
return err
}
if err = addHTTPSignerV4Middleware(stack, options); err != nil {
return err
}
if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil {
return err
}
if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil {
return err
}
if err = addClientUserAgent(stack); err != nil {
return err
}
if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil {
return err
}
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = addOpGetObjectAttributesValidationMiddleware(stack); err != nil {
return err
}
if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetObjectAttributes(options.Region), middleware.Before); err != nil {
return err
}
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addGetObjectAttributesUpdateEndpoint(stack, options); err != nil {
return err
}
if err = addResponseErrorMiddleware(stack); err != nil {
return err
}
if err = v4.AddContentSHA256HeaderMiddleware(stack); err != nil {
return err
}
if err = disableAcceptEncodingGzip(stack); err != nil {
return err
}
if err = addRequestResponseLogging(stack, options); err != nil {
return err
}
return nil
}
func newServiceMetadataMiddleware_opGetObjectAttributes(region string) *awsmiddleware.RegisterServiceMetadata {
return &awsmiddleware.RegisterServiceMetadata{
Region: region,
ServiceID: ServiceID,
SigningName: "s3",
OperationName: "GetObjectAttributes",
}
}
// getGetObjectAttributesBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,
func getGetObjectAttributesBucketMember(input interface{}) (*string, bool) {
in := input.(*GetObjectAttributesInput)
if in.Bucket == nil {
return nil, false
}
return in.Bucket, true
}
func addGetObjectAttributesUpdateEndpoint(stack *middleware.Stack, options Options) error {
return s3cust.UpdateEndpoint(stack, s3cust.UpdateEndpointOptions{
Accessor: s3cust.UpdateEndpointParameterAccessor{
GetBucketFromInput: getGetObjectAttributesBucketMember,
},
UsePathStyle: options.UsePathStyle,
UseAccelerate: options.UseAccelerate,
SupportsAccelerate: true,
TargetS3ObjectLambda: false,
EndpointResolver: options.EndpointResolver,
EndpointResolverOptions: options.EndpointOptions,
UseARNRegion: options.UseARNRegion,
DisableMultiRegionAccessPoints: options.DisableMultiRegionAccessPoints,
})
}

View File

@@ -12,9 +12,13 @@ import (
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Gets an object's current Legal Hold status. For more information, see Locking
// Gets an object's current legal hold status. For more information, see Locking
// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). This
// action is not supported by Amazon S3 on Outposts.
// action is not supported by Amazon S3 on Outposts. The following action is
// related to GetObjectLegalHold:
//
// * GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
func (c *Client) GetObjectLegalHold(ctx context.Context, params *GetObjectLegalHoldInput, optFns ...func(*Options)) (*GetObjectLegalHoldOutput, error) {
if params == nil {
params = &GetObjectLegalHoldInput{}
@@ -32,7 +36,7 @@ func (c *Client) GetObjectLegalHold(ctx context.Context, params *GetObjectLegalH
type GetObjectLegalHoldInput struct {
// The bucket name containing the object whose Legal Hold status you want to
// The bucket name containing the object whose legal hold status you want to
// retrieve. When using this action with an access point, you must direct requests
// to the access point hostname. The access point hostname takes the form
// AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this
@@ -45,24 +49,25 @@ type GetObjectLegalHoldInput struct {
// This member is required.
Bucket *string
// The key name for the object whose Legal Hold status you want to retrieve.
// The key name for the object whose legal hold status you want to retrieve.
//
// This member is required.
Key *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
// The version ID of the object whose Legal Hold status you want to retrieve.
// The version ID of the object whose legal hold status you want to retrieve.
VersionId *string
noSmithyDocumentSerde
@@ -70,7 +75,7 @@ type GetObjectLegalHoldInput struct {
type GetObjectLegalHoldOutput struct {
// The current Legal Hold status for the specified object.
// The current legal hold status for the specified object.
LegalHold *types.ObjectLockLegalHold
// Metadata pertaining to the operation's result.

View File

@@ -15,7 +15,12 @@ import (
// Gets the Object Lock configuration for a bucket. The rule specified in the
// Object Lock configuration will be applied by default to every new object placed
// in the specified bucket. For more information, see Locking Objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html).
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). The
// following action is related to GetObjectLockConfiguration:
//
// *
// GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
func (c *Client) GetObjectLockConfiguration(ctx context.Context, params *GetObjectLockConfigurationInput, optFns ...func(*Options)) (*GetObjectLockConfigurationOutput, error) {
if params == nil {
params = &GetObjectLockConfigurationInput{}
@@ -47,7 +52,8 @@ type GetObjectLockConfigurationInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -14,7 +14,11 @@ import (
// Retrieves an object's retention settings. For more information, see Locking
// Objects (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). This
// action is not supported by Amazon S3 on Outposts.
// action is not supported by Amazon S3 on Outposts. The following action is
// related to GetObjectRetention:
//
// * GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
func (c *Client) GetObjectRetention(ctx context.Context, params *GetObjectRetentionInput, optFns ...func(*Options)) (*GetObjectRetentionOutput, error) {
if params == nil {
params = &GetObjectRetentionInput{}
@@ -51,13 +55,14 @@ type GetObjectRetentionInput struct {
Key *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -22,14 +22,18 @@ import (
// permission and can grant this permission to others. For information about the
// Amazon S3 object tagging feature, see Object Tagging
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-tagging.html). The
// following action is related to GetObjectTagging:
// following actions are related to GetObjectTagging:
//
// * PutObjectTagging
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html)
// * DeleteObjectTagging
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html)
//
// *
// DeleteObjectTagging
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html)
// GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
//
// *
// PutObjectTagging
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html)
func (c *Client) GetObjectTagging(ctx context.Context, params *GetObjectTaggingInput, optFns ...func(*Options)) (*GetObjectTaggingOutput, error) {
if params == nil {
params = &GetObjectTaggingInput{}
@@ -59,9 +63,9 @@ type GetObjectTaggingInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -74,13 +78,14 @@ type GetObjectTaggingInput struct {
Key *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -53,13 +53,14 @@ type GetObjectTorrentInput struct {
Key *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -66,7 +66,8 @@ type GetPublicAccessBlockInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -66,9 +66,9 @@ type HeadBucketInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -76,7 +76,8 @@ type HeadBucketInput struct {
Bucket *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -97,10 +97,14 @@ import (
// Amazon S3 returns an HTTP status code 403 ("access denied") error.
//
// The
// following action is related to HeadObject:
// following actions are related to HeadObject:
//
// * GetObject
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html)
//
// *
// GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
func (c *Client) HeadObject(ctx context.Context, params *HeadObjectInput, optFns ...func(*Options)) (*HeadObjectOutput, error) {
if params == nil {
params = &HeadObjectInput{}
@@ -130,9 +134,9 @@ type HeadObjectInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -144,24 +148,31 @@ type HeadObjectInput struct {
// This member is required.
Key *string
// To retrieve the checksum, this parameter must be enabled. In addition, if you
// enable ChecksumMode and the object is encrypted with Amazon Web Services Key
// Management Service (Amazon Web Services KMS), you must have permission to use
// the kms:Decrypt action for the request to succeed.
ChecksumMode types.ChecksumMode
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Return the object only if its entity tag (ETag) is the same as the one
// specified, otherwise return a 412 (precondition failed).
// specified; otherwise, return a 412 (precondition failed) error.
IfMatch *string
// Return the object only if it has been modified since the specified time,
// otherwise return a 304 (not modified).
// Return the object only if it has been modified since the specified time;
// otherwise, return a 304 (not modified) error.
IfModifiedSince *time.Time
// Return the object only if its entity tag (ETag) is different from the one
// specified, otherwise return a 304 (not modified).
// specified; otherwise, return a 304 (not modified) error.
IfNoneMatch *string
// Return the object only if it has not been modified since the specified time,
// otherwise return a 412 (precondition failed).
// Return the object only if it has not been modified since the specified time;
// otherwise, return a 412 (precondition failed) error.
IfUnmodifiedSince *time.Time
// Part number of the object being read. This is a positive integer between 1 and
@@ -170,17 +181,14 @@ type HeadObjectInput struct {
// object.
PartNumber int32
// Downloads the specified range bytes of an object. For more information about the
// HTTP Range header, see
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35
// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35). Amazon S3
// doesn't support retrieving multiple ranges of data per GET request.
// Because HeadObject returns only the metadata for an object, this parameter has
// no effect.
Range *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -222,6 +230,38 @@ type HeadObjectOutput struct {
// Specifies caching behavior along the request/reply chain.
CacheControl *string
// The base64-encoded, 32-bit CRC32 checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// The base64-encoded, 32-bit CRC32C checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// The base64-encoded, 160-bit SHA-1 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// The base64-encoded, 256-bit SHA-256 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Specifies presentational information for the object.
ContentDisposition *string
@@ -243,14 +283,14 @@ type HeadObjectOutput struct {
// Marker. If false, this response header does not appear in the response.
DeleteMarker bool
// An ETag is an opaque identifier assigned by a web server to a specific version
// of a resource found at a URL.
// An entity tag (ETag) is an opaque identifier assigned by a web server to a
// specific version of a resource found at a URL.
ETag *string
// If the object expiration is configured (see PUT Bucket lifecycle), the response
// includes this header. It includes the expiry-date and rule-id key-value pairs
// providing object expiration information. The value of the rule-id is URL
// encoded.
// providing object expiration information. The value of the rule-id is
// URL-encoded.
Expiration *string
// The date and time at which the object is no longer cacheable.
@@ -287,7 +327,8 @@ type HeadObjectOutput struct {
// only returned if the requester has the s3:GetObjectRetention permission.
ObjectLockRetainUntilDate *time.Time
// The count of parts this object has.
// The count of parts this object has. This value is only returned if you specify
// partNumber in your request and the object was uploaded as a multipart upload.
PartsCount int32
// Amazon S3 can return this header if your request involves a bucket that is
@@ -298,7 +339,7 @@ type HeadObjectOutput struct {
// return the x-amz-replication-status header in the response as follows:
//
// * If
// requesting an object from the source bucket Amazon S3 will return the
// requesting an object from the source bucket, Amazon S3 will return the
// x-amz-replication-status header if the object in your request is eligible for
// replication. For example, suppose that in your replication configuration, you
// specify object prefix TaxDocs requesting Amazon S3 to replicate objects with key
@@ -308,13 +349,13 @@ type HeadObjectOutput struct {
// with value PENDING, COMPLETED or FAILED indicating object replication status.
//
// *
// If requesting an object from a destination bucket Amazon S3 will return the
// If requesting an object from a destination bucket, Amazon S3 will return the
// x-amz-replication-status header with value REPLICA if the object in your request
// is a replica that Amazon S3 created and there is no replica modification
// replication in progress.
//
// * When replicating objects to multiple destination
// buckets the x-amz-replication-status header acts differently. The header of the
// buckets, the x-amz-replication-status header acts differently. The header of the
// source object will only return a value of COMPLETED when replication is
// successful to all destinations. The header will remain at value PENDING until
// replication has completed for all destinations. If one or more destinations

View File

@@ -71,7 +71,8 @@ type ListBucketAnalyticsConfigurationsInput struct {
ContinuationToken *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -16,16 +16,16 @@ import (
// Intelligent-Tiering storage class is designed to optimize storage costs by
// automatically moving data to the most cost-effective storage access tier,
// without performance impact or operational overhead. S3 Intelligent-Tiering
// delivers automatic cost savings in two low latency and high throughput access
// tiers. For data that can be accessed asynchronously, you can choose to activate
// automatic archiving capabilities within the S3 Intelligent-Tiering storage
// class. The S3 Intelligent-Tiering storage class is the ideal storage class for
// data with unknown, changing, or unpredictable access patterns, independent of
// object size or retention period. If the size of an object is less than 128 KB,
// it is not eligible for auto-tiering. Smaller objects can be stored, but they are
// always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering
// storage class. For more information, see Storage class for automatically
// optimizing frequently and infrequently accessed objects
// delivers automatic cost savings in three low latency and high throughput access
// tiers. To get the lowest storage cost on data that can be accessed in minutes to
// hours, you can choose to activate additional archiving capabilities. The S3
// Intelligent-Tiering storage class is the ideal storage class for data with
// unknown, changing, or unpredictable access patterns, independent of object size
// or retention period. If the size of an object is less than 128 KB, it is not
// monitored and not eligible for auto-tiering. Smaller objects can be stored, but
// they are always charged at the Frequent Access tier rates in the S3
// Intelligent-Tiering storage class. For more information, see Storage class for
// automatically optimizing frequently and infrequently accessed objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access).
// Operations related to ListBucketIntelligentTieringConfigurations include:
//

View File

@@ -72,7 +72,8 @@ type ListBucketInventoryConfigurationsInput struct {
ContinuationToken *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -74,7 +74,8 @@ type ListBucketMetricsConfigurationsInput struct {
ContinuationToken *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -13,6 +13,7 @@ import (
)
// Returns a list of all buckets owned by the authenticated sender of the request.
// To use this operation, you must have the s3:ListAllMyBuckets permission.
func (c *Client) ListBuckets(ctx context.Context, params *ListBucketsInput, optFns ...func(*Options)) (*ListBucketsOutput, error) {
if params == nil {
params = &ListBucketsInput{}
@@ -34,7 +35,7 @@ type ListBucketsInput struct {
type ListBucketsOutput struct {
// The list of buckets owned by the requestor.
// The list of buckets owned by the requester.
Buckets []types.Bucket
// The owner of the buckets listed.

View File

@@ -81,9 +81,9 @@ type ListMultipartUploadsInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -107,7 +107,8 @@ type ListMultipartUploadsInput struct {
EncodingType types.EncodingType
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Together with upload-id-marker, this parameter specifies the multipart upload

View File

@@ -74,7 +74,8 @@ type ListObjectVersionsInput struct {
EncodingType types.EncodingType
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Specifies the key to start with when listing objects in a bucket.

View File

@@ -70,9 +70,9 @@ type ListObjectsInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -91,7 +91,8 @@ type ListObjectsInput struct {
EncodingType types.EncodingType
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Marker is where you want Amazon S3 to start listing from. Amazon S3 starts

View File

@@ -76,9 +76,9 @@ type ListObjectsV2Input struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -96,7 +96,8 @@ type ListObjectsV2Input struct {
EncodingType types.EncodingType
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The owner field is not present in listV2 by default, if you want to return owner
@@ -181,9 +182,9 @@ type ListObjectsV2Output struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
Name *string
@@ -329,12 +330,13 @@ func NewListObjectsV2Paginator(client ListObjectsV2APIClient, params *ListObject
client: client,
params: params,
firstPage: true,
nextToken: params.ContinuationToken,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListObjectsV2Paginator) HasMorePages() bool {
return p.firstPage || p.nextToken != nil
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListObjectsV2 page.
@@ -360,7 +362,10 @@ func (p *ListObjectsV2Paginator) NextPage(ctx context.Context, optFns ...func(*O
p.nextToken = result.NextContinuationToken
}
if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}

View File

@@ -24,8 +24,10 @@ import (
// more than 1,000 parts, the response returns an IsTruncated field with the value
// of true, and a NextPartNumberMarker element. In subsequent ListParts requests
// you can include the part-number-marker query string parameter and set its value
// to the NextPartNumberMarker field value from the previous response. For more
// information on multipart uploads, see Uploading Objects Using Multipart Upload
// to the NextPartNumberMarker field value from the previous response. If the
// upload was created using a checksum algorithm, you will need to have permission
// to the kms:Decrypt action for the request to succeed. For more information on
// multipart uploads, see Uploading Objects Using Multipart Upload
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html). For
// information on permissions required to use the multipart upload API, see
// Multipart Upload and Permissions
@@ -48,6 +50,10 @@ import (
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html)
//
// *
// GetObjectAttributes
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectAttributes.html)
//
// *
// ListMultipartUploads
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html)
func (c *Client) ListParts(ctx context.Context, params *ListPartsInput, optFns ...func(*Options)) (*ListPartsOutput, error) {
@@ -79,9 +85,9 @@ type ListPartsInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -99,7 +105,8 @@ type ListPartsInput struct {
UploadId *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Sets the maximum number of parts to return.
@@ -111,12 +118,33 @@ type ListPartsInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
// The server-side encryption (SSE) algorithm used to encrypt the object. This
// parameter is needed only when the object was created using a checksum algorithm.
// For more information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerAlgorithm *string
// The server-side encryption (SSE) customer managed key. This parameter is needed
// only when the object was created using a checksum algorithm. For more
// information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerKey *string
// The MD5 server-side encryption (SSE) customer managed key. This parameter is
// needed only when the object was created using a checksum algorithm. For more
// information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerKeyMD5 *string
noSmithyDocumentSerde
}
@@ -142,6 +170,9 @@ type ListPartsOutput struct {
// return the access point ARN or access point alias if used.
Bucket *string
// The algorithm that was used to create a checksum of the object.
ChecksumAlgorithm types.ChecksumAlgorithm
// Container element that identifies who initiated the multipart upload. If the
// initiator is an Amazon Web Services account, this element provides the same
// information as the Owner element. If the initiator is an IAM User, this element
@@ -316,12 +347,13 @@ func NewListPartsPaginator(client ListPartsAPIClient, params *ListPartsInput, op
client: client,
params: params,
firstPage: true,
nextToken: params.PartNumberMarker,
}
}
// HasMorePages returns a boolean indicating whether more pages are available
func (p *ListPartsPaginator) HasMorePages() bool {
return p.firstPage || p.nextToken != nil
return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0)
}
// NextPage retrieves the next ListParts page.
@@ -347,7 +379,10 @@ func (p *ListPartsPaginator) NextPage(ctx context.Context, optFns ...func(*Optio
p.nextToken = result.NextPartNumberMarker
}
if p.options.StopOnDuplicateToken && prevToken != nil && p.nextToken != nil && *prevToken == *p.nextToken {
if p.options.StopOnDuplicateToken &&
prevToken != nil &&
p.nextToken != nil &&
*prevToken == *p.nextToken {
p.nextToken = nil
}

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -76,8 +77,20 @@ type PutBucketAccelerateConfigurationInput struct {
// This member is required.
Bucket *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -147,6 +160,9 @@ func (c *Client) addOperationPutBucketAccelerateConfigurationMiddlewares(stack *
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketAccelerateConfigurationInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketAccelerateConfigurationUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -174,6 +190,26 @@ func newServiceMetadataMiddleware_opPutBucketAccelerateConfiguration(region stri
}
}
// getPutBucketAccelerateConfigurationRequestAlgorithmMember gets the request
// checksum algorithm value provided as input.
func getPutBucketAccelerateConfigurationRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketAccelerateConfigurationInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketAccelerateConfigurationInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketAccelerateConfigurationRequestAlgorithmMember,
RequireChecksum: false,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketAccelerateConfigurationBucketMember returns a pointer to string
// denoting a provided bucket member valueand a boolean indicating if the input has
// a modeled bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -28,15 +29,22 @@ import (
// application needs, you may choose to set the ACL on a bucket using either the
// request body or the headers. For example, if you have an existing application
// that updates a bucket ACL using the request body, then you can continue to use
// that approach. Access Permissions You can set access permissions using one of
// the following methods:
// that approach. If your bucket uses the bucket owner enforced setting for S3
// Object Ownership, ACLs are disabled and no longer affect permissions. You must
// use policies to grant access to your bucket and the objects in it. Requests to
// set ACLs or update ACLs fail and return the AccessControlListNotSupported error
// code. Requests to read ACLs are still supported. For more information, see
// Controlling object ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. Access Permissions You can set access permissions
// using one of the following methods:
//
// * Specify a canned ACL with the x-amz-acl request
// header. Amazon S3 supports a set of predefined ACLs, known as canned ACLs. Each
// canned ACL has a predefined set of grantees and permissions. Specify the canned
// ACL name as the value of x-amz-acl. If you use this header, you cannot use other
// access control-specific headers in your request. For more information, see
// Canned ACL
// * Specify a canned ACL with the x-amz-acl
// request header. Amazon S3 supports a set of predefined ACLs, known as canned
// ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify
// the canned ACL name as the value of x-amz-acl. If you use this header, you
// cannot use other access control-specific headers in your request. For more
// information, see Canned ACL
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL).
//
// *
@@ -174,6 +182,17 @@ type PutBucketAclInput struct {
// Contains the elements that set the ACL permissions for an object per grantee.
AccessControlPolicy *types.AccessControlPolicy
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. This header must be used as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, go to RFC 1864.
@@ -183,7 +202,8 @@ type PutBucketAclInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Allows grantee the read, write, read ACP, and write ACP permissions on the
@@ -262,9 +282,6 @@ func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, op
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketAclValidationMiddleware(stack); err != nil {
return err
}
@@ -274,6 +291,9 @@ func (c *Client) addOperationPutBucketAclMiddlewares(stack *middleware.Stack, op
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketAclInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketAclUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -301,6 +321,26 @@ func newServiceMetadataMiddleware_opPutBucketAcl(region string) *awsmiddleware.R
}
}
// getPutBucketAclRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getPutBucketAclRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketAclInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketAclInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketAclRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketAclBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -109,7 +109,8 @@ type PutBucketAnalyticsConfigurationInput struct {
Id *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -84,6 +85,17 @@ type PutBucketCorsInput struct {
// This member is required.
CORSConfiguration *types.CORSConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. This header must be used as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, go to RFC 1864.
@@ -93,7 +105,8 @@ type PutBucketCorsInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -154,9 +167,6 @@ func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, o
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketCorsValidationMiddleware(stack); err != nil {
return err
}
@@ -166,6 +176,9 @@ func (c *Client) addOperationPutBucketCorsMiddlewares(stack *middleware.Stack, o
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketCorsInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketCorsUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -193,6 +206,26 @@ func newServiceMetadataMiddleware_opPutBucketCors(region string) *awsmiddleware.
}
}
// getPutBucketCorsRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getPutBucketCorsRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketCorsInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketCorsInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketCorsRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketCorsBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -16,8 +17,11 @@ import (
// Amazon S3 Bucket Key for an existing bucket. Default encryption for a bucket can
// use server-side encryption with Amazon S3-managed keys (SSE-S3) or customer
// managed keys (SSE-KMS). If you specify default encryption using SSE-KMS, you can
// also configure Amazon S3 Bucket Key. For information about default encryption,
// see Amazon S3 default bucket encryption
// also configure Amazon S3 Bucket Key. When the default encryption is SSE-KMS, if
// you upload an object to the bucket and do not specify the KMS key to use for
// encryption, Amazon S3 uses the default Amazon Web Services managed KMS key for
// your account. For information about default encryption, see Amazon S3 default
// bucket encryption
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-encryption.html) in the
// Amazon S3 User Guide. For more information about S3 Bucket Keys, see Amazon S3
// Bucket Keys (https://docs.aws.amazon.com/AmazonS3/latest/dev/bucket-key.html) in
@@ -73,6 +77,17 @@ type PutBucketEncryptionInput struct {
// This member is required.
ServerSideEncryptionConfiguration *types.ServerSideEncryptionConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the server-side encryption
// configuration. For requests made using the Amazon Web Services Command Line
// Interface (CLI) or Amazon Web Services SDKs, this field is calculated
@@ -80,7 +95,8 @@ type PutBucketEncryptionInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -141,9 +157,6 @@ func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.St
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketEncryptionValidationMiddleware(stack); err != nil {
return err
}
@@ -153,6 +166,9 @@ func (c *Client) addOperationPutBucketEncryptionMiddlewares(stack *middleware.St
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketEncryptionInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketEncryptionUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -180,6 +196,26 @@ func newServiceMetadataMiddleware_opPutBucketEncryption(region string) *awsmiddl
}
}
// getPutBucketEncryptionRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutBucketEncryptionRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketEncryptionInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketEncryptionInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketEncryptionRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketEncryptionBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -17,16 +17,16 @@ import (
// Intelligent-Tiering storage class is designed to optimize storage costs by
// automatically moving data to the most cost-effective storage access tier,
// without performance impact or operational overhead. S3 Intelligent-Tiering
// delivers automatic cost savings in two low latency and high throughput access
// tiers. For data that can be accessed asynchronously, you can choose to activate
// automatic archiving capabilities within the S3 Intelligent-Tiering storage
// class. The S3 Intelligent-Tiering storage class is the ideal storage class for
// data with unknown, changing, or unpredictable access patterns, independent of
// object size or retention period. If the size of an object is less than 128 KB,
// it is not eligible for auto-tiering. Smaller objects can be stored, but they are
// always charged at the Frequent Access tier rates in the S3 Intelligent-Tiering
// storage class. For more information, see Storage class for automatically
// optimizing frequently and infrequently accessed objects
// delivers automatic cost savings in three low latency and high throughput access
// tiers. To get the lowest storage cost on data that can be accessed in minutes to
// hours, you can choose to activate additional archiving capabilities. The S3
// Intelligent-Tiering storage class is the ideal storage class for data with
// unknown, changing, or unpredictable access patterns, independent of object size
// or retention period. If the size of an object is less than 128 KB, it is not
// monitored and not eligible for auto-tiering. Smaller objects can be stored, but
// they are always charged at the Frequent Access tier rates in the S3
// Intelligent-Tiering storage class. For more information, see Storage class for
// automatically optimizing frequently and infrequently accessed objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html#sc-dynamic-data-access).
// Operations related to PutBucketIntelligentTieringConfiguration include:
//

View File

@@ -110,7 +110,8 @@ type PutBucketInventoryConfigurationInput struct {
InventoryConfiguration *types.InventoryConfiguration
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -13,8 +14,10 @@ import (
)
// Creates a new lifecycle configuration for the bucket or replaces an existing
// lifecycle configuration. For information about lifecycle configuration, see
// Managing your storage lifecycle
// lifecycle configuration. Keep in mind that this will overwrite an existing
// lifecycle configuration, so if you want to retain any configuration details,
// they must be included in the new lifecycle configuration. For information about
// lifecycle configuration, see Managing your storage lifecycle
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html).
// Bucket lifecycle configuration now supports specifying a lifecycle rule using an
// object key name prefix, one or more object tags, or a combination of both.
@@ -24,24 +27,26 @@ import (
// PutBucketLifecycle
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html).
// Rules You specify the lifecycle configuration in your request body. The
// lifecycle configuration is specified as XML consisting of one or more rules.
// Each rule consists of the following:
// lifecycle configuration is specified as XML consisting of one or more rules. An
// Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not
// adjustable. Each rule consists of the following:
//
// * Filter identifying a subset of objects
// to which the rule applies. The filter can be based on a key name prefix, object
// tags, or a combination of both.
// * Filter identifying a subset
// of objects to which the rule applies. The filter can be based on a key name
// prefix, object tags, or a combination of both.
//
// * Status whether the rule is in effect.
// * Status whether the rule is in
// effect.
//
// * One
// or more lifecycle transition and expiration actions that you want Amazon S3 to
// perform on the objects identified by the filter. If the state of your bucket is
// versioning-enabled or versioning-suspended, you can have many versions of the
// same object (one current version and zero or more noncurrent versions). Amazon
// S3 provides predefined actions that you can specify for current and noncurrent
// object versions.
// * One or more lifecycle transition and expiration actions that you want
// Amazon S3 to perform on the objects identified by the filter. If the state of
// your bucket is versioning-enabled or versioning-suspended, you can have many
// versions of the same object (one current version and zero or more noncurrent
// versions). Amazon S3 provides predefined actions that you can specify for
// current and noncurrent object versions.
//
// For more information, see Object Lifecycle Management
// For more information, see Object
// Lifecycle Management
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html) and
// Lifecycle Configuration Elements
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html).
@@ -101,8 +106,20 @@ type PutBucketLifecycleConfigurationInput struct {
// This member is required.
Bucket *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Container for lifecycle rules. You can add as many as 1,000 rules.
@@ -166,9 +183,6 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketLifecycleConfigurationValidationMiddleware(stack); err != nil {
return err
}
@@ -178,6 +192,9 @@ func (c *Client) addOperationPutBucketLifecycleConfigurationMiddlewares(stack *m
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketLifecycleConfigurationInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketLifecycleConfigurationUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -205,6 +222,26 @@ func newServiceMetadataMiddleware_opPutBucketLifecycleConfiguration(region strin
}
}
// getPutBucketLifecycleConfigurationRequestAlgorithmMember gets the request
// checksum algorithm value provided as input.
func getPutBucketLifecycleConfigurationRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketLifecycleConfigurationInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketLifecycleConfigurationInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketLifecycleConfigurationRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketLifecycleConfigurationBucketMember returns a pointer to string
// denoting a provided bucket member valueand a boolean indicating if the input has
// a modeled bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -18,16 +19,22 @@ import (
// of a bucket, you must be the bucket owner. The bucket owner is automatically
// granted FULL_CONTROL to all logs. You use the Grantee request element to grant
// access to other people. The Permissions request element specifies the kind of
// access the grantee has to the logs. Grantee Values You can specify the person
// (grantee) to whom you're assigning access rights (using request elements) in the
// following ways:
// access the grantee has to the logs. If the target bucket for log delivery uses
// the bucket owner enforced setting for S3 Object Ownership, you can't use the
// Grantee request element to grant access to others. Permissions can only be
// granted using policies. For more information, see Permissions for server access
// log delivery
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/enable-server-access-logging.html#grant-log-delivery-permissions-general)
// in the Amazon S3 User Guide. Grantee Values You can specify the person (grantee)
// to whom you're assigning access rights (using request elements) in the following
// ways:
//
// * By the person's ID: <>ID<><>GranteesEmail<> DisplayName is
// optional and ignored in the request.
// * By the person's ID: <>ID<><>GranteesEmail<> DisplayName is optional
// and ignored in the request.
//
// * By Email address:
// <>Grantees@email.com<> The grantee is resolved to the CanonicalUser and, in a
// response to a GET Object acl request, appears as the CanonicalUser.
// * By Email address: <>Grantees@email.com<> The
// grantee is resolved to the CanonicalUser and, in a response to a GET Object acl
// request, appears as the CanonicalUser.
//
// * By URI:
// <>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<>
@@ -36,8 +43,9 @@ import (
// logging, you use LoggingEnabled and its children request elements. To disable
// logging, you use an empty BucketLoggingStatus request element: For more
// information about server access logging, see Server Access Logging
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerLogs.html). For more
// information about creating a bucket, see CreateBucket
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/ServerLogs.html) in the
// Amazon S3 User Guide. For more information about creating a bucket, see
// CreateBucket
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html). For
// more information about returning the logging status of a bucket, see
// GetBucketLogging
@@ -85,13 +93,25 @@ type PutBucketLoggingInput struct {
// This member is required.
BucketLoggingStatus *types.BucketLoggingStatus
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The MD5 hash of the PutBucketLogging request body. For requests made using the
// Amazon Web Services Command Line Interface (CLI) or Amazon Web Services SDKs,
// this field is calculated automatically.
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -152,9 +172,6 @@ func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketLoggingValidationMiddleware(stack); err != nil {
return err
}
@@ -164,6 +181,9 @@ func (c *Client) addOperationPutBucketLoggingMiddlewares(stack *middleware.Stack
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketLoggingInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketLoggingUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -191,6 +211,26 @@ func newServiceMetadataMiddleware_opPutBucketLogging(region string) *awsmiddlewa
}
}
// getPutBucketLoggingRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutBucketLoggingRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketLoggingInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketLoggingInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketLoggingRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketLoggingBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -84,7 +84,8 @@ type PutBucketMetricsConfigurationInput struct {
MetricsConfiguration *types.MetricsConfiguration
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde

View File

@@ -31,18 +31,22 @@ import (
// more information, see Configuring Notifications for Amazon S3 Events
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html). You
// can disable notifications by adding the empty NotificationConfiguration element.
// By default, only the bucket owner can configure notifications on a bucket.
// However, bucket owners can use a bucket policy to grant permission to other
// users to set this configuration with s3:PutBucketNotification permission. The
// PUT notification is an atomic operation. For example, suppose your notification
// configuration includes SNS topic, SQS queue, and Lambda function configurations.
// When you send a PUT request with this configuration, Amazon S3 sends test
// messages to your SNS topic. If the message fails, the entire PUT action will
// fail, and Amazon S3 will not add the configuration to your bucket. Responses If
// the configuration in the request body includes only one TopicConfiguration
// specifying only the s3:ReducedRedundancyLostObject event type, the response will
// also include the x-amz-sns-test-message-id header containing the message ID of
// the test notification sent to the topic. The following action is related to
// For more information about the number of event notification configurations that
// you can create per bucket, see Amazon S3 service quotas
// (https://docs.aws.amazon.com/general/latest/gr/s3.html#limits_s3) in Amazon Web
// Services General Reference. By default, only the bucket owner can configure
// notifications on a bucket. However, bucket owners can use a bucket policy to
// grant permission to other users to set this configuration with
// s3:PutBucketNotification permission. The PUT notification is an atomic
// operation. For example, suppose your notification configuration includes SNS
// topic, SQS queue, and Lambda function configurations. When you send a PUT
// request with this configuration, Amazon S3 sends test messages to your SNS
// topic. If the message fails, the entire PUT action will fail, and Amazon S3 will
// not add the configuration to your bucket. Responses If the configuration in the
// request body includes only one TopicConfiguration specifying only the
// s3:ReducedRedundancyLostObject event type, the response will also include the
// x-amz-sns-test-message-id header containing the message ID of the test
// notification sent to the topic. The following action is related to
// PutBucketNotificationConfiguration:
//
// * GetBucketNotificationConfiguration
@@ -76,9 +80,14 @@ type PutBucketNotificationConfigurationInput struct {
NotificationConfiguration *types.NotificationConfiguration
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Skips validation of Amazon SQS, Amazon SNS, and Lambda destinations. True or
// false value.
SkipDestinationValidation bool
noSmithyDocumentSerde
}

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -14,10 +15,10 @@ import (
// Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this
// operation, you must have the s3:PutBucketOwnershipControls permission. For more
// information about Amazon S3 permissions, see Specifying Permissions in a Policy
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/using-with-s3-actions.html).
// For information about Amazon S3 Object Ownership, see Using Object Ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/about-object-ownership.html).
// information about Amazon S3 permissions, see Specifying permissions in a policy
// (https://docs.aws.amazon.com/AmazonS3/latest/user-guide/using-with-s3-actions.html).
// For information about Amazon S3 Object Ownership, see Using object ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/user-guide/about-object-ownership.html).
// The following operations are related to PutBucketOwnershipControls:
//
// *
@@ -46,8 +47,8 @@ type PutBucketOwnershipControlsInput struct {
// This member is required.
Bucket *string
// The OwnershipControls (BucketOwnerPreferred or ObjectWriter) that you want to
// apply to this Amazon S3 bucket.
// The OwnershipControls (BucketOwnerEnforced, BucketOwnerPreferred, or
// ObjectWriter) that you want to apply to this Amazon S3 bucket.
//
// This member is required.
OwnershipControls *types.OwnershipControls
@@ -58,7 +59,8 @@ type PutBucketOwnershipControlsInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -119,9 +121,6 @@ func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middle
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketOwnershipControlsValidationMiddleware(stack); err != nil {
return err
}
@@ -131,6 +130,9 @@ func (c *Client) addOperationPutBucketOwnershipControlsMiddlewares(stack *middle
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketOwnershipControlsInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketOwnershipControlsUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -158,6 +160,16 @@ func newServiceMetadataMiddleware_opPutBucketOwnershipControls(region string) *a
}
}
func addPutBucketOwnershipControlsInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: nil,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketOwnershipControlsBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,7 +6,9 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
@@ -58,6 +60,17 @@ type PutBucketPolicyInput struct {
// This member is required.
Policy *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// Set this parameter to true to confirm that you want to remove your permissions
// to change this bucket policy in the future.
ConfirmRemoveSelfBucketAccess bool
@@ -68,7 +81,8 @@ type PutBucketPolicyInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -129,9 +143,6 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack,
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketPolicyValidationMiddleware(stack); err != nil {
return err
}
@@ -141,6 +152,9 @@ func (c *Client) addOperationPutBucketPolicyMiddlewares(stack *middleware.Stack,
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketPolicyInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketPolicyUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -168,6 +182,26 @@ func newServiceMetadataMiddleware_opPutBucketPolicy(region string) *awsmiddlewar
}
}
// getPutBucketPolicyRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutBucketPolicyRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketPolicyInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketPolicyInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketPolicyRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketPolicyBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -92,6 +93,17 @@ type PutBucketReplicationInput struct {
// This member is required.
ReplicationConfiguration *types.ReplicationConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. You must use this header as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, see RFC 1864
@@ -101,7 +113,8 @@ type PutBucketReplicationInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// A token to allow Object Lock to be enabled for an existing bucket.
@@ -165,9 +178,6 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketReplicationValidationMiddleware(stack); err != nil {
return err
}
@@ -177,6 +187,9 @@ func (c *Client) addOperationPutBucketReplicationMiddlewares(stack *middleware.S
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketReplicationInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketReplicationUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -204,6 +217,26 @@ func newServiceMetadataMiddleware_opPutBucketReplication(region string) *awsmidd
}
}
// getPutBucketReplicationRequestAlgorithmMember gets the request checksum
// algorithm value provided as input.
func getPutBucketReplicationRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketReplicationInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketReplicationInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketReplicationRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketReplicationBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -52,6 +53,17 @@ type PutBucketRequestPaymentInput struct {
// This member is required.
RequestPaymentConfiguration *types.RequestPaymentConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. You must use this header as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, see RFC 1864
@@ -61,7 +73,8 @@ type PutBucketRequestPaymentInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -122,9 +135,6 @@ func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middlewar
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketRequestPaymentValidationMiddleware(stack); err != nil {
return err
}
@@ -134,6 +144,9 @@ func (c *Client) addOperationPutBucketRequestPaymentMiddlewares(stack *middlewar
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketRequestPaymentInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketRequestPaymentUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -161,6 +174,26 @@ func newServiceMetadataMiddleware_opPutBucketRequestPayment(region string) *awsm
}
}
// getPutBucketRequestPaymentRequestAlgorithmMember gets the request checksum
// algorithm value provided as input.
func getPutBucketRequestPaymentRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketRequestPaymentInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketRequestPaymentInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketRequestPaymentRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketRequestPaymentBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -97,6 +98,17 @@ type PutBucketTaggingInput struct {
// This member is required.
Tagging *types.Tagging
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. You must use this header as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, see RFC 1864
@@ -106,7 +118,8 @@ type PutBucketTaggingInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -167,9 +180,6 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketTaggingValidationMiddleware(stack); err != nil {
return err
}
@@ -179,6 +189,9 @@ func (c *Client) addOperationPutBucketTaggingMiddlewares(stack *middleware.Stack
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketTaggingInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketTaggingUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -206,6 +219,26 @@ func newServiceMetadataMiddleware_opPutBucketTagging(region string) *awsmiddlewa
}
}
// getPutBucketTaggingRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutBucketTaggingRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketTaggingInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketTaggingInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketTaggingRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketTaggingBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -6,30 +6,31 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Sets the versioning state of an existing bucket. To set the versioning state,
// you must be the bucket owner. You can set the versioning state with one of the
// following values: Enabled—Enables versioning for the objects in the bucket. All
// objects added to the bucket receive a unique version ID. Suspended—Disables
// versioning for the objects in the bucket. All objects added to the bucket
// receive the version ID null. If the versioning state has never been set on a
// bucket, it has no versioning state; a GetBucketVersioning
// Sets the versioning state of an existing bucket. You can set the versioning
// state with one of the following values: Enabled—Enables versioning for the
// objects in the bucket. All objects added to the bucket receive a unique version
// ID. Suspended—Disables versioning for the objects in the bucket. All objects
// added to the bucket receive the version ID null. If the versioning state has
// never been set on a bucket, it has no versioning state; a GetBucketVersioning
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketVersioning.html)
// request does not return a versioning state value. If the bucket owner enables
// MFA Delete in the bucket versioning configuration, the bucket owner must include
// the x-amz-mfa request header and the Status and the MfaDelete request elements
// in a request to set the versioning state of the bucket. If you have an object
// expiration lifecycle policy in your non-versioned bucket and you want to
// maintain the same permanent delete behavior when you enable versioning, you must
// add a noncurrent expiration policy. The noncurrent expiration lifecycle policy
// will manage the deletes of the noncurrent object versions in the version-enabled
// bucket. (A version-enabled bucket maintains one current and zero or more
// noncurrent object versions.) For more information, see Lifecycle and Versioning
// request does not return a versioning state value. In order to enable MFA Delete,
// you must be the bucket owner. If you are the bucket owner and want to enable MFA
// Delete in the bucket versioning configuration, you must include the x-amz-mfa
// request header and the Status and the MfaDelete request elements in a request to
// set the versioning state of the bucket. If you have an object expiration
// lifecycle policy in your non-versioned bucket and you want to maintain the same
// permanent delete behavior when you enable versioning, you must add a noncurrent
// expiration policy. The noncurrent expiration lifecycle policy will manage the
// deletes of the noncurrent object versions in the version-enabled bucket. (A
// version-enabled bucket maintains one current and zero or more noncurrent object
// versions.) For more information, see Lifecycle and Versioning
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html#lifecycle-and-other-bucket-config).
// Related Resources
//
@@ -70,6 +71,17 @@ type PutBucketVersioningInput struct {
// This member is required.
VersioningConfiguration *types.VersioningConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// >The base64-encoded 128-bit MD5 digest of the data. You must use this header as
// a message integrity check to verify that the request body was not corrupted in
// transit. For more information, see RFC 1864
@@ -79,7 +91,8 @@ type PutBucketVersioningInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The concatenation of the authentication device's serial number, a space, and the
@@ -144,9 +157,6 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketVersioningValidationMiddleware(stack); err != nil {
return err
}
@@ -156,6 +166,9 @@ func (c *Client) addOperationPutBucketVersioningMiddlewares(stack *middleware.St
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketVersioningInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketVersioningUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -183,6 +196,26 @@ func newServiceMetadataMiddleware_opPutBucketVersioning(region string) *awsmiddl
}
}
// getPutBucketVersioningRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutBucketVersioningRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketVersioningInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketVersioningInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketVersioningRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketVersioningBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -110,6 +111,17 @@ type PutBucketWebsiteInput struct {
// This member is required.
WebsiteConfiguration *types.WebsiteConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. You must use this header as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, see RFC 1864
@@ -119,7 +131,8 @@ type PutBucketWebsiteInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -180,9 +193,6 @@ func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutBucketWebsiteValidationMiddleware(stack); err != nil {
return err
}
@@ -192,6 +202,9 @@ func (c *Client) addOperationPutBucketWebsiteMiddlewares(stack *middleware.Stack
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutBucketWebsiteInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutBucketWebsiteUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -219,6 +232,26 @@ func newServiceMetadataMiddleware_opPutBucketWebsite(region string) *awsmiddlewa
}
}
// getPutBucketWebsiteRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutBucketWebsiteRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutBucketWebsiteInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutBucketWebsiteInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutBucketWebsiteRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutBucketWebsiteBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -7,6 +7,7 @@ import (
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -60,12 +61,25 @@ import (
// For more information, see Access Control List (ACL) Overview
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) and Managing
// ACLs Using the REST API
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html).
// Storage Class Options By default, Amazon S3 uses the STANDARD Storage Class to
// store newly created objects. The STANDARD storage class provides high durability
// and high availability. Depending on performance needs, you can specify a
// different Storage Class. Amazon S3 on Outposts only uses the OUTPOSTS Storage
// Class. For more information, see Storage Classes
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-using-rest-api.html). If
// the bucket that you're uploading objects to uses the bucket owner enforced
// setting for S3 Object Ownership, ACLs are disabled and no longer affect
// permissions. Buckets that use this setting only accept PUT requests that don't
// specify an ACL or PUT requests that specify bucket owner full control ACLs, such
// as the bucket-owner-full-control canned ACL or an equivalent form of this ACL
// expressed in the XML format. PUT requests that contain other ACLs (for example,
// custom grants to certain Amazon Web Services accounts) fail and return a 400
// error with the error code AccessControlListNotSupported. For more information,
// see Controlling ownership of objects and disabling ACLs
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. If your bucket uses the bucket owner enforced
// setting for Object Ownership, all objects written to the bucket by any account
// will be owned by the bucket owner. Storage Class Options By default, Amazon S3
// uses the STANDARD Storage Class to store newly created objects. The STANDARD
// storage class provides high durability and high availability. Depending on
// performance needs, you can specify a different Storage Class. Amazon S3 on
// Outposts only uses the OUTPOSTS Storage Class. For more information, see Storage
// Classes
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html) in
// the Amazon S3 User Guide. Versioning If you enable versioning for a bucket,
// Amazon S3 automatically generates a unique version ID for the object being
@@ -114,9 +128,9 @@ type PutObjectInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -148,6 +162,49 @@ type PutObjectInput struct {
// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9).
CacheControl *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 32-bit CRC32 checksum of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 32-bit CRC32C checksum of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 160-bit SHA-1 digest of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 256-bit SHA-256 digest of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Specifies presentational information for the object. For more information, see
// http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1
// (http://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.5.1).
@@ -184,7 +241,8 @@ type PutObjectInput struct {
ContentType *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The date and time at which the object is no longer cacheable. For more
@@ -225,8 +283,8 @@ type PutObjectInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -303,6 +361,38 @@ type PutObjectOutput struct {
// encryption with Amazon Web Services KMS (SSE-KMS).
BucketKeyEnabled bool
// The base64-encoded, 32-bit CRC32 checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// The base64-encoded, 32-bit CRC32C checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// The base64-encoded, 160-bit SHA-1 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// The base64-encoded, 256-bit SHA-256 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Entity tag for the uploaded object.
ETag *string
@@ -311,7 +401,7 @@ type PutObjectOutput struct {
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html)),
// the response includes this header. It includes the expiry-date and rule-id
// key-value pairs that provide information about object expiration. The value of
// the rule-id is URL encoded.
// the rule-id is URL-encoded.
Expiration *string
// If present, indicates that the requester was successfully charged for the
@@ -410,6 +500,9 @@ func (c *Client) addOperationPutObjectMiddlewares(stack *middleware.Stack, optio
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutObjectInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutObjectUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -440,6 +533,26 @@ func newServiceMetadataMiddleware_opPutObject(region string) *awsmiddleware.Regi
}
}
// getPutObjectRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getPutObjectRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutObjectInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutObjectInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutObjectRequestAlgorithmMember,
RequireChecksum: false,
EnableTrailingChecksum: true,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutObjectBucketMember returns a pointer to string denoting a provided bucket
// member valueand a boolean indicating if the input has a modeled bucket name,
func getPutObjectBucketMember(input interface{}) (*string, bool) {

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -24,15 +25,22 @@ import (
// can continue to use that approach. For more information, see Access Control List
// (ACL) Overview
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html) in the
// Amazon S3 User Guide. Access Permissions You can set access permissions using
// one of the following methods:
// Amazon S3 User Guide. If your bucket uses the bucket owner enforced setting for
// S3 Object Ownership, ACLs are disabled and no longer affect permissions. You
// must use policies to grant access to your bucket and the objects in it. Requests
// to set ACLs or update ACLs fail and return the AccessControlListNotSupported
// error code. Requests to read ACLs are still supported. For more information, see
// Controlling object ownership
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/about-object-ownership.html)
// in the Amazon S3 User Guide. Access Permissions You can set access permissions
// using one of the following methods:
//
// * Specify a canned ACL with the x-amz-acl request
// header. Amazon S3 supports a set of predefined ACLs, known as canned ACLs. Each
// canned ACL has a predefined set of grantees and permissions. Specify the canned
// ACL name as the value of x-amz-acl. If you use this header, you cannot use other
// access control-specific headers in your request. For more information, see
// Canned ACL
// * Specify a canned ACL with the x-amz-acl
// request header. Amazon S3 supports a set of predefined ACLs, known as canned
// ACLs. Each canned ACL has a predefined set of grantees and permissions. Specify
// the canned ACL name as the value of x-amz-acl. If you use this header, you
// cannot use other access control-specific headers in your request. For more
// information, see Canned ACL
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/acl-overview.html#CannedACL).
//
// *
@@ -181,9 +189,9 @@ type PutObjectAclInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -197,6 +205,17 @@ type PutObjectAclInput struct {
// Contains the elements that set the ACL permissions for an object per grantee.
AccessControlPolicy *types.AccessControlPolicy
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The base64-encoded 128-bit MD5 digest of the data. This header must be used as a
// message integrity check to verify that the request body was not corrupted in
// transit. For more information, go to RFC 1864.>
@@ -206,7 +225,8 @@ type PutObjectAclInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Allows grantee the read, write, read ACP, and write ACP permissions on the
@@ -232,8 +252,8 @@ type PutObjectAclInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -304,9 +324,6 @@ func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, op
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutObjectAclValidationMiddleware(stack); err != nil {
return err
}
@@ -316,6 +333,9 @@ func (c *Client) addOperationPutObjectAclMiddlewares(stack *middleware.Stack, op
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutObjectAclInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutObjectAclUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -343,6 +363,26 @@ func newServiceMetadataMiddleware_opPutObjectAcl(region string) *awsmiddleware.R
}
}
// getPutObjectAclRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getPutObjectAclRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutObjectAclInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutObjectAclInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutObjectAclRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutObjectAclBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -6,13 +6,14 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Applies a Legal Hold configuration to the specified object. For more
// Applies a legal hold configuration to the specified object. For more
// information, see Locking Objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lock.html). This action
// is not supported by Amazon S3 on Outposts.
@@ -33,7 +34,7 @@ func (c *Client) PutObjectLegalHold(ctx context.Context, params *PutObjectLegalH
type PutObjectLegalHoldInput struct {
// The bucket name containing the object that you want to place a Legal Hold on.
// The bucket name containing the object that you want to place a legal hold on.
// When using this action with an access point, you must direct requests to the
// access point hostname. The access point hostname takes the form
// AccessPointName-AccountId.s3-accesspoint.Region.amazonaws.com. When using this
@@ -46,33 +47,45 @@ type PutObjectLegalHoldInput struct {
// This member is required.
Bucket *string
// The key name for the object that you want to place a Legal Hold on.
// The key name for the object that you want to place a legal hold on.
//
// This member is required.
Key *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The MD5 hash for the request body. For requests made using the Amazon Web
// Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is
// calculated automatically.
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Container element for the Legal Hold configuration you want to apply to the
// Container element for the legal hold configuration you want to apply to the
// specified object.
LegalHold *types.ObjectLockLegalHold
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
// The version ID of the object that you want to place a Legal Hold on.
// The version ID of the object that you want to place a legal hold on.
VersionId *string
noSmithyDocumentSerde
@@ -138,9 +151,6 @@ func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Sta
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutObjectLegalHoldValidationMiddleware(stack); err != nil {
return err
}
@@ -150,6 +160,9 @@ func (c *Client) addOperationPutObjectLegalHoldMiddlewares(stack *middleware.Sta
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutObjectLegalHoldInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutObjectLegalHoldUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -177,6 +190,26 @@ func newServiceMetadataMiddleware_opPutObjectLegalHold(region string) *awsmiddle
}
}
// getPutObjectLegalHoldRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutObjectLegalHoldRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutObjectLegalHoldInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutObjectLegalHoldInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutObjectLegalHoldRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutObjectLegalHoldBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -49,13 +50,25 @@ type PutObjectLockConfigurationInput struct {
// This member is required.
Bucket *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The MD5 hash for the request body. For requests made using the Amazon Web
// Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is
// calculated automatically.
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// The Object Lock configuration that you want to apply to the specified bucket.
@@ -63,8 +76,8 @@ type PutObjectLockConfigurationInput struct {
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -135,9 +148,6 @@ func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middle
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutObjectLockConfigurationValidationMiddleware(stack); err != nil {
return err
}
@@ -147,6 +157,9 @@ func (c *Client) addOperationPutObjectLockConfigurationMiddlewares(stack *middle
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutObjectLockConfigurationInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutObjectLockConfigurationUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -174,6 +187,26 @@ func newServiceMetadataMiddleware_opPutObjectLockConfiguration(region string) *a
}
}
// getPutObjectLockConfigurationRequestAlgorithmMember gets the request checksum
// algorithm value provided as input.
func getPutObjectLockConfigurationRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutObjectLockConfigurationInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutObjectLockConfigurationInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutObjectLockConfigurationRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutObjectLockConfigurationBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -18,10 +19,7 @@ import (
// accounts require the s3:PutObjectRetention permission in order to place an
// Object Retention configuration on objects. Bypassing a Governance Retention
// configuration requires the s3:BypassGovernanceRetention permission. This action
// is not supported by Amazon S3 on Outposts. Permissions When the Object Lock
// retention mode is set to compliance, you need s3:PutObjectRetention and
// s3:BypassGovernanceRetention permissions. For other requests to
// PutObjectRetention, only s3:PutObjectRetention permissions are required.
// is not supported by Amazon S3 on Outposts.
func (c *Client) PutObjectRetention(ctx context.Context, params *PutObjectRetentionInput, optFns ...func(*Options)) (*PutObjectRetentionOutput, error) {
if params == nil {
params = &PutObjectRetentionInput{}
@@ -61,19 +59,31 @@ type PutObjectRetentionInput struct {
// Indicates whether this action should bypass Governance-mode restrictions.
BypassGovernanceRetention bool
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The MD5 hash for the request body. For requests made using the Amazon Web
// Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is
// calculated automatically.
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -148,9 +158,6 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutObjectRetentionValidationMiddleware(stack); err != nil {
return err
}
@@ -160,6 +167,9 @@ func (c *Client) addOperationPutObjectRetentionMiddlewares(stack *middleware.Sta
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutObjectRetentionInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutObjectRetentionUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -187,6 +197,26 @@ func newServiceMetadataMiddleware_opPutObjectRetention(region string) *awsmiddle
}
}
// getPutObjectRetentionRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutObjectRetentionRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutObjectRetentionInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutObjectRetentionInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutObjectRetentionRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutObjectRetentionBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -91,9 +92,9 @@ type PutObjectTaggingInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -110,19 +111,31 @@ type PutObjectTaggingInput struct {
// This member is required.
Tagging *types.Tagging
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The MD5 hash for the request body. For requests made using the Amazon Web
// Services Command Line Interface (CLI) or Amazon Web Services SDKs, this field is
// calculated automatically.
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -192,9 +205,6 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutObjectTaggingValidationMiddleware(stack); err != nil {
return err
}
@@ -204,6 +214,9 @@ func (c *Client) addOperationPutObjectTaggingMiddlewares(stack *middleware.Stack
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutObjectTaggingInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutObjectTaggingUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -231,6 +244,26 @@ func newServiceMetadataMiddleware_opPutObjectTagging(region string) *awsmiddlewa
}
}
// getPutObjectTaggingRequestAlgorithmMember gets the request checksum algorithm
// value provided as input.
func getPutObjectTaggingRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutObjectTaggingInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutObjectTaggingInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutObjectTaggingRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutObjectTaggingBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -74,13 +75,25 @@ type PutPublicAccessBlockInput struct {
// This member is required.
PublicAccessBlockConfiguration *types.PublicAccessBlockConfiguration
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The MD5 hash of the PutPublicAccessBlock request body. For requests made using
// the Amazon Web Services Command Line Interface (CLI) or Amazon Web Services
// SDKs, this field is calculated automatically.
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
noSmithyDocumentSerde
@@ -141,9 +154,6 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S
if err = swapWithCustomHTTPSignerMiddleware(stack, options); err != nil {
return err
}
if err = smithyhttp.AddContentChecksumMiddleware(stack); err != nil {
return err
}
if err = addOpPutPublicAccessBlockValidationMiddleware(stack); err != nil {
return err
}
@@ -153,6 +163,9 @@ func (c *Client) addOperationPutPublicAccessBlockMiddlewares(stack *middleware.S
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addPutPublicAccessBlockInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addPutPublicAccessBlockUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -180,6 +193,26 @@ func newServiceMetadataMiddleware_opPutPublicAccessBlock(region string) *awsmidd
}
}
// getPutPublicAccessBlockRequestAlgorithmMember gets the request checksum
// algorithm value provided as input.
func getPutPublicAccessBlockRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*PutPublicAccessBlockInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addPutPublicAccessBlockInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getPutPublicAccessBlockRequestAlgorithmMember,
RequireChecksum: true,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getPutPublicAccessBlockBucketMember returns a pointer to string denoting a
// provided bucket member valueand a boolean indicating if the input has a modeled
// bucket name,

View File

@@ -6,6 +6,7 @@ import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -259,9 +260,9 @@ type RestoreObjectInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -273,14 +274,26 @@ type RestoreObjectInput struct {
// This member is required.
Key *string
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter.
ChecksumAlgorithm types.ChecksumAlgorithm
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -367,6 +380,9 @@ func (c *Client) addOperationRestoreObjectMiddlewares(stack *middleware.Stack, o
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addRestoreObjectInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addRestoreObjectUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -394,6 +410,26 @@ func newServiceMetadataMiddleware_opRestoreObject(region string) *awsmiddleware.
}
}
// getRestoreObjectRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getRestoreObjectRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*RestoreObjectInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addRestoreObjectInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getRestoreObjectRequestAlgorithmMember,
RequireChecksum: false,
EnableTrailingChecksum: false,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getRestoreObjectBucketMember returns a pointer to string denoting a provided
// bucket member valueand a boolean indicating if the input has a modeled bucket
// name,

View File

@@ -23,6 +23,8 @@ import (
// action is not supported by Amazon S3 on Outposts. For more information about
// Amazon S3 Select, see Selecting Content from Objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/selecting-content-from-objects.html)
// and SELECT Command
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-glacier-select-sql-reference-select.html)
// in the Amazon S3 User Guide. For more information about using SQL with Amazon S3
// Select, see SQL Reference for Amazon S3 Select and S3 Glacier Select
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/s3-glacier-select-sql-reference.html)
@@ -155,25 +157,32 @@ type SelectObjectContentInput struct {
OutputSerialization *types.OutputSerialization
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Specifies if periodic request progress information should be enabled.
RequestProgress *types.RequestProgress
// The SSE Algorithm used to encrypt the object. For more information, see
// Server-Side Encryption (Using Customer-Provided Encryption Keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html).
// The server-side encryption (SSE) algorithm used to encrypt the object. This
// parameter is needed only when the object was created using a checksum algorithm.
// For more information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerAlgorithm *string
// The SSE Customer Key. For more information, see Server-Side Encryption (Using
// Customer-Provided Encryption Keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html).
// The server-side encryption (SSE) customer managed key. This parameter is needed
// only when the object was created using a checksum algorithm. For more
// information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerKey *string
// The SSE Customer Key MD5. For more information, see Server-Side Encryption
// (Using Customer-Provided Encryption Keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html).
// The MD5 server-side encryption (SSE) customer managed key. This parameter is
// needed only when the object was created using a checksum algorithm. For more
// information, see Protecting data using SSE-C keys
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ServerSideEncryptionCustomerKeys.html)
// in the Amazon S3 User Guide.
SSECustomerKeyMD5 *string
// Specifies the byte range of the object to get the records from. A record is

View File

@@ -7,6 +7,7 @@ import (
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http"
internalChecksum "github.com/aws/aws-sdk-go-v2/service/internal/checksum"
s3cust "github.com/aws/aws-sdk-go-v2/service/s3/internal/customizations"
"github.com/aws/aws-sdk-go-v2/service/s3/types"
"github.com/aws/smithy-go/middleware"
@@ -26,16 +27,18 @@ import (
// part request. Part numbers can be any number from 1 to 10,000, inclusive. A part
// number uniquely identifies a part and also defines its position within the
// object being created. If you upload a new part using the same part number that
// was used with a previous part, the previously uploaded part is overwritten. Each
// part must be at least 5 MB in size, except the last part. There is no size limit
// on the last part of your multipart upload. To ensure that data is not corrupted
// when traversing the network, specify the Content-MD5 header in the upload part
// request. Amazon S3 checks the part data against the provided MD5 value. If they
// do not match, Amazon S3 returns an error. If the upload request is signed with
// Signature Version 4, then Amazon Web Services S3 uses the x-amz-content-sha256
// header as a checksum instead of Content-MD5. For more information see
// Authenticating Requests: Using the Authorization Header (Amazon Web Services
// Signature Version 4)
// was used with a previous part, the previously uploaded part is overwritten. For
// information about maximum and minimum part sizes and other multipart upload
// specifications, see Multipart upload limits
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html) in the
// Amazon S3 User Guide. To ensure that data is not corrupted when traversing the
// network, specify the Content-MD5 header in the upload part request. Amazon S3
// checks the part data against the provided MD5 value. If they do not match,
// Amazon S3 returns an error. If the upload request is signed with Signature
// Version 4, then Amazon Web Services S3 uses the x-amz-content-sha256 header as a
// checksum instead of Content-MD5. For more information see Authenticating
// Requests: Using the Authorization Header (Amazon Web Services Signature Version
// 4)
// (https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-auth-using-authorization-header.html).
// Note: After you initiate multipart upload and upload one or more parts, you must
// either complete or abort multipart upload in order to stop getting charged for
@@ -139,9 +142,9 @@ type UploadPartInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -167,6 +170,51 @@ type UploadPartInput struct {
// Object data.
Body io.Reader
// Indicates the algorithm used to create the checksum for the object when using
// the SDK. This header will not provide any additional functionality if not using
// the SDK. When sending this header, there must be a corresponding x-amz-checksum
// or x-amz-trailer header sent. Otherwise, Amazon S3 fails the request with the
// HTTP status code 400 Bad Request. For more information, see Checking object
// integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. If you provide an individual checksum, Amazon S3
// ignores any provided ChecksumAlgorithm parameter. This checksum algorithm must
// be the same for all parts and it match the checksum value supplied in the
// CreateMultipartUpload request.
ChecksumAlgorithm types.ChecksumAlgorithm
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 32-bit CRC32 checksum of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 32-bit CRC32C checksum of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 160-bit SHA-1 digest of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This header specifies the
// base64-encoded, 256-bit SHA-256 digest of the object. For more information, see
// Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Size of the body in bytes. This parameter is useful when the size of the body
// cannot be determined automatically.
ContentLength int64
@@ -177,13 +225,14 @@ type UploadPartInput struct {
ContentMD5 *string
// The account ID of the expected bucket owner. If the bucket is owned by a
// different account, the request will fail with an HTTP 403 (Access Denied) error.
// different account, the request fails with the HTTP status code 403 Forbidden
// (access denied).
ExpectedBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer
@@ -214,6 +263,38 @@ type UploadPartOutput struct {
// encryption with Amazon Web Services KMS (SSE-KMS).
BucketKeyEnabled bool
// The base64-encoded, 32-bit CRC32 checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32 *string
// The base64-encoded, 32-bit CRC32C checksum of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumCRC32C *string
// The base64-encoded, 160-bit SHA-1 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA1 *string
// The base64-encoded, 256-bit SHA-256 digest of the object. This will only be
// present if it was uploaded with the object. With multipart uploads, this may not
// be a checksum value of the object. For more information about how checksums are
// calculated with multipart uploads, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html#large-object-checksums)
// in the Amazon S3 User Guide.
ChecksumSHA256 *string
// Entity tag for the uploaded object.
ETag *string
@@ -302,6 +383,9 @@ func (c *Client) addOperationUploadPartMiddlewares(stack *middleware.Stack, opti
if err = addMetadataRetrieverMiddleware(stack); err != nil {
return err
}
if err = addUploadPartInputChecksumMiddlewares(stack, options); err != nil {
return err
}
if err = addUploadPartUpdateEndpoint(stack, options); err != nil {
return err
}
@@ -332,6 +416,26 @@ func newServiceMetadataMiddleware_opUploadPart(region string) *awsmiddleware.Reg
}
}
// getUploadPartRequestAlgorithmMember gets the request checksum algorithm value
// provided as input.
func getUploadPartRequestAlgorithmMember(input interface{}) (string, bool) {
in := input.(*UploadPartInput)
if len(in.ChecksumAlgorithm) == 0 {
return "", false
}
return string(in.ChecksumAlgorithm), true
}
func addUploadPartInputChecksumMiddlewares(stack *middleware.Stack, options Options) error {
return internalChecksum.AddInputMiddleware(stack, internalChecksum.InputMiddlewareOptions{
GetAlgorithm: getUploadPartRequestAlgorithmMember,
RequireChecksum: false,
EnableTrailingChecksum: true,
EnableComputeSHA256PayloadHash: true,
EnableDecodedContentLengthHeader: true,
})
}
// getUploadPartBucketMember returns a pointer to string denoting a provided bucket
// member valueand a boolean indicating if the input has a modeled bucket name,
func getUploadPartBucketMember(input interface{}) (*string, bool) {

View File

@@ -16,19 +16,20 @@ import (
// Uploads a part by copying data from an existing object as data source. You
// specify the data source by adding the request header x-amz-copy-source in your
// request and a byte range by adding the request header x-amz-copy-source-range in
// your request. The minimum allowable part size for a multipart upload is 5 MB.
// For more information about multipart upload limits, go to Quick Facts
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/qfacts.html) in the Amazon S3
// User Guide. Instead of using an existing object as part data, you might use the
// UploadPart (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)
// action and provide data in your request. You must initiate a multipart upload
// before you can upload any part. In response to your initiate request. Amazon S3
// returns a unique identifier, the upload ID, that you must include in your upload
// part request. For more information about using the UploadPartCopy operation, see
// the following:
// your request. For information about maximum and minimum part sizes and other
// multipart upload specifications, see Multipart upload limits
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/qfacts.html) in the
// Amazon S3 User Guide. Instead of using an existing object as part data, you
// might use the UploadPart
// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html) action and
// provide data in your request. You must initiate a multipart upload before you
// can upload any part. In response to your initiate request. Amazon S3 returns a
// unique identifier, the upload ID, that you must include in your upload part
// request. For more information about using the UploadPartCopy operation, see the
// following:
//
// * For conceptual information about multipart uploads, see
// Uploading Objects Using Multipart Upload
// * For conceptual information about multipart uploads, see Uploading
// Objects Using Multipart Upload
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/uploadobjusingmpu.html) in the
// Amazon S3 User Guide.
//
@@ -38,7 +39,7 @@ import (
// Amazon S3 User Guide.
//
// * For information about copying objects using a single
// atomic action vs. the multipart upload, see Operations on Objects
// atomic action vs. a multipart upload, see Operations on Objects
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html) in the
// Amazon S3 User Guide.
//
@@ -148,9 +149,9 @@ type UploadPartCopyInput struct {
// you must direct requests to the S3 on Outposts hostname. The S3 on Outposts
// hostname takes the form
// AccessPointName-AccountId.outpostID.s3-outposts.Region.amazonaws.com. When using
// this action using S3 on Outposts through the Amazon Web Services SDKs, you
// this action with S3 on Outposts through the Amazon Web Services SDKs, you
// provide the Outposts bucket ARN in place of the bucket name. For more
// information about S3 on Outposts ARNs, see Using S3 on Outposts
// information about S3 on Outposts ARNs, see Using Amazon S3 on Outposts
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3onOutposts.html) in the
// Amazon S3 User Guide.
//
@@ -166,7 +167,7 @@ type UploadPartCopyInput struct {
// For objects not accessed through an access point, specify the name of the source
// bucket and key of the source object, separated by a slash (/). For example, to
// copy the object reports/january.pdf from the bucket awsexamplebucket, use
// awsexamplebucket/reports/january.pdf. The value must be URL encoded.
// awsexamplebucket/reports/january.pdf. The value must be URL-encoded.
//
// * For
// objects accessed through access points, specify the Amazon Resource Name (ARN)
@@ -183,7 +184,7 @@ type UploadPartCopyInput struct {
// reports/january.pdf through outpost my-outpost owned by account 123456789012 in
// Region us-west-2, use the URL encoding of
// arn:aws:s3-outposts:us-west-2:123456789012:outpost/my-outpost/object/reports/january.pdf.
// The value must be URL encoded.
// The value must be URL-encoded.
//
// To copy a specific version of an object, append
// ?versionId= to the value (for example,
@@ -244,19 +245,19 @@ type UploadPartCopyInput struct {
CopySourceSSECustomerKeyMD5 *string
// The account ID of the expected destination bucket owner. If the destination
// bucket is owned by a different account, the request will fail with an HTTP 403
// (Access Denied) error.
// bucket is owned by a different account, the request fails with the HTTP status
// code 403 Forbidden (access denied).
ExpectedBucketOwner *string
// The account ID of the expected source bucket owner. If the source bucket is
// owned by a different account, the request will fail with an HTTP 403 (Access
// Denied) error.
// owned by a different account, the request fails with the HTTP status code 403
// Forbidden (access denied).
ExpectedSourceBucketOwner *string
// Confirms that the requester knows that they will be charged for the request.
// Bucket owners need not specify this parameter in their requests. For information
// about downloading objects from requester pays buckets, see Downloading Objects
// in Requestor Pays Buckets
// about downloading objects from Requester Pays buckets, see Downloading Objects
// in Requester Pays Buckets
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectsinRequesterPaysBuckets.html)
// in the Amazon S3 User Guide.
RequestPayer types.RequestPayer

View File

@@ -96,6 +96,54 @@ type WriteGetObjectResponseInput struct {
// Specifies caching behavior along the request/reply chain.
CacheControl *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This specifies the
// base64-encoded, 32-bit CRC32 checksum of the object returned by the Object
// Lambda function. This may not match the checksum for the object stored in Amazon
// S3. Amazon S3 will perform validation of the checksum values only when the
// original GetObject request required checksum validation. For more information
// about checksums, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. Only one checksum header can be specified at a
// time. If you supply multiple checksum headers, this request will fail.
ChecksumCRC32 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This specifies the
// base64-encoded, 32-bit CRC32C checksum of the object returned by the Object
// Lambda function. This may not match the checksum for the object stored in Amazon
// S3. Amazon S3 will perform validation of the checksum values only when the
// original GetObject request required checksum validation. For more information
// about checksums, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. Only one checksum header can be specified at a
// time. If you supply multiple checksum headers, this request will fail.
ChecksumCRC32C *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This specifies the
// base64-encoded, 160-bit SHA-1 digest of the object returned by the Object Lambda
// function. This may not match the checksum for the object stored in Amazon S3.
// Amazon S3 will perform validation of the checksum values only when the original
// GetObject request required checksum validation. For more information about
// checksums, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. Only one checksum header can be specified at a
// time. If you supply multiple checksum headers, this request will fail.
ChecksumSHA1 *string
// This header can be used as a data integrity check to verify that the data
// received is the same data that was originally sent. This specifies the
// base64-encoded, 256-bit SHA-256 digest of the object returned by the Object
// Lambda function. This may not match the checksum for the object stored in Amazon
// S3. Amazon S3 will perform validation of the checksum values only when the
// original GetObject request required checksum validation. For more information
// about checksums, see Checking object integrity
// (https://docs.aws.amazon.com/AmazonS3/latest/userguide/checking-object-integrity.html)
// in the Amazon S3 User Guide. Only one checksum header can be specified at a
// time. If you supply multiple checksum headers, this request will fail.
ChecksumSHA256 *string
// Specifies presentational information for the object.
ContentDisposition *string
@@ -127,8 +175,8 @@ type WriteGetObjectResponseInput struct {
// A string that uniquely identifies an error condition. Returned in the tag of
// the error XML response for a corresponding GetObject call. Cannot be used with a
// successful StatusCode header or when the transformed object is provided in the
// body. All error codes from S3 are sentence-cased. Regex value is
// "^[A-Z][a-zA-Z]+$".
// body. All error codes from S3 are sentence-cased. The regular expression (regex)
// value is "^[A-Z][a-zA-Z]+$".
ErrorCode *string
// Contains a generic description of the error condition. Returned in the tag of
@@ -136,9 +184,10 @@ type WriteGetObjectResponseInput struct {
// successful StatusCode header or when the transformed object is provided in body.
ErrorMessage *string
// If object stored in Amazon S3 expiration is configured (see PUT Bucket
// lifecycle) it includes expiry-date and rule-id key-value pairs providing object
// expiration information. The value of the rule-id is URL encoded.
// If the object expiration is configured (see PUT Bucket lifecycle), the response
// includes this header. It includes the expiry-date and rule-id key-value pairs
// that provide the object expiration information. The value of the rule-id is
// URL-encoded.
Expiration *string
// The date and time at which the object is no longer cacheable.
@@ -238,7 +287,10 @@ type WriteGetObjectResponseInput struct {
// * 503 - Service Unavailable
StatusCode int32
// The class of storage used to store object in Amazon S3.
// Provides storage class information of the object. Amazon S3 returns this header
// for all objects except for S3 Standard storage class objects. For more
// information, see Storage Classes
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/storage-class-intro.html).
StorageClass types.StorageClass
// The number of tags, if any, on the object.

File diff suppressed because it is too large Load Diff

View File

@@ -28,7 +28,7 @@ type SelectObjectContentEventStreamReader interface {
Err() error
}
type selectObjectContentEventStream struct {
type selectObjectContentEventStreamReader struct {
stream chan types.SelectObjectContentEventStream
decoder *eventstream.Decoder
eventStream io.ReadCloser
@@ -38,8 +38,8 @@ type selectObjectContentEventStream struct {
closeOnce sync.Once
}
func newSelectObjectContentEventStream(readCloser io.ReadCloser, decoder *eventstream.Decoder) *selectObjectContentEventStream {
w := &selectObjectContentEventStream{
func newSelectObjectContentEventStreamReader(readCloser io.ReadCloser, decoder *eventstream.Decoder) *selectObjectContentEventStreamReader {
w := &selectObjectContentEventStreamReader{
stream: make(chan types.SelectObjectContentEventStream),
decoder: decoder,
eventStream: readCloser,
@@ -53,11 +53,11 @@ func newSelectObjectContentEventStream(readCloser io.ReadCloser, decoder *events
return w
}
func (r *selectObjectContentEventStream) Events() <-chan types.SelectObjectContentEventStream {
func (r *selectObjectContentEventStreamReader) Events() <-chan types.SelectObjectContentEventStream {
return r.stream
}
func (r *selectObjectContentEventStream) readEventStream() {
func (r *selectObjectContentEventStreamReader) readEventStream() {
defer r.Close()
defer close(r.stream)
@@ -92,7 +92,7 @@ func (r *selectObjectContentEventStream) readEventStream() {
}
}
func (r *selectObjectContentEventStream) deserializeEventMessage(msg *eventstream.Message) (types.SelectObjectContentEventStream, error) {
func (r *selectObjectContentEventStreamReader) deserializeEventMessage(msg *eventstream.Message) (types.SelectObjectContentEventStream, error) {
messageType := msg.Headers.Get(eventstreamapi.MessageTypeHeader)
if messageType == nil {
return nil, fmt.Errorf("%s event header not present", eventstreamapi.MessageTypeHeader)
@@ -133,26 +133,26 @@ func (r *selectObjectContentEventStream) deserializeEventMessage(msg *eventstrea
}
}
func (r *selectObjectContentEventStream) ErrorSet() <-chan struct{} {
func (r *selectObjectContentEventStreamReader) ErrorSet() <-chan struct{} {
return r.err.ErrorSet()
}
func (r *selectObjectContentEventStream) Close() error {
func (r *selectObjectContentEventStreamReader) Close() error {
r.closeOnce.Do(r.safeClose)
return r.Err()
}
func (r *selectObjectContentEventStream) safeClose() {
func (r *selectObjectContentEventStreamReader) safeClose() {
close(r.done)
r.eventStream.Close()
}
func (r *selectObjectContentEventStream) Err() error {
func (r *selectObjectContentEventStreamReader) Err() error {
return r.err.Err()
}
func (r *selectObjectContentEventStream) Closed() <-chan struct{} {
func (r *selectObjectContentEventStreamReader) Closed() <-chan struct{} {
return r.done
}
@@ -202,7 +202,7 @@ func (m *awsRestxml_deserializeOpEventStreamSelectObjectContent) HandleDeseriali
out.Result = output
}
eventReader := newSelectObjectContentEventStream(
eventReader := newSelectObjectContentEventStreamReader(
deserializeOutput.Body,
eventstream.NewDecoder(func(options *eventstream.DecoderOptions) {
options.Logger = logger
@@ -234,10 +234,14 @@ func (*awsRestxml_deserializeOpEventStreamSelectObjectContent) closeResponseBody
}
func addEventStreamSelectObjectContentMiddleware(stack *middleware.Stack, options Options) error {
return stack.Deserialize.Insert(&awsRestxml_deserializeOpEventStreamSelectObjectContent{
if err := stack.Deserialize.Insert(&awsRestxml_deserializeOpEventStreamSelectObjectContent{
LogEventStreamWrites: options.ClientLogMode.IsRequestEventMessage(),
LogEventStreamReads: options.ClientLogMode.IsResponseEventMessage(),
}, "OperationDeserializer", middleware.Before)
}, "OperationDeserializer", middleware.Before); err != nil {
return err
}
return nil
}
// UnknownEventMessageError provides an error when a message is received from the stream,

View File

@@ -4,13 +4,16 @@
"github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream": "v0.0.0-00010101000000-000000000000",
"github.com/aws/aws-sdk-go-v2/internal/configsources": "v0.0.0-00010101000000-000000000000",
"github.com/aws/aws-sdk-go-v2/internal/endpoints/v2": "v2.0.0-00010101000000-000000000000",
"github.com/aws/aws-sdk-go-v2/internal/v4a": "v0.0.0-00010101000000-000000000000",
"github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding": "v1.0.5",
"github.com/aws/aws-sdk-go-v2/service/internal/checksum": "v0.0.0-00010101000000-000000000000",
"github.com/aws/aws-sdk-go-v2/service/internal/presigned-url": "v1.0.7",
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared": "v1.2.3",
"github.com/aws/smithy-go": "v1.4.0"
},
"files": [
"api_client.go",
"api_client_test.go",
"api_op_AbortMultipartUpload.go",
"api_op_CompleteMultipartUpload.go",
"api_op_CopyObject.go",
@@ -55,6 +58,7 @@
"api_op_GetBucketWebsite.go",
"api_op_GetObject.go",
"api_op_GetObjectAcl.go",
"api_op_GetObjectAttributes.go",
"api_op_GetObjectLegalHold.go",
"api_op_GetObjectLockConfiguration.go",
"api_op_GetObjectRetention.go",

View File

@@ -3,4 +3,4 @@
package s3
// goModuleVersion is the tagged release for this module
const goModuleVersion = "1.19.0"
const goModuleVersion = "1.26.11"

View File

@@ -11,11 +11,11 @@ import (
"github.com/aws/aws-sdk-go-v2/aws"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/internal/v4a"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared"
"github.com/aws/aws-sdk-go-v2/service/internal/s3shared/arn"
s3arn "github.com/aws/aws-sdk-go-v2/service/s3/internal/arn"
"github.com/aws/aws-sdk-go-v2/service/s3/internal/endpoints"
"github.com/aws/aws-sdk-go-v2/service/s3/internal/v4a"
)
const (

Some files were not shown because too many files have changed in this diff Show More