public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.ElastiCache.Model.DeleteCacheSecurityGroupRequest(); if (cmdletContext.CacheSecurityGroupName != null) { request.CacheSecurityGroupName = cmdletContext.CacheSecurityGroupName; } 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 DeleteCacheSecurityGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheSecurityGroup 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<DeleteCacheSecurityGroupResponse> DeleteCacheSecurityGroupAsync(DeleteCacheSecurityGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCacheSecurityGroupRequestMarshaller(); var unmarshaller = DeleteCacheSecurityGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteCacheSecurityGroupRequest,DeleteCacheSecurityGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// The <i>DeleteCacheSecurityGroup</i> operation deletes a cache security group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteCacheSecurityGroup service method.</param> /// /// <returns>The response from the DeleteCacheSecurityGroup service method, as returned by ElastiCache.</returns> /// <exception cref="Amazon.ElastiCache.Model.CacheSecurityGroupNotFoundException"> /// The requested cache security group name does not refer to an existing cache security /// group. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidCacheSecurityGroupStateException"> /// The current state of the cache security group does not allow deletion. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidParameterCombinationException"> /// Two or more incompatible parameters were specified. /// </exception> /// <exception cref="Amazon.ElastiCache.Model.InvalidParameterValueException"> /// The value for a parameter is invalid. /// </exception> public DeleteCacheSecurityGroupResponse DeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest request) { var marshaller = new DeleteCacheSecurityGroupRequestMarshaller(); var unmarshaller = DeleteCacheSecurityGroupResponseUnmarshaller.Instance; return Invoke<DeleteCacheSecurityGroupRequest,DeleteCacheSecurityGroupResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheSecurityGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheSecurityGroup operation on AmazonElastiCacheClient.</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 EndDeleteCacheSecurityGroup /// operation.</returns> public IAsyncResult BeginDeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteCacheSecurityGroupRequestMarshaller(); var unmarshaller = DeleteCacheSecurityGroupResponseUnmarshaller.Instance; return BeginInvoke<DeleteCacheSecurityGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheSecurityGroup operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.DeleteCacheSecurityGroup"/> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheSecurityGroup 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<DeleteCacheSecurityGroupResponse> DeleteCacheSecurityGroupAsync(DeleteCacheSecurityGroupRequest request, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCacheSecurityGroupRequestMarshaller(); var unmarshaller = DeleteCacheSecurityGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteCacheSecurityGroupRequest, DeleteCacheSecurityGroupResponse>(request, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// <para>The <i>DeleteCacheSecurityGroup</i> operation deletes a cache security group.</para> <para><b>NOTE:</b>You cannot delete a cache /// security group if it is associated with any cache clusters.</para> /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteCacheSecurityGroup service method /// on AmazonElastiCache.</param> /// /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterValueException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheSecurityGroupStateException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterCombinationException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheSecurityGroupNotFoundException" /> public DeleteCacheSecurityGroupResponse DeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest request) { var task = DeleteCacheSecurityGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
IAsyncResult invokeDeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest deleteCacheSecurityGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteCacheSecurityGroupRequestMarshaller().Marshall(deleteCacheSecurityGroupRequest); var unmarshaller = DeleteCacheSecurityGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteCacheSecurityGroup operation. /// <seealso cref="Amazon.ElastiCache.IAmazonElastiCache.DeleteCacheSecurityGroup"/> /// </summary> /// /// <param name="deleteCacheSecurityGroupRequest">Container for the necessary parameters to execute the DeleteCacheSecurityGroup operation on /// AmazonElastiCache.</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> public IAsyncResult BeginDeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest deleteCacheSecurityGroupRequest, AsyncCallback callback, object state) { return invokeDeleteCacheSecurityGroup(deleteCacheSecurityGroupRequest, callback, state, false); }
/// <summary> /// <para>The <i>DeleteCacheSecurityGroup</i> operation deletes a cache security group.</para> <para><b>NOTE:</b>You cannot delete a cache /// security group if it is associated with any cache clusters.</para> /// </summary> /// /// <param name="deleteCacheSecurityGroupRequest">Container for the necessary parameters to execute the DeleteCacheSecurityGroup service method /// on AmazonElastiCache.</param> /// /// <exception cref="InvalidParameterValueException"/> /// <exception cref="InvalidCacheSecurityGroupStateException"/> /// <exception cref="InvalidParameterCombinationException"/> /// <exception cref="CacheSecurityGroupNotFoundException"/> public DeleteCacheSecurityGroupResponse DeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest deleteCacheSecurityGroupRequest) { IAsyncResult asyncResult = invokeDeleteCacheSecurityGroup(deleteCacheSecurityGroupRequest, null, null, true); return EndDeleteCacheSecurityGroup(asyncResult); }
/// <summary> /// <para>The <i>DeleteCacheSecurityGroup</i> operation deletes a cache security group.</para> <para><b>NOTE:</b>You cannot delete a cache /// security group if it is associated with any cache clusters.</para> /// </summary> /// /// <param name="deleteCacheSecurityGroupRequest">Container for the necessary parameters to execute the DeleteCacheSecurityGroup service method /// on AmazonElastiCache.</param> /// /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterValueException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidCacheSecurityGroupStateException" /> /// <exception cref="T:Amazon.ElastiCache.Model.InvalidParameterCombinationException" /> /// <exception cref="T:Amazon.ElastiCache.Model.CacheSecurityGroupNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteCacheSecurityGroupResponse> DeleteCacheSecurityGroupAsync(DeleteCacheSecurityGroupRequest deleteCacheSecurityGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteCacheSecurityGroupRequestMarshaller(); var unmarshaller = DeleteCacheSecurityGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteCacheSecurityGroupRequest, DeleteCacheSecurityGroupResponse>(deleteCacheSecurityGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DeleteCacheSecurityGroupResponse DeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest request) { var task = DeleteCacheSecurityGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
private Amazon.ElastiCache.Model.DeleteCacheSecurityGroupResponse CallAWSServiceOperation(IAmazonElastiCache client, Amazon.ElastiCache.Model.DeleteCacheSecurityGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon ElastiCache", "DeleteCacheSecurityGroup"); try { #if DESKTOP return(client.DeleteCacheSecurityGroup(request)); #elif CORECLR return(client.DeleteCacheSecurityGroupAsync(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; } }
/// <summary> /// <para> Deletes a Cache Security Group. </para> <para><b>NOTE:</b>The specified Cache Security Group must not be associated with any Cache /// Clusters.</para> /// </summary> /// /// <param name="deleteCacheSecurityGroupRequest">Container for the necessary parameters to execute the DeleteCacheSecurityGroup service method /// on AmazonElastiCache.</param> /// /// <exception cref="InvalidParameterValueException"/> /// <exception cref="InvalidCacheSecurityGroupStateException"/> /// <exception cref="InvalidParameterCombinationException"/> /// <exception cref="CacheSecurityGroupNotFoundException"/> public DeleteCacheSecurityGroupResponse DeleteCacheSecurityGroup(DeleteCacheSecurityGroupRequest deleteCacheSecurityGroupRequest) { IRequest<DeleteCacheSecurityGroupRequest> request = new DeleteCacheSecurityGroupRequestMarshaller().Marshall(deleteCacheSecurityGroupRequest); DeleteCacheSecurityGroupResponse response = Invoke<DeleteCacheSecurityGroupRequest, DeleteCacheSecurityGroupResponse> (request, this.signer, DeleteCacheSecurityGroupResponseUnmarshaller.GetInstance()); return response; }