/*
* 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 System.IO;
using Amazon.Runtime;
using Amazon.Runtime.Internal;
namespace Amazon.S3.Model
{
///
/// Container for the parameters to the PutBucketLogging operation.
/// Set the logging parameters for a bucket and to specify permissions for who can view
/// and modify the logging parameters. All logs are saved to buckets in the same Amazon
/// Web Services Region as the source bucket. To set the logging status 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.
///
///
///
/// 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 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:
///
///
///
///
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID><>ID<></ID><DisplayName><>GranteesEmail<></DisplayName>
/// </Grantee>
///
///
///
/// DisplayName is optional and ignored in the request.
///
/// -
///
/// By Email address:
///
///
///
///
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="AmazonCustomerByEmail"><EmailAddress><>Grantees@email.com<></EmailAddress></Grantee>
///
///
///
///
/// The grantee is resolved to the CanonicalUser and, in a response to a GET Object acl
/// request, appears as the CanonicalUser.
///
/// -
///
/// By URI:
///
///
///
///
<Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI><>http://acs.amazonaws.com/groups/global/AuthenticatedUsers<></URI></Grantee>
///
///
///
///
/// To enable logging, you use LoggingEnabled and its children request elements. To disable
/// logging, you use an empty BucketLoggingStatus request element:
///
///
///
/// <BucketLoggingStatus xmlns="http://doc.s3.amazonaws.com/2006-03-01" />
///
///
///
///
/// For more information about server access logging, see Server
/// Access Logging in the Amazon S3 User Guide.
///
///
///
/// For more information about creating a bucket, see CreateBucket.
/// For more information about returning the logging status of a bucket, see GetBucketLogging.
///
///
///
/// The following operations are related to PutBucketLogging
:
///
///
///
public partial class PutBucketLoggingRequest : AmazonWebServiceRequest
{
///
/// Gets and sets the BucketName property.
///
public string BucketName { get; set; }
private ChecksumAlgorithm _checksumAlgorithm;
private string expectedBucketOwner;
// Check to see if Bucket property is set
internal bool IsSetBucketName()
{
return this.BucketName != null;
}
///
/// 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 LoggingConfig property.
///
public S3BucketLoggingConfig LoggingConfig { get; set; }
// Check to see if BucketLoggingStatus property is set
internal bool IsSetLoggingConfig()
{
return this.LoggingConfig != 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);
}
}
}