public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.Redshift.Model.DeleteHsmClientCertificateRequest(); if (cmdletContext.HsmClientCertificateIdentifier != null) { request.HsmClientCertificateIdentifier = cmdletContext.HsmClientCertificateIdentifier; } 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 invokeDeleteHsmClientCertificate(DeleteHsmClientCertificateRequest deleteHsmClientCertificateRequest, AsyncCallback callback, object state, bool synchronized) { IRequest irequest = new DeleteHsmClientCertificateRequestMarshaller().Marshall(deleteHsmClientCertificateRequest); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.GetInstance(); AsyncResult result = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller); Invoke(result); return result; }
/// <summary> /// Initiates the asynchronous execution of the DeleteHsmClientCertificate operation. /// <seealso cref="Amazon.Redshift.IAmazonRedshift.DeleteHsmClientCertificate"/> /// </summary> /// /// <param name="deleteHsmClientCertificateRequest">Container for the necessary parameters to execute the DeleteHsmClientCertificate 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 BeginDeleteHsmClientCertificate(DeleteHsmClientCertificateRequest deleteHsmClientCertificateRequest, AsyncCallback callback, object state) { return invokeDeleteHsmClientCertificate(deleteHsmClientCertificateRequest, callback, state, false); }
/// <summary> /// <para>Deletes the specified HSM client certificate.</para> /// </summary> /// /// <param name="deleteHsmClientCertificateRequest">Container for the necessary parameters to execute the DeleteHsmClientCertificate service /// method on AmazonRedshift.</param> /// /// <exception cref="InvalidHsmClientCertificateStateException"/> /// <exception cref="HsmClientCertificateNotFoundException"/> public DeleteHsmClientCertificateResponse DeleteHsmClientCertificate(DeleteHsmClientCertificateRequest deleteHsmClientCertificateRequest) { IAsyncResult asyncResult = invokeDeleteHsmClientCertificate(deleteHsmClientCertificateRequest, null, null, true); return EndDeleteHsmClientCertificate(asyncResult); }
/// <summary> /// Initiates the asynchronous execution of the DeleteHsmClientCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteHsmClientCertificate 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 EndDeleteHsmClientCertificate /// operation.</returns> public IAsyncResult BeginDeleteHsmClientCertificate(DeleteHsmClientCertificateRequest request, AsyncCallback callback, object state) { var marshaller = new DeleteHsmClientCertificateRequestMarshaller(); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.Instance; return BeginInvoke<DeleteHsmClientCertificateRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Deletes the specified HSM client certificate. /// </summary> /// <param name="request">Container for the necessary parameters to execute the DeleteHsmClientCertificate service method.</param> /// /// <returns>The response from the DeleteHsmClientCertificate service method, as returned by Redshift.</returns> /// <exception cref="Amazon.Redshift.Model.HsmClientCertificateNotFoundException"> /// There is no Amazon Redshift HSM client certificate with the specified identifier. /// </exception> /// <exception cref="Amazon.Redshift.Model.InvalidHsmClientCertificateStateException"> /// The specified HSM client certificate is not in the <code>available</code> state, or /// it is still in use by one or more Amazon Redshift clusters. /// </exception> public DeleteHsmClientCertificateResponse DeleteHsmClientCertificate(DeleteHsmClientCertificateRequest request) { var marshaller = new DeleteHsmClientCertificateRequestMarshaller(); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.Instance; return Invoke<DeleteHsmClientCertificateRequest,DeleteHsmClientCertificateResponse>(request, marshaller, unmarshaller); }
/// <summary> /// <para>Deletes the specified HSM client certificate.</para> /// </summary> /// /// <param name="deleteHsmClientCertificateRequest">Container for the necessary parameters to execute the DeleteHsmClientCertificate service /// method on AmazonRedshift.</param> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidHsmClientCertificateStateException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmClientCertificateNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public Task<DeleteHsmClientCertificateResponse> DeleteHsmClientCertificateAsync(DeleteHsmClientCertificateRequest deleteHsmClientCertificateRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteHsmClientCertificateRequestMarshaller(); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.GetInstance(); return Invoke<IRequest, DeleteHsmClientCertificateRequest, DeleteHsmClientCertificateResponse>(deleteHsmClientCertificateRequest, marshaller, unmarshaller, signer, cancellationToken); }
internal DeleteHsmClientCertificateResponse DeleteHsmClientCertificate(DeleteHsmClientCertificateRequest request) { var task = DeleteHsmClientCertificateAsync(request); try { return task.Result; } catch(AggregateException e) { ExceptionDispatchInfo.Capture(e.InnerException).Throw(); return null; } }
/// <summary> /// <para>Deletes the specified HSM client certificate.</para> /// </summary> /// /// <param name="deleteHsmClientCertificateRequest">Container for the necessary parameters to execute the DeleteHsmClientCertificate service /// method on AmazonRedshift.</param> /// /// <exception cref="T:Amazon.Redshift.Model.InvalidHsmClientCertificateStateException" /> /// <exception cref="T:Amazon.Redshift.Model.HsmClientCertificateNotFoundException" /> /// <param name="cancellationToken"> /// A cancellation token that can be used by other objects or threads to receive notice of cancellation. /// </param> public async Task<DeleteHsmClientCertificateResponse> DeleteHsmClientCertificateAsync(DeleteHsmClientCertificateRequest deleteHsmClientCertificateRequest, CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteHsmClientCertificateRequestMarshaller(); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.GetInstance(); var response = await Invoke<IRequest, DeleteHsmClientCertificateRequest, DeleteHsmClientCertificateResponse>(deleteHsmClientCertificateRequest, marshaller, unmarshaller, signer, cancellationToken) .ConfigureAwait(continueOnCapturedContext: false); return response; }
internal DeleteHsmClientCertificateResponse DeleteHsmClientCertificate(DeleteHsmClientCertificateRequest request) { var task = DeleteHsmClientCertificateAsync(request); try { return task.Result; } catch(AggregateException e) { throw e.InnerException; } }
/// <summary> /// Initiates the asynchronous execution of the DeleteHsmClientCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the DeleteHsmClientCertificate 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<DeleteHsmClientCertificateResponse> DeleteHsmClientCertificateAsync(DeleteHsmClientCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new DeleteHsmClientCertificateRequestMarshaller(); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.Instance; return InvokeAsync<DeleteHsmClientCertificateRequest,DeleteHsmClientCertificateResponse>(request, marshaller, unmarshaller, cancellationToken); }
IAsyncResult invokeDeleteHsmClientCertificate(DeleteHsmClientCertificateRequest request, AsyncCallback callback, object state, bool synchronized) { var marshaller = new DeleteHsmClientCertificateRequestMarshaller(); var unmarshaller = DeleteHsmClientCertificateResponseUnmarshaller.Instance; return Invoke(request, callback, state, synchronized, marshaller, unmarshaller, signer); }
private Amazon.Redshift.Model.DeleteHsmClientCertificateResponse CallAWSServiceOperation(IAmazonRedshift client, Amazon.Redshift.Model.DeleteHsmClientCertificateRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "Amazon Redshift", "DeleteHsmClientCertificate"); try { #if DESKTOP return(client.DeleteHsmClientCertificate(request)); #elif CORECLR return(client.DeleteHsmClientCertificateAsync(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; } }