public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.DeleteClusterSubnetGroupRequest(); if (cmdletContext.ClusterSubnetGroupName != null) { request.ClusterSubnetGroupName = cmdletContext.ClusterSubnetGroupName; } 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); }
IAsyncResult invokeDeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest deleteClusterSubnetGroupRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteClusterSubnetGroupRequestMarshaller().Marshall(deleteClusterSubnetGroupRequest); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteClusterSubnetGroup operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.DeleteClusterSubnetGroup"/> /// </summary> /// /// <param name="deleteClusterSubnetGroupRequest">Container for the necessary parameters to execute the DeleteClusterSubnetGroup operation on /// AmazonRedshift.</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 BeginDeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest deleteClusterSubnetGroupRequest, AsyncCallback callback, object state) { return invokeDeleteClusterSubnetGroup(deleteClusterSubnetGroupRequest, callback, state, false); }
/// <summary> /// <para> Deletes the specified cluster subnet group. </para> /// </summary> /// /// <param name="deleteClusterSubnetGroupRequest">Container for the necessary parameters to execute the DeleteClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <exception cref="InvalidClusterSubnetStateException"/> /// <exception cref="ClusterSubnetGroupNotFoundException"/> /// <exception cref="InvalidClusterSubnetGroupStateException"/> public DeleteClusterSubnetGroupResponse DeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest deleteClusterSubnetGroupRequest) { IAsyncResult asyncResult = invokeDeleteClusterSubnetGroup(deleteClusterSubnetGroupRequest, null, null, true); return EndDeleteClusterSubnetGroup(asyncResult); }
private Amazon.Redshift.Model.DeleteClusterSubnetGroupResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.DeleteClusterSubnetGroupRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "DeleteClusterSubnetGroup"); try { #if DESKTOP return(client.DeleteClusterSubnetGroup(request)); #elif CORECLR return(client.DeleteClusterSubnetGroupAsync(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> /// Initiates the asynchronous execution of the DeleteClusterSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteClusterSubnetGroup operation on AmazonRedshiftClient.</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 EndDeleteClusterSubnetGroup /// operation.</returns> public IAsyncResult BeginDeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteClusterSubnetGroupRequestMarshaller(); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.Instance; return BeginInvoke<DeleteClusterSubnetGroupRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// <para> Deletes the specified cluster subnet group. </para> /// </summary> /// /// <param name="deleteClusterSubnetGroupRequest">Container for the necessary parameters to execute the DeleteClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSubnetStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSubnetGroupStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteClusterSubnetGroupResponse> DeleteClusterSubnetGroupAsync(DeleteClusterSubnetGroupRequest deleteClusterSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteClusterSubnetGroupRequestMarshaller(); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteClusterSubnetGroupRequest, DeleteClusterSubnetGroupResponse>(deleteClusterSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken); }
/// <summary> /// Deletes the specified cluster subnet group. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteClusterSubnetGroup service method.</param> /// /// <returns>The response from the DeleteClusterSubnetGroup service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.ClusterSubnetGroupNotFoundException"> /// The cluster subnet group name does not refer to an existing cluster subnet group. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidClusterSubnetGroupStateException"> /// The cluster subnet group cannot be deleted because it is in use. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidClusterSubnetStateException"> /// The state of the subnet is invalid. /// </exception> public DeleteClusterSubnetGroupResponse DeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest request) { var marshaller = new DeleteClusterSubnetGroupRequestMarshaller(); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.Instance; return Invoke<DeleteClusterSubnetGroupRequest,DeleteClusterSubnetGroupResponse>(request, marshaller, unmarshaller); }
internal DeleteClusterSubnetGroupResponse DeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest request) { var task = DeleteClusterSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para> Deletes the specified cluster subnet group. </para> /// </summary> /// /// <param name="deleteClusterSubnetGroupRequest">Container for the necessary parameters to execute the DeleteClusterSubnetGroup service method /// on AmazonRedshift.</param> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSubnetStateException" /> /// <exception cref="T:Amazon.Redshift.Model.ClusterSubnetGroupNotFoundException" /> /// <exception cref="T:Amazon.Redshift.Model.InvalidClusterSubnetGroupStateException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteClusterSubnetGroupResponse> DeleteClusterSubnetGroupAsync(DeleteClusterSubnetGroupRequest deleteClusterSubnetGroupRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteClusterSubnetGroupRequestMarshaller(); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteClusterSubnetGroupRequest, DeleteClusterSubnetGroupResponse>(deleteClusterSubnetGroupRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DeleteClusterSubnetGroupResponse DeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest request) { var task = DeleteClusterSubnetGroupAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteClusterSubnetGroup operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteClusterSubnetGroup 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<DeleteClusterSubnetGroupResponse> DeleteClusterSubnetGroupAsync(DeleteClusterSubnetGroupRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteClusterSubnetGroupRequestMarshaller(); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.Instance; return InvokeAsync<DeleteClusterSubnetGroupRequest,DeleteClusterSubnetGroupResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeDeleteClusterSubnetGroup(DeleteClusterSubnetGroupRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteClusterSubnetGroupRequestMarshaller(); var unmarshaller = DeleteClusterSubnetGroupResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }