/// <summary>
        /// Initiates the asynchronous execution of the TestPayload operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the TestPayload operation on AmazonRestJsonTestClient.</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 EndTestPayload
        ///         operation.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/test-2021-05-13/TestPayload">REST API Reference for TestPayload Operation</seealso>
        public virtual IAsyncResult BeginTestPayload(TestPayloadRequest request, AsyncCallback callback, object state)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TestPayloadRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TestPayloadResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
        /// <summary>
        /// Post a test payload request.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the TestPayload service method.</param>
        ///
        /// <returns>The response from the TestPayload service method, as returned by RestJsonTest.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/test-2021-05-13/TestPayload">REST API Reference for TestPayload Operation</seealso>
        public virtual TestPayloadResponse TestPayload(TestPayloadRequest request)
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TestPayloadRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TestPayloadResponseUnmarshaller.Instance;

            return(Invoke <TestPayloadResponse>(request, options));
        }
Esempio n. 3
0
        /// <summary>
        /// Post a test payload request.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the TestPayload service method.</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 TestPayload service method, as returned by RestJsonTest.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/test-2021-05-13/TestPayload">REST API Reference for TestPayload Operation</seealso>
        public virtual Task <TestPayloadResponse> TestPayloadAsync(TestPayloadRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TestPayloadRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TestPayloadResponseUnmarshaller.Instance;

            return(InvokeAsync <TestPayloadResponse>(request, options, cancellationToken));
        }
Esempio n. 4
0
        public void TestPayloadTest()
        {
            var request = new TestPayloadRequest();

            request.PayloadConfig      = new PayloadConfig();
            request.PayloadConfig.Data = 25;
            request.TestId             = "t-12345";
            var marshaller      = new TestPayloadRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);

            Assert.IsTrue(internalRequest.Headers.ContainsKey("Content-Type"));
            Assert.IsTrue(internalRequest.Headers["Content-Type"] == "application/json");
        }
Esempio n. 5
0
        public void TestPayloadNoParamsTest()
        {
            var request = new TestPayloadRequest();

            request.PayloadConfig = new PayloadConfig();
            var marshaller      = new TestPayloadRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);
            var body            = System.Text.Encoding.Default.GetString(internalRequest.Content);

            Assert.AreEqual(body, "{}");
            Assert.IsTrue(internalRequest.Headers.ContainsKey("Content-Type"));
            Assert.IsTrue(internalRequest.Headers["Content-Type"] == "application/json");
        }