@SdkInternalApi
    final UpdateDatasetGroupResult executeUpdateDatasetGroup(UpdateDatasetGroupRequest updateDatasetGroupRequest) {

        ExecutionContext executionContext = createExecutionContext(updateDatasetGroupRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<UpdateDatasetGroupRequest> request = null;
        Response<UpdateDatasetGroupResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new UpdateDatasetGroupRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDatasetGroupRequest));
                // Binds the request metrics to the current request.
                request.setAWSRequestMetrics(awsRequestMetrics);
                request.addHandlerContext(HandlerContextKey.CLIENT_ENDPOINT, endpoint);
                request.addHandlerContext(HandlerContextKey.ENDPOINT_OVERRIDDEN, isEndpointOverridden());
                request.addHandlerContext(HandlerContextKey.SIGNING_REGION, getSigningRegion());
                request.addHandlerContext(HandlerContextKey.SERVICE_ID, "forecast");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDatasetGroup");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

            } finally {
                awsRequestMetrics.endEvent(Field.RequestMarshallTime);
            }

            HttpResponseHandler<AmazonWebServiceResponse<UpdateDatasetGroupResult>> responseHandler = protocolFactory.createResponseHandler(
                    new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDatasetGroupResultJsonUnmarshaller());
            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Replaces the datasets in a dataset group with the specified datasets.
</p>
<note>
<p>
The <code>Status</code> of the dataset group must be <code>ACTIVE</code> before you can use the dataset group to
create a predictor. Use the <a
href="https://docs.aws.amazon.com/forecast/latest/dg/API_DescribeDatasetGroup.html">DescribeDatasetGroup</a>
operation to get the status.
</p>
</note>

@param updateDatasetGroupRequest
@return Result of the UpdateDatasetGroup operation returned by the service.
@throws InvalidInputException
        We can't process the request because it includes an invalid value or a value that exceeds the valid
        range.
@throws ResourceNotFoundException
        We can't find a resource with that Amazon Resource Name (ARN). Check the ARN and try again.
@throws ResourceInUseException
        The specified resource is in use.
@sample AmazonForecast.UpdateDatasetGroup
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/forecast-2018-06-26/UpdateDatasetGroup" target="_top">AWS
     API Documentation</a>
aws-java-sdk-forecast/src/main/java/com/amazonaws/services/forecast/AmazonForecastClient.java