Exemple #1
0
        internal virtual DeletePublicAccessBlockResponse DeletePublicAccessBlock(DeletePublicAccessBlockRequest request)
        {
            var marshaller   = DeletePublicAccessBlockRequestMarshaller.Instance;
            var unmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance;

            return(Invoke <DeletePublicAccessBlockRequest, DeletePublicAccessBlockResponse>(request, marshaller, unmarshaller));
        }
        public void TestDeletePublicAccessBlock()
        {
            try
            {
                //Add public access block configuration
                PublicAccessBlockConfiguration configuration;
                Call_PutPublicAccessBlock(Client, bucketName, out configuration);

                //Verify the configuration exists
                Call_GetPublicAccessBlock(Client, bucketName, configuration);

                //Delete the configuration
                var deleteRequest = new DeletePublicAccessBlockRequest
                {
                    BucketName = bucketName
                };
                var deleteResponse = Client.DeletePublicAccessBlock(deleteRequest);
                Assert.AreEqual(true, deleteResponse.HttpStatusCode == HttpStatusCode.NoContent);

                //Verify the configuration was deleted. This call will throw a public access block configuration was not found message.
                Call_GetPublicAccessBlock(Client, bucketName, null);
            }
            catch (AmazonS3Exception ex)
            {
                Assert.AreEqual <string>("The public access block configuration was not found", ex.Message);
                throw;
            }
        }
Exemple #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeletePublicAccessBlock operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeletePublicAccessBlock operation on AmazonS3ControlClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeletePublicAccessBlock
        ///         operation.</returns>
        public virtual IAsyncResult BeginDeletePublicAccessBlock(DeletePublicAccessBlockRequest request, AsyncCallback callback, object state)
        {
            var marshaller   = DeletePublicAccessBlockRequestMarshaller.Instance;
            var unmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance;

            return(BeginInvoke <DeletePublicAccessBlockRequest>(request, marshaller, unmarshaller,
                                                                callback, state));
        }
        /// <summary>
        /// Initiates the asynchronous execution of the DeletePublicAccessBlock operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeletePublicAccessBlock operation on AmazonS3ControlClient.</param>
        /// <param name="callback">An AsyncCallback delegate that is invoked when the operation completes.</param>
        /// <param name="state">A user-defined state object that is passed to the callback procedure. Retrieve this object from within the callback
        ///          procedure using the AsyncState property.</param>
        ///
        /// <returns>An IAsyncResult that can be used to poll or wait for results, or both; this value is also needed when invoking EndDeletePublicAccessBlock
        ///         operation.</returns>
        public virtual IAsyncResult BeginDeletePublicAccessBlock(DeletePublicAccessBlockRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeletePublicAccessBlockRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
        /// <summary>
        /// Removes the Public Access Block configuration for an Amazon Web Services account.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the DeletePublicAccessBlock service method.</param>
        ///
        /// <returns>The response from the DeletePublicAccessBlock service method, as returned by S3Control.</returns>
        public virtual DeletePublicAccessBlockResponse DeletePublicAccessBlock(DeletePublicAccessBlockRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = DeletePublicAccessBlockRequestMarshaller.Instance;
            options.ResponseUnmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance;

            return(Invoke <DeletePublicAccessBlockResponse>(request, options));
        }
 public Task <DeletePublicAccessBlockResponse> DeletePublicAccessBlockAsync(DeletePublicAccessBlockRequest request, CancellationToken cancellationToken = default)
 {
     throw new NotImplementedException();
 }
Exemple #7
0
        /// <summary>
        /// Initiates the asynchronous execution of the DeletePublicAccessBlock operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the DeletePublicAccessBlock operation.</param>
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        /// <returns>The task object representing the asynchronous operation.</returns>
        public virtual Task <DeletePublicAccessBlockResponse> DeletePublicAccessBlockAsync(DeletePublicAccessBlockRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = DeletePublicAccessBlockRequestMarshaller.Instance;
            var unmarshaller = DeletePublicAccessBlockResponseUnmarshaller.Instance;

            return(InvokeAsync <DeletePublicAccessBlockRequest, DeletePublicAccessBlockResponse>(request, marshaller,
                                                                                                 unmarshaller, cancellationToken));
        }