@SdkInternalApi
    final SetAlarmStateResult executeSetAlarmState(SetAlarmStateRequest setAlarmStateRequest) {

        ExecutionContext executionContext = createExecutionContext(setAlarmStateRequest);
        AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
        awsRequestMetrics.startEvent(Field.ClientExecuteTime);
        Request<SetAlarmStateRequest> request = null;
        Response<SetAlarmStateResult> response = null;

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

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

            StaxResponseHandler<SetAlarmStateResult> responseHandler = new StaxResponseHandler<SetAlarmStateResult>(new SetAlarmStateResultStaxUnmarshaller());

            response = invoke(request, responseHandler, executionContext);

            return response.getAwsResponse();

        } finally {

            endClientExecution(awsRequestMetrics, request, response);
        }
    }
<p>
Temporarily sets the state of an alarm for testing purposes. When the updated state differs from the previous
value, the action configured for the appropriate state is invoked. For example, if your alarm is configured to
send an Amazon SNS message when an alarm is triggered, temporarily changing the alarm state to <code>ALARM</code>
sends an SNS message.
</p>
<p>
Metric alarms returns to their actual state quickly, often within seconds. Because the metric alarm state change
happens quickly, it is typically only visible in the alarm's <b>History</b> tab in the Amazon CloudWatch console
or through <a
href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_DescribeAlarmHistory.html"
>DescribeAlarmHistory</a>.
</p>
<p>
If you use <code>SetAlarmState</code> on a composite alarm, the composite alarm is not guaranteed to return to
its actual state. It returns to its actual state only once any of its children alarms change state. It is also
reevaluated if you update its configuration.
</p>
<p>
If an alarm triggers EC2 Auto Scaling policies or application Auto Scaling policies, you must include information
in the <code>StateReasonData</code> parameter to enable the policy to take the correct action.
</p>

@param setAlarmStateRequest
@return Result of the SetAlarmState operation returned by the service.
@throws ResourceNotFoundException
        The named resource does not exist.
@throws InvalidFormatException
        Data was not syntactically valid JSON.
@sample AmazonCloudWatch.SetAlarmState
@see <a href="http://docs.aws.amazon.com/goto/WebAPI/monitoring-2010-08-01/SetAlarmState" target="_top">AWS API
     Documentation</a>
aws-java-sdk-cloudwatch/src/main/java/com/amazonaws/services/cloudwatch/AmazonCloudWatchClient.java