@SdkInternalApi
    final CreateInstanceEventWindowResult executeCreateInstanceEventWindow(CreateInstanceEventWindowRequest createInstanceEventWindowRequest) {

        ExecutionContext executionContext = createExecutionContext(createInstanceEventWindowRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<CreateInstanceEventWindowRequest> request = null;
        Response<CreateInstanceEventWindowResult> response = null;

        try {
            awsRequestMetrics.startEvent(Field.RequestMarshallTime);
            try {
                request = new CreateInstanceEventWindowRequestMarshaller().marshall(super.beforeMarshalling(createInstanceEventWindowRequest));
                // 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, "CreateInstanceEventWindow");
                request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);

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

            StaxResponseHandler<CreateInstanceEventWindowResult> responseHandler = new StaxResponseHandler<CreateInstanceEventWindowResult>(
                    new CreateInstanceEventWindowResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Creates an event window in which scheduled events for the associated Amazon EC2 instances can run.
</p>
<p>
You can define either a set of time ranges or a cron expression when creating the event window, but not both. All
event window times are in UTC.
</p>
<p>
You can create up to 200 event windows per Amazon Web Services Region.
</p>
<p>
When you create the event window, targets (instance IDs, Dedicated Host IDs, or tags) are not yet associated with
it. To ensure that the event window can be used, you must associate one or more targets with it by using the
<a>AssociateInstanceEventWindow</a> API.
</p>
<important>
<p>
Event windows are applicable only for scheduled events that stop, reboot, or terminate instances.
</p>
<p>
Event windows are <i>not</i> applicable for:
</p>
<ul>
<li>
<p>
Expedited scheduled events and network maintenance events.
</p>
</li>
<li>
<p>
Unscheduled maintenance such as AutoRecovery and unplanned reboots.
</p>
</li>
</ul>
</important>
<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 createInstanceEventWindowRequest
@return Result of the CreateInstanceEventWindow operation returned by the service.
@sample AmazonEC2.CreateInstanceEventWindow
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/ec2-2016-11-15/CreateInstanceEventWindow" target="_top">AWS
     API Documentation</a>
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/AmazonEC2Client.java