AWSSDK.Tests.Framework.MissingAPILambdaFunctions.EnableBucketVersioning C# (CSharp) Method

EnableBucketVersioning() public static method

public static EnableBucketVersioning ( string bucketName, RegionEndpoint region ) : void
bucketName string
region Amazon.RegionEndpoint
return void
        public static void EnableBucketVersioning(string bucketName, RegionEndpoint region)
        {
            AutoResetEvent ars = new AutoResetEvent(false);
            string functionError = null;
            Exception responseException = new Exception();
            string payload = string.Format(@"{{""BucketName"":""{0}"",""Region"":""{1}""}}", bucketName, region.SystemName);
            LambdaClient.InvokeAsync(new InvokeRequest()
            {
                FunctionName = EnableBucketVersioningFunctionName,
                InvocationType = InvocationType.RequestResponse,
                Payload = payload
            }, (response) =>
            {
                responseException = response.Exception;
                if (responseException == null)
                {
                    functionError = response.Response.FunctionError;
                }
                ars.Set();
            }, new AsyncOptions { ExecuteCallbackOnMainThread = false });
            ars.WaitOne();
            if (responseException != null)
            {
                throw responseException;
            }
            Utils.AssertStringIsNullOrEmpty(functionError);
        }