/*
* 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 PutBucketMetricsConfiguration operation.
/// Sets a metrics configuration (specified by the metrics configuration ID) for the bucket.
/// You can have up to 1,000 metrics configurations per bucket. If you're updating an
/// existing metrics configuration, note that this is a full replacement of the existing
/// metrics configuration. If you don't include the elements you want to keep, they are
/// erased.
///
///
///
/// To use this operation, you must have permissions to perform the s3:PutMetricsConfiguration
/// 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.
///
///
///
/// For information about CloudWatch request metrics for Amazon S3, see Monitoring
/// Metrics with Amazon CloudWatch.
///
///
///
/// The following operations are related to PutBucketMetricsConfiguration
:
///
///
///
/// GetBucketLifecycle
has the following special error:
///
/// -
///
/// Error code:
TooManyConfigurations
///
/// -
///
/// Description: You are attempting to create a new configuration but have already reached
/// the 1,000-configuration limit.
///
///
-
///
/// HTTP Status Code: HTTP 400 Bad Request
///
///
///
public partial class PutBucketMetricsConfigurationRequest : AmazonWebServiceRequest
{
private string bucketName;
private string metricsId;
private MetricsConfiguration metricsConfiguration;
private string expectedBucketOwner;
///
/// The name of the bucket for which the metrics configuration is set.
///
public string BucketName
{
get { return this.bucketName; }
set { this.bucketName = value; }
}
// Check to see if Bucket property is set
internal bool IsSetBucketName()
{
return this.bucketName != null;
}
///
///
/// The ID used to identify the metrics configuration.
/// The ID has a 64 character limit and can only contain letters, numbers, periods, dashes, and underscores.
///
///
public string MetricsId
{
get { return this.metricsId; }
set { this.metricsId = value; }
}
// Check to see if MetricsId property is set
internal bool IsSetMetricsId()
{
return this.metricsId != null;
}
///
/// Specifies the metrics configuration.
///
public MetricsConfiguration MetricsConfiguration
{
get { return this.metricsConfiguration; }
set { this.metricsConfiguration = value; }
}
// Check to see if MetricsConfiguration property is set
internal bool IsSetMetricsConfiguration()
{
return this.metricsConfiguration != 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);
}
}
}