protected override void ProcessRecord() { AmazonS3 client = base.GetClient(); Amazon.S3.Model.EnableBucketLoggingRequest request = new Amazon.S3.Model.EnableBucketLoggingRequest(); request.BucketName = this._BucketName; Amazon.S3.Model.EnableBucketLoggingResponse response = client.EnableBucketLogging(request); }
public void BucketD_EnableBucketLoggingTest() { bool expectedValue = true; bool actualValue = false; bool hasCallbackArrived = false; S3ResponseEventHandler<object, ResponseEventArgs> handler = null; handler = delegate(object sender, ResponseEventArgs args) { IS3Response result = args.Response; //Unhook from event. _client.OnS3Response -= handler; EnableBucketLoggingResponse response = result as EnableBucketLoggingResponse; if (null != response) actualValue = response.IsRequestSuccessful; hasCallbackArrived = true; }; EnableBucketLoggingRequest loggingRequest = new EnableBucketLoggingRequest() { BucketName = _bucketNameForBucketAPIs }; S3BucketLoggingConfig config = loggingRequest.LoggingConfig; config.TargetBucketName = _bucketNameForBucketAPIs; _client.OnS3Response += handler; _client.EnableBucketLogging(loggingRequest); EnqueueConditional(() => hasCallbackArrived); EnqueueCallback(() => Assert.IsTrue(expectedValue == actualValue, string.Format("Expected Value = {0}, Actual Value = {1}", expectedValue, actualValue))); EnqueueTestComplete(); }
public void BucketC_EnableBucketLoggingTest_ForException_WithoutLoggingConfig() { EnableBucketLoggingRequest loggingRequest = new EnableBucketLoggingRequest() { BucketName = _bucketNameForBucketAPIs }; _client.EnableBucketLogging(loggingRequest); EnqueueTestComplete(); }