/// <summary>
        /// <para> RunJobFlow creates and starts running a new job flow. The job flow will run the steps specified. Once the job flow completes, the
        /// cluster is stopped and the HDFS partition is lost. To prevent loss of data, configure the last step of the job flow to store results in
        /// Amazon S3. If the JobFlowInstancesConfig <c>KeepJobFlowAliveWhenNoSteps</c> parameter is set to <c>TRUE</c> , the job flow will transition
        /// to the WAITING state rather than shutting down once the steps have completed. </para> <para>For additional protection, you can set the
        /// JobFlowInstancesConfig <c>TerminationProtected</c> parameter to <c>TRUE</c> to lock the job flow and prevent it from being terminated by API
        /// call, user intervention, or in the event of a job flow error.</para> <para>A maximum of 256 steps are allowed in each job flow.</para>
        /// <para>If your job flow is long-running (such as a Hive data warehouse) or complex, you may require more than 256 steps to process your data.
        /// You can bypass the 256-step limitation in various ways, including using the SSH shell to connect to the master node and submitting queries
        /// directly to the software running on the master node, such as Hive and Hadoop. For more information on how to do this, go to <a href="http://docs.aws.amazon.com/ElasticMapReduce/latest/DeveloperGuide/AddMoreThan256Steps.html">Add More than 256 Steps to a Job Flow</a>
        /// in the <i>Amazon Elastic MapReduce Developer's Guide</i> .</para> <para>For long running job flows, we recommend that you periodically store
        /// your results.</para>
        /// </summary>
        ///
        /// <param name="runJobFlowRequest">Container for the necessary parameters to execute the RunJobFlow service method on
        /// AmazonElasticMapReduce.</param>
        ///
        /// <returns>The response from the RunJobFlow service method, as returned by AmazonElasticMapReduce.</returns>
        ///
        /// <exception cref="T:Amazon.ElasticMapReduce.Model.InternalServerErrorException" />
        /// <param name="cancellationToken">
        ///     A cancellation token that can be used by other objects or threads to receive notice of cancellation.
        /// </param>
        public Task <RunJobFlowResponse> RunJobFlowAsync(RunJobFlowRequest runJobFlowRequest, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new RunJobFlowRequestMarshaller();
            var unmarshaller = RunJobFlowResponseUnmarshaller.GetInstance();

            return(Invoke <IRequest, RunJobFlowRequest, RunJobFlowResponse>(runJobFlowRequest, marshaller, unmarshaller, signer, cancellationToken));
        }
        IAsyncResult invokeRunJobFlow(RunJobFlowRequest runJobFlowRequest, AsyncCallback callback, object state, bool synchronized)
        {
            IRequest    irequest     = new RunJobFlowRequestMarshaller().Marshall(runJobFlowRequest);
            var         unmarshaller = RunJobFlowResponseUnmarshaller.GetInstance();
            AsyncResult result       = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);

            Invoke(result);
            return(result);
        }
        /// <summary>
        /// <para> RunJobFlow creates and starts running a new job flow. The job
        /// flow will run the steps specified. Once the job flow completes, the
        /// cluster is stopped and the HDFS partition is lost. To prevent loss of
        /// data, configure the last step of the job flow to store results in
        /// Amazon S3. If the JobFlowInstancesDetail : KeepJobFlowAliveWhenNoSteps
        /// parameter is set to <c>TRUE</c> , the job flow will transition to the
        /// WAITING state rather than shutting down once the steps have completed.
        /// </para> <para>A maximum of 256 steps are allowed in each job
        /// flow.</para> <para>For long running job flows, we recommended that you
        /// periodically store your results.</para>
        /// </summary>
        ///
        /// <param name="runJobFlowRequest">Container for the necessary parameters
        ///           to execute the RunJobFlow service method on
        ///           AmazonElasticMapReduce.</param>
        ///
        /// <returns>The response from the RunJobFlow service method, as returned
        ///         by AmazonElasticMapReduce.</returns>
        ///
        /// <exception cref="InternalServerErrorException"/>
        public RunJobFlowResponse RunJobFlow(RunJobFlowRequest runJobFlowRequest)
        {
            IRequest <RunJobFlowRequest> request  = new RunJobFlowRequestMarshaller().Marshall(runJobFlowRequest);
            RunJobFlowResponse           response = Invoke <RunJobFlowRequest, RunJobFlowResponse> (request, this.signer, RunJobFlowResponseUnmarshaller.GetInstance());

            return(response);
        }