/// <summary>
        /// Initiates the asynchronous execution of the ModifyInstanceGroups operation.
        /// <seealso cref="Amazon.ElasticMapReduce.IAmazonElasticMapReduce"/>
        /// </summary>
        ///
        /// <param name="request">Container for the necessary parameters to execute the ModifyInstanceGroups 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>
        public Task <ModifyInstanceGroupsResponse> ModifyInstanceGroupsAsync(ModifyInstanceGroupsRequest request, CancellationToken cancellationToken = default(CancellationToken))
        {
            var marshaller   = new ModifyInstanceGroupsRequestMarshaller();
            var unmarshaller = ModifyInstanceGroupsResponseUnmarshaller.Instance;

            return(Invoke <IRequest, ModifyInstanceGroupsRequest, ModifyInstanceGroupsResponse>(request, marshaller, unmarshaller, signer, cancellationToken));
        }
        internal ModifyInstanceGroupsResponse ModifyInstanceGroups(ModifyInstanceGroupsRequest request)
        {
            var marshaller   = new ModifyInstanceGroupsRequestMarshaller();
            var unmarshaller = ModifyInstanceGroupsResponseUnmarshaller.Instance;

            return(Invoke <ModifyInstanceGroupsRequest, ModifyInstanceGroupsResponse>(request, marshaller, unmarshaller));
        }
        /// <summary>
        /// <para>ModifyInstanceGroups modifies the number of nodes and
        /// configuration settings of an instance group. The input parameters
        /// include the new target instance count for the group and the instance
        /// group ID. The call will either succeed or fail atomically.</para>
        /// </summary>
        ///
        /// <param name="modifyInstanceGroupsRequest">Container for the necessary
        ///           parameters to execute the ModifyInstanceGroups service method on
        ///           AmazonElasticMapReduce.</param>
        ///
        /// <exception cref="InternalServerErrorException"/>
        public ModifyInstanceGroupsResponse ModifyInstanceGroups(ModifyInstanceGroupsRequest modifyInstanceGroupsRequest)
        {
            IRequest <ModifyInstanceGroupsRequest> request  = new ModifyInstanceGroupsRequestMarshaller().Marshall(modifyInstanceGroupsRequest);
            ModifyInstanceGroupsResponse           response = Invoke <ModifyInstanceGroupsRequest, ModifyInstanceGroupsResponse> (request, this.signer, ModifyInstanceGroupsResponseUnmarshaller.GetInstance());

            return(response);
        }
        IAsyncResult invokeModifyInstanceGroups(ModifyInstanceGroupsRequest modifyInstanceGroupsRequest, AsyncCallback callback, object state, bool synchronized)
        {
            IRequest    irequest     = new ModifyInstanceGroupsRequestMarshaller().Marshall(modifyInstanceGroupsRequest);
            var         unmarshaller = ModifyInstanceGroupsResponseUnmarshaller.GetInstance();
            AsyncResult result       = new AsyncResult(irequest, callback, state, synchronized, signer, unmarshaller);

            Invoke(result);
            return(result);
        }
        internal ModifyInstanceGroupsResponse ModifyInstanceGroups(ModifyInstanceGroupsRequest request)
        {
            var task = ModifyInstanceGroupsAsync(request);

            try
            {
                return(task.Result);
            }
            catch (AggregateException e)
            {
                ExceptionDispatchInfo.Capture(e.InnerException).Throw();
                return(null);
            }
        }
 /// <summary>
 /// Initiates the asynchronous execution of the ModifyInstanceGroups operation.
 /// <seealso cref="Amazon.ElasticMapReduce.AmazonElasticMapReduce.ModifyInstanceGroups"/>
 /// </summary>
 ///
 /// <param name="modifyInstanceGroupsRequest">Container for the necessary parameters to execute the ModifyInstanceGroups operation on
 ///          AmazonElasticMapReduce.</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>
 public IAsyncResult BeginModifyInstanceGroups(ModifyInstanceGroupsRequest modifyInstanceGroupsRequest, AsyncCallback callback, object state)
 {
     return(invokeModifyInstanceGroups(modifyInstanceGroupsRequest, callback, state, false));
 }
        /// <summary>
        /// <para>ModifyInstanceGroups modifies the number of nodes and configuration settings of an instance group. The input parameters include the
        /// new target instance count for the group and the instance group ID. The call will either succeed or fail atomically.</para>
        /// </summary>
        ///
        /// <param name="modifyInstanceGroupsRequest">Container for the necessary parameters to execute the ModifyInstanceGroups service method on
        ///          AmazonElasticMapReduce.</param>
        ///
        /// <exception cref="InternalServerErrorException"/>
        public ModifyInstanceGroupsResponse ModifyInstanceGroups(ModifyInstanceGroupsRequest modifyInstanceGroupsRequest)
        {
            IAsyncResult asyncResult = invokeModifyInstanceGroups(modifyInstanceGroupsRequest, null, null, true);

            return(EndModifyInstanceGroups(asyncResult));
        }