AWS SDK for .NET Documentation
GetLifecycleConfigurationResponse Class
AmazonAmazon.S3.ModelGetLifecycleConfigurationResponse Did this page help you?   Yes   No    Tell us about it...
The DeleteObjectsResponse contains a list of successful and failed deletes, as well as any headers returned by S3.
Declaration Syntax
public class GetLifecycleConfigurationResponse : S3Response
All MembersConstructorsMethodsProperties

Initializes a new instance of the GetLifecycleConfigurationResponse class

Gets and sets the AmazonId2 property. This property corresponds to the x-amz-id-2 header in the HTTP response from the Amazon S3 service. The value of this header is used for internal troubleshooting purposes.
(Inherited from S3Response.)
Gets and Sets the property that governs whether the response includes successful deletes as well as errors following the DeleteObjects call against S3. By default this property is false and successful deletes are returned in the response.

Disposes of all managed and unmanaged resources.
(Inherited from S3Response.)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Serves as a hash function for a particular type.
(Inherited from Object.)
Gets the type of the current instance.
(Inherited from Object.)
Gets and sets the Headers property. Information like the request-id, the amz-id-2 are retrieved fro the Headers and presented to the user via properties of the response object.
(Inherited from S3Response.)
Gets and sets the Metadata property.
(Inherited from S3Response.)
Gets and sets the RequestId property.
(Inherited from S3Response.)
Gets and sets the ResponseStream property. This property only has a valid value for GetObjectResponses. In order to use this stream without leaking the underlying resource, please wrap access to the stream within a using block.
(Inherited from S3Response.)
Gets and sets the ResponseXml property. This is the original xml response received from S3
(Inherited from S3Response.)
Gets the HTTP Status code from the service response.
(Inherited from S3Response.)
String Representation of this object. Overrides Object.ToString()
(Inherited from S3Response.)

This example shows how to Get, Put and Delete bucket Lifecycle Configurations.
A Lifecycle Configuration allows an owner to configure when specific objects should be deleted. Objects to be deleted are specified with a prefix.
The configuration being used has rules that delete objects with a specific prefix and objects in a specific subdirectory.

CopyLifecycleConfiguration samples
// Create a client
AmazonS3Client client = new AmazonS3Client();

// Put sample lifecycle configuration (overwrite an existing configuration)
LifecycleConfiguration newConfiguration = new LifecycleConfiguration
    Rules = new List<LifecycleRule>
        // Rule to delete keys with prefix "Test-" after 5 days
        new LifecycleRule
            Prefix = "Test-",
            Expiration = new LifecycleRuleExpiration { Days = 5 }
        // Rule to delete keys in subdirectory "Logs" after 2 days
        new LifecycleRule
            Prefix = "Logs/",
            Expiration = new LifecycleRuleExpiration  { Days = 2 },
            Id = "log-file-removal"
PutLifecycleConfigurationRequest putRequest = new PutLifecycleConfigurationRequest
    BucketName = "SampleBucket",
    Configuration = newConfiguration

// Retrieve current configuration
GetLifecycleConfigurationRequest getRequest = new GetLifecycleConfigurationRequest
    BucketName = "SampleBucket"
LifecycleConfiguration configuration = client.GetLifecycleConfiguration(getRequest).Configuration;

Console.WriteLine("Configuration contains {0} rules", configuration.Rules.Count);
foreach (LifecycleRule rule in configuration.Rules)
    Console.WriteLine(" Prefix = " + rule.Prefix);
    Console.WriteLine(" Expiration (days) = " + rule.Expiration.Days);
    Console.WriteLine(" Id = " + rule.Id);
    Console.WriteLine(" Status = " + rule.Status);

// Put a new configuration and overwrite the existing configuration
configuration.Rules.RemoveAt(0);    // remove first rule

// Delete current configuration
DeleteLifecycleConfigurationRequest deleteRequest = new DeleteLifecycleConfigurationRequest
    BucketName = "SampleBucket"

// Retrieve current configuration and verify that it is null
configuration = client.GetLifecycleConfiguration(getRequest).Configuration;
Debug.Assert(configuration == null);
Inheritance Hierarchy

Assembly: AWSSDK (Module: AWSSDK) Version: (