Exemple #1
0
        /// <summary>
        /// Stops a query execution.
        ///
        ///
        /// <para>
        /// For code samples using the AWS SDK for Java, see <a href="http://docs.aws.amazon.com/athena/latest/ug/code-samples.html">Examples
        /// and Code Samples</a> in the <i>Amazon Athena User Guide</i>.
        /// </para>
        /// </summary>
        /// <param name="request">Container for the necessary parameters to execute the StopQueryExecution service method.</param>
        ///
        /// <returns>The response from the StopQueryExecution service method, as returned by Athena.</returns>
        /// <exception cref="Amazon.Athena.Model.InternalServerException">
        /// Indicates a platform issue, which may be due to a transient condition or outage.
        /// </exception>
        /// <exception cref="Amazon.Athena.Model.InvalidRequestException">
        /// Indicates that something is wrong with the input to the request. For example, a required
        /// parameter may be missing or out of range.
        /// </exception>
        /// <seealso href="http://docs.aws.amazon.com/goto/WebAPI/athena-2017-05-18/StopQueryExecution">REST API Reference for StopQueryExecution Operation</seealso>
        public StopQueryExecutionResponse StopQueryExecution(StopQueryExecutionRequest request)
        {
            var marshaller   = new StopQueryExecutionRequestMarshaller();
            var unmarshaller = StopQueryExecutionResponseUnmarshaller.Instance;

            return(Invoke <StopQueryExecutionRequest, StopQueryExecutionResponse>(request, marshaller, unmarshaller));
        }
Exemple #2
0
        public void StopQueryExecutionMarshallTest()
        {
            var request    = InstantiateClassGenerator.Execute <StopQueryExecutionRequest>();
            var marshaller = new StopQueryExecutionRequestMarshaller();

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

            Comparer.CompareObjectToJson <StopQueryExecutionRequest>(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("StopQueryExecution").ResponseStructure).Execute();

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

            InstantiateClassGenerator.ValidateObjectFullyInstantiated(response);
        }
Exemple #3
0
        /// <summary>
        /// Initiates the asynchronous execution of the StopQueryExecution operation.
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the StopQueryExecution 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/athena-2017-05-18/StopQueryExecution">REST API Reference for StopQueryExecution Operation</seealso>
        public Task <StopQueryExecutionResponse> StopQueryExecutionAsync(StopQueryExecutionRequest request, System.Threading.CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new StopQueryExecutionRequestMarshaller();
            var unmarshaller = StopQueryExecutionResponseUnmarshaller.Instance;

            return(InvokeAsync <StopQueryExecutionRequest, StopQueryExecutionResponse>(request, marshaller,
                                                                                       unmarshaller, cancellationToken));
        }