public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context)
        {
            DeleteBucketPolicyResponse response = new DeleteBucketPolicyResponse();


            return(response);
        }
        public override AmazonWebServiceResponse Unmarshall(XmlUnmarshallerContext context) 
        {
            DeleteBucketPolicyResponse response = new DeleteBucketPolicyResponse();
            

            return response;
        }
Example #3
0
        public void DeleteBucket(string bucketName, string bucketKey = null)
        {
            #region Delete Bucket Policy
            DeleteBucketPolicyResponse delBucketResp = new DeleteBucketPolicyResponse();
            Console.WriteLine("Bucket policy del -1");
            delBucketResp = s3Client.DeleteBucketPolicy(bucketName);
            Console.WriteLine("Bucket policy del -2");
            Console.WriteLine("s3Client");
            #endregion
            if (bucketKey != null)
            {
                GetObjectRequest getObjectRequest = new GetObjectRequest();
                getObjectRequest.BucketName = bucketName;
                getObjectRequest.Key        = bucketKey;

                // GetObjectResponse getObjectResponse = s3Client.GetObject(getObjectRequest);

                DeleteObjectResponse deleteObjectResponse = s3Client.DeleteObject(bucketName, bucketKey);
            }
            #region Delete Bucket Request
            DeleteBucketRequest req = new DeleteBucketRequest();
            Console.WriteLine("Req");
            req.BucketName = bucketName;
            Console.WriteLine(bucketName);
            req.UseClientRegion = true;
            #endregion


            #region Delete Bucket Responce
            DeleteBucketResponse resp = s3Client.DeleteBucket(req);
            Console.WriteLine("Bucket deleted");
            #endregion
        }
Example #4
0
        void DeleteBucketPolicyWebResponse(object sender, ResponseEventArgs args)
        {
            AmazonS3Exception response = args.Response as AmazonS3Exception;

            S3Common.client.OnS3Response -= DeleteBucketPolicyWebResponse;
            if (null != response)
            {
                S3ErrorResponse(response);
                return;
            }
            DeleteBucketPolicyResponse policyResponse = args.Response as DeleteBucketPolicyResponse;

            if (null != policyResponse)
            {
                if (!string.IsNullOrEmpty(policyResponse.AmazonId2) &&
                    (!string.IsNullOrEmpty(policyResponse.RequestId)))
                {
                    this.Dispatcher.BeginInvoke(() =>
                    {
                        GetBucketResult = string.Format(CultureInfo.InvariantCulture, "Bucket Policy Deleted Successfully for Bucket: {0}", SelectedBucketName);
                    });
                }
            }
            else
            {
                GetBucketResult = string.Format(CultureInfo.InvariantCulture, "Unsuccessful Deletion of Policy for Bucket: {0}", SelectedBucketName);
            }
        }
Example #5
0
        static void DeleteBucketPolicy()
        {
            try
            {
                DeleteBucketPolicyRequest request = new DeleteBucketPolicyRequest()
                {
                    BucketName = bucketName,
                };
                DeleteBucketPolicyResponse response = client.DeleteBucketPolicy(request);

                Console.WriteLine("Delete bucket policy response: {0}", response.StatusCode);
            }
            catch (ObsException ex)
            {
                Console.WriteLine("Exception errorcode: {0}, when delete bucket policy.", ex.ErrorCode);
                Console.WriteLine("Exception errormessage: {0}", ex.ErrorMessage);
            }
        }