public object Execute(ExecutorContext context) { var cmdletContext = context as CmdletContext; // create request var request = new Amazon.IoT.Model.RejectCertificateTransferRequest(); if (cmdletContext.CertificateId != null) { request.CertificateId = cmdletContext.CertificateId; } if (cmdletContext.RejectReason != null) { request.RejectReason = cmdletContext.RejectReason; } 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 RejectCertificateTransfer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RejectCertificateTransfer 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<RejectCertificateTransferResponse> RejectCertificateTransferAsync(RejectCertificateTransferRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new RejectCertificateTransferRequestMarshaller(); var unmarshaller = RejectCertificateTransferResponseUnmarshaller.Instance; return InvokeAsync<RejectCertificateTransferRequest,RejectCertificateTransferResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. Once called, the certificate /// will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate.</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 RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because it has already completed. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> public Task<RejectCertificateTransferResponse> RejectCertificateTransferAsync(string certificateId, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var request = new RejectCertificateTransferRequest(); request.CertificateId = certificateId; return RejectCertificateTransferAsync(request, cancellationToken); }
/// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. Once called, the certificate /// will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the RejectCertificateTransfer service method.</param> /// /// <returns>The response from the RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because it has already completed. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> public RejectCertificateTransferResponse RejectCertificateTransfer(RejectCertificateTransferRequest request) { var marshaller = new RejectCertificateTransferRequestMarshaller(); var unmarshaller = RejectCertificateTransferResponseUnmarshaller.Instance; return Invoke<RejectCertificateTransferRequest,RejectCertificateTransferResponse>(request, marshaller, unmarshaller); }
/// <summary> /// Rejects a pending certificate transfer. After AWS IoT rejects a certificate transfer, /// the certificate status changes from <b>PENDING_TRANFER</b> to <b>INACTIVE</b>. /// /// /// <para> /// To check for pending certificate transfers, call <a>ListCertificates</a> to enumerate /// your certificates. /// </para> /// /// <para> /// This operation can only be called by the transfer destination. Once called, the certificate /// will be returned to the source's account in the INACTIVE state. /// </para> /// </summary> /// <param name="certificateId">The ID of the certificate.</param> /// /// <returns>The response from the RejectCertificateTransfer service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.InternalFailureException"> /// An unexpected error has occurred. /// </exception> /// <exception cref="Amazon.IoT.Model.InvalidRequestException"> /// The request is not valid. /// </exception> /// <exception cref="Amazon.IoT.Model.ResourceNotFoundException"> /// The specified resource does not exist. /// </exception> /// <exception cref="Amazon.IoT.Model.ServiceUnavailableException"> /// The service is temporarily unavailable. /// </exception> /// <exception cref="Amazon.IoT.Model.ThrottlingException"> /// The rate exceeds the limit. /// </exception> /// <exception cref="Amazon.IoT.Model.TransferAlreadyCompletedException"> /// You can't revert the certificate transfer because it has already completed. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> public RejectCertificateTransferResponse RejectCertificateTransfer(string certificateId) { var request = new RejectCertificateTransferRequest(); request.CertificateId = certificateId; return RejectCertificateTransfer(request); }
/// <summary> /// Initiates the asynchronous execution of the RejectCertificateTransfer operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the RejectCertificateTransfer operation on AmazonIoTClient.</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 EndRejectCertificateTransfer /// operation.</returns> public IAsyncResult BeginRejectCertificateTransfer(RejectCertificateTransferRequest request, AsyncCallback callback, object state) { var marshaller = new RejectCertificateTransferRequestMarshaller(); var unmarshaller = RejectCertificateTransferResponseUnmarshaller.Instance; return BeginInvoke<RejectCertificateTransferRequest>(request, marshaller, unmarshaller, callback, state); }
private Amazon.IoT.Model.RejectCertificateTransferResponse CallAWSServiceOperation(IAmazonIoT client, Amazon.IoT.Model.RejectCertificateTransferRequest request) { Utils.Common.WriteVerboseEndpointMessage(this, client.Config, "AWS IoT", "RejectCertificateTransfer"); try { #if DESKTOP return(client.RejectCertificateTransfer(request)); #elif CORECLR return(client.RejectCertificateTransferAsync(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; } }