@SdkInternalApi
    final ModifyInstanceEventWindowResult executeModifyInstanceEventWindow(ModifyInstanceEventWindowRequest modifyInstanceEventWindowRequest) {

        ExecutionContext executionContext = createExecutionContext(modifyInstanceEventWindowRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<ModifyInstanceEventWindowRequest> request = null;
        Response<ModifyInstanceEventWindowResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new ModifyInstanceEventWindowRequestMarshaller().marshall(super.beforeMarshalling(modifyInstanceEventWindowRequest));
                // 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, "EC2");
                request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ModifyInstanceEventWindow");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            StaxResponseHandler<ModifyInstanceEventWindowResult> responseHandler = new StaxResponseHandler<ModifyInstanceEventWindowResult>(
                    new ModifyInstanceEventWindowResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Modifies the specified event window.
</p>
<p>
You can define either a set of time ranges or a cron expression when modifying the event window, but not both.
</p>
<p>
To modify the targets associated with the event window, use the <a>AssociateInstanceEventWindow</a> and
<a>DisassociateInstanceEventWindow</a> API.
</p>
<p>
If Amazon Web Services has already scheduled an event, modifying an event window won't change the time of the
scheduled event.
</p>
<p>
For more information, see <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/event-windows.html">Define
event windows for scheduled events</a> in the <i>Amazon EC2 User Guide</i>.
</p>

@param modifyInstanceEventWindowRequest
@return Result of the ModifyInstanceEventWindow operation returned by the service.
@sample AmazonEC2.ModifyInstanceEventWindow
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/ModifyInstanceEventWindow" target="_top">AWS
     API Documentation</a>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java