public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.WAF.Model.DeleteWebACLRequest(); if (cmdletContext.ChangeToken != null) { request.ChangeToken = cmdletContext.ChangeToken; } if (cmdletContext.WebACLId != null) { request.WebACLId = cmdletContext.WebACLId; } CmdletOutput output; // issue call var client = Client ?? CreateClient(_CurrentCredentials, _RegionEndpoint); try { var response = CallAWSServiceOperation(client, request); object pipelineOutput = null; pipelineOutput = cmdletContext.Select(response, this); output = new CmdletOutput { PipelineOutput = pipelineOutput, ServiceResponse = response }; } catch (Exception e) { output = new CmdletOutput { ErrorResponse = e }; } return(output); }
/// <summary> /// Initiates the asynchronous execution of the DeleteWebACL operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteWebACL operation on AmazonWAFClient.</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 EndDeleteWebACL /// operation.</returns> public IAsyncResult BeginDeleteWebACL(DeleteWebACLRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteWebACLRequestMarshaller(); var unmarshaller = DeleteWebACLResponseUnmarshaller.Instance; return BeginInvoke<DeleteWebACLRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Permanently deletes a <a>WebACL</a>. You can't delete a <code>WebACL</code> if it /// still contains any <code>Rules</code>. /// /// /// <para> /// To delete a <code>WebACL</code>, perform the following steps: /// </para> /// <ol> <li>Update the <code>WebACL</code> to remove <code>Rules</code>, if any. For /// more information, see <a>UpdateWebACL</a>.</li> <li>Use <a>GetChangeToken</a> to get /// the change token that you provide in the <code>ChangeToken</code> parameter of a <code>DeleteWebACL</code> /// request.</li> <li>Submit a <code>DeleteWebACL</code> request.</li> </ol> /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteWebACL service method.</param> /// /// <returns>The response from the DeleteWebACL service method, as returned by WAF.</returns> /// <exception cref="Amazon.WAF.Model.WAFInternalErrorException"> /// The operation failed because of a system problem, even though the request was valid. /// Retry your request. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException"> /// The operation failed because you tried to create, update, or delete an object by using /// an invalid account identifier. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException"> /// The operation failed because you tried to delete an object that isn't empty. For example: /// /// <ul> <li>You tried to delete a <code>WebACL</code> that still contains one or more /// <code>Rule</code> objects.</li> <li>You tried to delete a <code>Rule</code> that still /// contains one or more <code>ByteMatchSet</code> objects or other predicates.</li> <li>You /// tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code> /// objects.</li> <li>You tried to delete an <code>IPSet</code> that references one or /// more IP addresses.</li> </ul> /// </exception> /// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException"> /// The operation failed because the referenced object doesn't exist. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFReferencedItemException"> /// The operation failed because you tried to delete an object that is still in use. For /// example: <ul> <li>You tried to delete a <code>ByteMatchSet</code> that is still referenced /// by a <code>Rule</code>.</li> <li>You tried to delete a <code>Rule</code> that is still /// referenced by a <code>WebACL</code>.</li> </ul> /// </exception> /// <exception cref="Amazon.WAF.Model.WAFStaleDataException"> /// The operation failed because you tried to create, update, or delete an object by using /// a change token that has already been used. /// </exception> public DeleteWebACLResponse DeleteWebACL(DeleteWebACLRequest request) { var marshaller = new DeleteWebACLRequestMarshaller(); var unmarshaller = DeleteWebACLResponseUnmarshaller.Instance; return Invoke<DeleteWebACLRequest,DeleteWebACLResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Permanently deletes a <a>WebACL</a>. You can't delete a <code>WebACL</code> if it /// still contains any <code>Rules</code>. /// /// /// <para> /// To delete a <code>WebACL</code>, perform the following steps: /// </para> /// <ol> <li>Update the <code>WebACL</code> to remove <code>Rules</code>, if any. For /// more information, see <a>UpdateWebACL</a>.</li> <li>Use <a>GetChangeToken</a> to get /// the change token that you provide in the <code>ChangeToken</code> parameter of a <code>DeleteWebACL</code> /// request.</li> <li>Submit a <code>DeleteWebACL</code> request.</li> </ol> /// </summary> /// <param name="webACLId">The <code>WebACLId</code> of the <a>WebACL</a> that you want to delete. <code>WebACLId</code> is returned by <a>CreateWebACL</a> and by <a>ListWebACLs</a>.</param> /// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param> /// /// <returns>The response from the DeleteWebACL service method, as returned by WAF.</returns> /// <exception cref="Amazon.WAF.Model.WAFInternalErrorException"> /// The operation failed because of a system problem, even though the request was valid. /// Retry your request. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException"> /// The operation failed because you tried to create, update, or delete an object by using /// an invalid account identifier. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException"> /// The operation failed because you tried to delete an object that isn't empty. For example: /// /// <ul> <li>You tried to delete a <code>WebACL</code> that still contains one or more /// <code>Rule</code> objects.</li> <li>You tried to delete a <code>Rule</code> that still /// contains one or more <code>ByteMatchSet</code> objects or other predicates.</li> <li>You /// tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code> /// objects.</li> <li>You tried to delete an <code>IPSet</code> that references one or /// more IP addresses.</li> </ul> /// </exception> /// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException"> /// The operation failed because the referenced object doesn't exist. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFReferencedItemException"> /// The operation failed because you tried to delete an object that is still in use. For /// example: <ul> <li>You tried to delete a <code>ByteMatchSet</code> that is still referenced /// by a <code>Rule</code>.</li> <li>You tried to delete a <code>Rule</code> that is still /// referenced by a <code>WebACL</code>.</li> </ul> /// </exception> /// <exception cref="Amazon.WAF.Model.WAFStaleDataException"> /// The operation failed because you tried to create, update, or delete an object by using /// a change token that has already been used. /// </exception> public DeleteWebACLResponse DeleteWebACL(string webACLId, string changeToken) { var request = new DeleteWebACLRequest(); request.WebACLId = webACLId; request.ChangeToken = changeToken; return DeleteWebACL(request); }
/// <summary> /// Initiates the asynchronous execution of the DeleteWebACL operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteWebACL 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 Task<DeleteWebACLResponse> DeleteWebACLAsync(DeleteWebACLRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteWebACLRequestMarshaller(); var unmarshaller = DeleteWebACLResponseUnmarshaller.Instance; return InvokeAsync<DeleteWebACLRequest,DeleteWebACLResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Permanently deletes a <a>WebACL</a>. You can't delete a <code>WebACL</code> if it /// still contains any <code>Rules</code>. /// /// /// <para> /// To delete a <code>WebACL</code>, perform the following steps: /// </para> /// <ol> <li>Update the <code>WebACL</code> to remove <code>Rules</code>, if any. For /// more information, see <a>UpdateWebACL</a>.</li> <li>Use <a>GetChangeToken</a> to get /// the change token that you provide in the <code>ChangeToken</code> parameter of a <code>DeleteWebACL</code> /// request.</li> <li>Submit a <code>DeleteWebACL</code> request.</li> </ol> /// </summary> /// <param name="webACLId">The <code>WebACLId</code> of the <a>WebACL</a> that you want to delete. <code>WebACLId</code> is returned by <a>CreateWebACL</a> and by <a>ListWebACLs</a>.</param> /// <param name="changeToken">The value returned by the most recent call to <a>GetChangeToken</a>.</param> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> /// /// <returns>The response from the DeleteWebACL service method, as returned by WAF.</returns> /// <exception cref="Amazon.WAF.Model.WAFInternalErrorException"> /// The operation failed because of a system problem, even though the request was valid. /// Retry your request. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFInvalidAccountException"> /// The operation failed because you tried to create, update, or delete an object by using /// an invalid account identifier. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFNonEmptyEntityException"> /// The operation failed because you tried to delete an object that isn't empty. For example: /// /// <ul> <li>You tried to delete a <code>WebACL</code> that still contains one or more /// <code>Rule</code> objects.</li> <li>You tried to delete a <code>Rule</code> that still /// contains one or more <code>ByteMatchSet</code> objects or other predicates.</li> <li>You /// tried to delete a <code>ByteMatchSet</code> that contains one or more <code>ByteMatchTuple</code> /// objects.</li> <li>You tried to delete an <code>IPSet</code> that references one or /// more IP addresses.</li> </ul> /// </exception> /// <exception cref="Amazon.WAF.Model.WAFNonexistentItemException"> /// The operation failed because the referenced object doesn't exist. /// </exception> /// <exception cref="Amazon.WAF.Model.WAFReferencedItemException"> /// The operation failed because you tried to delete an object that is still in use. For /// example: <ul> <li>You tried to delete a <code>ByteMatchSet</code> that is still referenced /// by a <code>Rule</code>.</li> <li>You tried to delete a <code>Rule</code> that is still /// referenced by a <code>WebACL</code>.</li> </ul> /// </exception> /// <exception cref="Amazon.WAF.Model.WAFStaleDataException"> /// The operation failed because you tried to create, update, or delete an object by using /// a change token that has already been used. /// </exception> public Task<DeleteWebACLResponse> DeleteWebACLAsync(string webACLId, string changeToken, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new DeleteWebACLRequest(); request.WebACLId = webACLId; request.ChangeToken = changeToken; return DeleteWebACLAsync(request, cancellationToken); }
private Amazon.WAF.Model.DeleteWebACLResponse CallAWSServiceOperation(IAmazonWAF client, Amazon.WAF.Model.DeleteWebACLRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS WAF", "DeleteWebACL"); try { #if DESKTOP return(client.DeleteWebACL(request)); #elif CORECLR return(client.DeleteWebACLAsync(request).GetAwaiter().GetResult()); #else #error "Unknown build edition" #endif } catch (AmazonServiceException exc) { var webException = exc.InnerException as System.Net.WebException; if (webException != null) { throw new Exception(Utils.Common.FormatNameResolutionFailureMessage(client.Config, webException.Message), webException); } throw; } }