public void TransferCertificateMarshallTest() { var operation = service_model.FindOperation("TransferCertificate"); var request = InstantiateClassGenerator.Execute <TransferCertificateRequest>(); var marshaller = new TransferCertificateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); RequestValidator.Validate("TransferCertificate", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { { "x-amzn-RequestId", Guid.NewGuid().ToString() }, { "x-amz-crc32", "0" } } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString()); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = TransferCertificateResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as TransferCertificateResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }
/// <summary> /// Initiates the asynchronous execution of the TransferCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TransferCertificate 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<TransferCertificateResponse> TransferCertificateAsync(TransferCertificateRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken)) { var marshaller = new TransferCertificateRequestMarshaller(); var unmarshaller = TransferCertificateResponseUnmarshaller.Instance; return InvokeAsync<TransferCertificateRequest,TransferCertificateResponse>(request, marshaller, unmarshaller, cancellationToken); }
/// <summary> /// Initiates the asynchronous execution of the TransferCertificate operation. /// </summary> /// /// <param name="request">Container for the necessary parameters to execute the TransferCertificate 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 EndTransferCertificate /// operation.</returns> public IAsyncResult BeginTransferCertificate(TransferCertificateRequest request, AsyncCallback callback, object state) { var marshaller = new TransferCertificateRequestMarshaller(); var unmarshaller = TransferCertificateResponseUnmarshaller.Instance; return BeginInvoke<TransferCertificateRequest>(request, marshaller, unmarshaller, callback, state); }
/// <summary> /// Transfers the specified certificate to the specified AWS account. /// /// /// <para> /// You can cancel the transfer until it is acknowledged by the recipient. /// </para> /// /// <para> /// No notification is sent to the transfer destination's account, it is up to the caller /// to notify the transfer target. /// </para> /// /// <para> /// The certificate being transferred must not be in the ACTIVE state. It can be deactivated /// using the UpdateCertificate API. /// </para> /// /// <para> /// The certificate must not have any policies attached to it. These can be detached using /// the DetachPrincipalPolicy API. /// </para> /// </summary> /// <param name="request">Container for the necessary parameters to execute the TransferCertificate service method.</param> /// /// <returns>The response from the TransferCertificate service method, as returned by IoT.</returns> /// <exception cref="Amazon.IoT.Model.CertificateStateException"> /// The certificate operation is not allowed. /// </exception> /// <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.TransferConflictException"> /// You can't transfer the the certificate because authorization policies are still attached. /// </exception> /// <exception cref="Amazon.IoT.Model.UnauthorizedException"> /// You are not authorized to perform this operation. /// </exception> public TransferCertificateResponse TransferCertificate(TransferCertificateRequest request) { var marshaller = new TransferCertificateRequestMarshaller(); var unmarshaller = TransferCertificateResponseUnmarshaller.Instance; return Invoke<TransferCertificateRequest,TransferCertificateResponse>(request, marshaller, unmarshaller); }
public void TransferCertificateMarshallTest() { var operation = service_model.FindOperation("TransferCertificate"); var request = InstantiateClassGenerator.Execute<TransferCertificateRequest>(); var marshaller = new TransferCertificateRequestMarshaller(); var internalRequest = marshaller.Marshall(request); RequestValidator.Validate("TransferCertificate", request, internalRequest, service_model); var webResponse = new WebResponseData { Headers = { {"x-amzn-RequestId", Guid.NewGuid().ToString()}, {"x-amz-crc32","0"} } }; var payloadResponse = new JsonSampleGenerator(service_model, operation.ResponseStructure).Execute(); webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(payloadResponse).Length.ToString()); var context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(payloadResponse), false, webResponse); ResponseUnmarshaller unmarshaller = TransferCertificateResponseUnmarshaller.Instance; var response = unmarshaller.Unmarshall(context) as TransferCertificateResponse; InstantiateClassGenerator.ValidateObjectFullyInstantiated(response); }