public void InitializeClusterMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <InitializeClusterRequest>();
            var marshaller = new InitializeClusterRequestMarshaller();

            var internalRequest = marshaller.Marshall(request);
            var jsonRequest     = UTF8Encoding.UTF8.GetString(internalRequest.Content);

            Comparer.CompareObjectToJson <InitializeClusterRequest>(request, jsonRequest);

            var webResponse = new WebResponseData
            {
                Headers =
                {
                    { "x-amzn-RequestId", Guid.NewGuid().ToString() },
                    { "x-amz-crc32",      "0"                       }
                }
            };
            var jsonResponse = new JsonSampleGenerator(service_model, service_model.FindOperation("InitializeCluster").ResponseStructure).Execute();

            webResponse.Headers.Add("Content-Length", UTF8Encoding.UTF8.GetBytes(jsonResponse).Length.ToString());
            UnmarshallerContext context = new JsonUnmarshallerContext(Utils.CreateStreamFromString(jsonResponse), false, webResponse);
            var response = InitializeClusterResponseUnmarshaller.Instance.Unmarshall(context)
                           as InitializeClusterResponse;

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Claims an AWS CloudHSM cluster by submitting the cluster certificate issued by your
        /// issuing certificate authority (CA) and the CA's root certificate. Before you can claim
        /// a cluster, you must sign the cluster's certificate signing request (CSR) with your
        /// issuing CA. To get the cluster's CSR, use <a>DescribeClusters</a>.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the InitializeCluster service method.</param>
        ///
        /// <returns>The response from the InitializeCluster service method, as returned by CloudHSMV2.</returns>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmAccessDeniedException">
        /// The request was rejected because the requester does not have permission to perform
        /// the requested operation.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmInternalFailureException">
        /// The request was rejected because of an AWS CloudHSM internal failure. The request
        /// can be retried.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmInvalidRequestException">
        /// The request was rejected because it is not a valid request.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmResourceNotFoundException">
        /// The request was rejected because it refers to a resource that cannot be found.
        /// </exception>
        /// <exception cref="Amazon.CloudHSMV2.Model.CloudHsmServiceException">
        /// The request was rejected because an error occurred.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeCluster">REST API Reference for InitializeCluster Operation</seealso>
        public virtual InitializeClusterResponse InitializeCluster(InitializeClusterRequest request)
        {
            var marshaller   = new InitializeClusterRequestMarshaller();
            var unmarshaller = InitializeClusterResponseUnmarshaller.Instance;

            return(Invoke <InitializeClusterRequest, InitializeClusterResponse>(request, marshaller, unmarshaller));
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Initiates the asynchronous execution of the InitializeCluster operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the InitializeCluster 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>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/cloudhsmv2-2017-04-28/InitializeCluster">REST API Reference for InitializeCluster Operation</seealso>
        public virtual Task <InitializeClusterResponse> InitializeClusterAsync(InitializeClusterRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new InitializeClusterRequestMarshaller();
            var unmarshaller = InitializeClusterResponseUnmarshaller.Instance;

            return(InvokeAsync <InitializeClusterRequest, InitializeClusterResponse>(request, marshaller,
                                                                                     unmarshaller, cancellationToken));
        }