/* * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ using System; using System.Collections.Generic; using System.Xml.Serialization; using System.Text; using Amazon.Runtime; namespace Amazon.S3.Model { /// /// Container for the parameters to the PutBucketEncryption operation. /// This action uses the encryption subresource to configure default encryption /// and 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 in the Amazon S3 User Guide. For more information /// about S3 Bucket Keys, see Amazon /// S3 Bucket Keys in the Amazon S3 User Guide. /// /// /// /// This action requires Amazon Web Services Signature Version 4. For more information, /// see /// Authenticating Requests (Amazon Web Services Signature Version 4). /// /// /// /// To use this operation, you must have permissions to perform the s3:PutEncryptionConfiguration /// action. The bucket owner has this permission by default. The bucket owner can grant /// this permission to others. For more information about permissions, see Permissions /// Related to Bucket Subresource Operations and Managing /// Access Permissions to Your Amazon S3 Resources in the Amazon S3 User Guide. /// /// /// /// The following operations are related to PutBucketEncryption: /// /// /// public class PutBucketEncryptionRequest : AmazonWebServiceRequest { private string bucketName; private ChecksumAlgorithm _checksumAlgorithm; private string contentMD5; private ServerSideEncryptionConfiguration serverSideEncryptionConfiguration; private string expectedBucketOwner; /// /// Gets and sets the property BucketName. /// /// Specifies default encryption for a bucket using server-side encryption with different /// key options. By default, all buckets have a default encryption configuration that /// uses server-side encryption with Amazon S3 managed keys (SSE-S3). You can optionally /// configure default encryption for a bucket by using server-side encryption with an /// Amazon Web Services KMS key (SSE-KMS) or a customer-provided key (SSE-C). For information /// about the bucket default encryption feature, see Amazon /// S3 Bucket Default Encryption in the Amazon S3 User Guide. /// /// public string BucketName { get { return this.bucketName; } set { this.bucketName = value; } } // Check to see if Bucket property is set internal bool IsSetBucketName() { return !(string.IsNullOrEmpty(this.bucketName)); } /// /// Gets and sets the property ChecksumAlgorithm. /// /// Indicates the algorithm used to create the checksum for the object. Amazon S3 will /// fail the request with a 400 error if there is no checksum associated with the object. /// For more information, see /// Checking object integrity in the Amazon S3 User Guide. /// /// public ChecksumAlgorithm ChecksumAlgorithm { get { return this._checksumAlgorithm; } set { this._checksumAlgorithm = value; } } // Check to see if ChecksumAlgorithm property is set internal bool IsSetChecksumAlgorithm() { return this._checksumAlgorithm != null; } /// /// Gets and sets the property ContentMD5. /// /// 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 automatically. /// /// public string ContentMD5 { get { return this.contentMD5; } set { this.contentMD5 = value; } } // Check to see if ContentMD5 property is set internal bool IsSetContentMD5() { return this.contentMD5 != null; } /// /// Container for server-side encryption configuration rules. Currently S3 supports one rule only. /// public ServerSideEncryptionConfiguration ServerSideEncryptionConfiguration { get { return this.serverSideEncryptionConfiguration; } set { this.serverSideEncryptionConfiguration = value; } } // Check to see if ServerSideEncryptionConfiguration property is set internal bool IsSetServerSideEncryptionConfiguration() { return this.serverSideEncryptionConfiguration != null; } /// /// 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. /// public string ExpectedBucketOwner { get { return this.expectedBucketOwner; } set { this.expectedBucketOwner = value; } } /// /// Checks to see if ExpectedBucketOwner is set. /// /// true, if ExpectedBucketOwner property is set. internal bool IsSetExpectedBucketOwner() { return !String.IsNullOrEmpty(this.expectedBucketOwner); } } }