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

            options.RequestMarshaller    = TestBodyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TestBodyResponseUnmarshaller.Instance;

            return(BeginInvoke(request, options, callback, state));
        }
示例#2
0
        /// <summary>
        /// Post a test body request.
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the TestBody 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 TestBody service method, as returned by RestJsonTest.</returns>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/test-2021-05-13/TestBody">REST API Reference for TestBody Operation</seealso>
        public virtual Task <TestBodyResponse> TestBodyAsync(TestBodyRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var options = new InvokeOptions();

            options.RequestMarshaller    = TestBodyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TestBodyResponseUnmarshaller.Instance;

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

            options.RequestMarshaller    = TestBodyRequestMarshaller.Instance;
            options.ResponseUnmarshaller = TestBodyResponseUnmarshaller.Instance;

            return(Invoke <TestBodyResponse>(request, options));
        }
示例#4
0
        public void TestBodyTest()
        {
            var request = new TestBodyRequest();

            request.TestConfig         = new TestConfig();
            request.TestConfig.Timeout = 10;
            request.TestId             = "t-12345";
            var marshaller      = new TestBodyRequestMarshaller();
            var internalRequest = marshaller.Marshall(request);

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