com.amazonaws.services.iotevents.AWSIoTEventsClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-iotevents Show documentation
/*
* Copyright 2019-2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance with
* the License. A copy of the License is located at
*
* http://aws.amazon.com/apache2.0
*
* or in the "license" file accompanying this file. This file is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
* CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions
* and limitations under the License.
*/
package com.amazonaws.services.iotevents;
import org.w3c.dom.*;
import java.net.*;
import java.util.*;
import javax.annotation.Generated;
import org.apache.commons.logging.*;
import com.amazonaws.*;
import com.amazonaws.annotation.SdkInternalApi;
import com.amazonaws.auth.*;
import com.amazonaws.handlers.*;
import com.amazonaws.http.*;
import com.amazonaws.internal.*;
import com.amazonaws.internal.auth.*;
import com.amazonaws.metrics.*;
import com.amazonaws.regions.*;
import com.amazonaws.transform.*;
import com.amazonaws.util.*;
import com.amazonaws.protocol.json.*;
import com.amazonaws.util.AWSRequestMetrics.Field;
import com.amazonaws.annotation.ThreadSafe;
import com.amazonaws.client.AwsSyncClientParams;
import com.amazonaws.client.builder.AdvancedConfig;
import com.amazonaws.services.iotevents.AWSIoTEventsClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.iotevents.model.*;
import com.amazonaws.services.iotevents.model.transform.*;
/**
* Client for accessing AWS IoT Events. All service calls made using this client are blocking, and will not return until
* the service call completes.
*
*
* AWS IoT Events monitors your equipment or device fleets for failures or changes in operation, and triggers actions
* when such events occur. You can use AWS IoT Events API operations to create, read, update, and delete inputs and
* detector models, and to list their versions.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AWSIoTEventsClient extends AmazonWebServiceClient implements AWSIoTEvents {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AWSIoTEvents.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "iotevents";
/** Client configuration factory providing ClientConfigurations tailored to this client */
protected static final ClientConfigurationFactory configFactory = new ClientConfigurationFactory();
private final AdvancedConfig advancedConfig;
private static final com.amazonaws.protocol.json.SdkJsonProtocolFactory protocolFactory = new com.amazonaws.protocol.json.SdkJsonProtocolFactory(
new JsonClientMetadata()
.withProtocolVersion("1.1")
.withSupportsCbor(false)
.withSupportsIon(false)
.withContentTypeOverride("application/json")
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalFailureException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.InternalFailureExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceInUseException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.ResourceInUseExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InvalidRequestException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.InvalidRequestExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.ThrottlingExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("LimitExceededException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.LimitExceededExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("UnsupportedOperationException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.UnsupportedOperationExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceUnavailableException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.ServiceUnavailableExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceAlreadyExistsException").withExceptionUnmarshaller(
com.amazonaws.services.iotevents.model.transform.ResourceAlreadyExistsExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.iotevents.model.AWSIoTEventsException.class));
public static AWSIoTEventsClientBuilder builder() {
return AWSIoTEventsClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on AWS IoT Events using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSIoTEventsClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on AWS IoT Events using the specified parameters.
*
*
* All service calls made using this new client object are blocking, and will not return until the service call
* completes.
*
* @param clientParams
* Object providing client parameters.
*/
AWSIoTEventsClient(AwsSyncClientParams clientParams, boolean endpointDiscoveryEnabled) {
super(clientParams);
this.awsCredentialsProvider = clientParams.getCredentialsProvider();
this.advancedConfig = clientParams.getAdvancedConfig();
init();
}
private void init() {
setServiceNameIntern(DEFAULT_SIGNING_NAME);
setEndpointPrefix(ENDPOINT_PREFIX);
// calling this.setEndPoint(...) will also modify the signer accordingly
setEndpoint("iotevents.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/iotevents/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/iotevents/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Creates an alarm model to monitor an AWS IoT Events input attribute. You can use the alarm to get notified when
* the value is outside a specified range. For more information, see Create an alarm model
* in the AWS IoT Events Developer Guide.
*
*
* @param createAlarmModelRequest
* @return Result of the CreateAlarmModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceInUseException
* The resource is in use.
* @throws ResourceAlreadyExistsException
* The resource already exists.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.CreateAlarmModel
* @see AWS API
* Documentation
*/
@Override
public CreateAlarmModelResult createAlarmModel(CreateAlarmModelRequest request) {
request = beforeClientExecution(request);
return executeCreateAlarmModel(request);
}
@SdkInternalApi
final CreateAlarmModelResult executeCreateAlarmModel(CreateAlarmModelRequest createAlarmModelRequest) {
ExecutionContext executionContext = createExecutionContext(createAlarmModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateAlarmModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createAlarmModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateAlarmModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateAlarmModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a detector model.
*
*
* @param createDetectorModelRequest
* @return Result of the CreateDetectorModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceInUseException
* The resource is in use.
* @throws ResourceAlreadyExistsException
* The resource already exists.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.CreateDetectorModel
* @see AWS
* API Documentation
*/
@Override
public CreateDetectorModelResult createDetectorModel(CreateDetectorModelRequest request) {
request = beforeClientExecution(request);
return executeCreateDetectorModel(request);
}
@SdkInternalApi
final CreateDetectorModelResult executeCreateDetectorModel(CreateDetectorModelRequest createDetectorModelRequest) {
ExecutionContext executionContext = createExecutionContext(createDetectorModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDetectorModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDetectorModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDetectorModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDetectorModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an input.
*
*
* @param createInputRequest
* @return Result of the CreateInput operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @throws ResourceAlreadyExistsException
* The resource already exists.
* @sample AWSIoTEvents.CreateInput
* @see AWS API
* Documentation
*/
@Override
public CreateInputResult createInput(CreateInputRequest request) {
request = beforeClientExecution(request);
return executeCreateInput(request);
}
@SdkInternalApi
final CreateInputResult executeCreateInput(CreateInputRequest createInputRequest) {
ExecutionContext executionContext = createExecutionContext(createInputRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateInputRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createInputRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateInput");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateInputResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an alarm model. Any alarm instances that were created based on this alarm model are also deleted. This
* action can't be undone.
*
*
* @param deleteAlarmModelRequest
* @return Result of the DeleteAlarmModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceInUseException
* The resource is in use.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.DeleteAlarmModel
* @see AWS API
* Documentation
*/
@Override
public DeleteAlarmModelResult deleteAlarmModel(DeleteAlarmModelRequest request) {
request = beforeClientExecution(request);
return executeDeleteAlarmModel(request);
}
@SdkInternalApi
final DeleteAlarmModelResult executeDeleteAlarmModel(DeleteAlarmModelRequest deleteAlarmModelRequest) {
ExecutionContext executionContext = createExecutionContext(deleteAlarmModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteAlarmModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteAlarmModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteAlarmModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteAlarmModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes a detector model. Any active instances of the detector model are also deleted.
*
*
* @param deleteDetectorModelRequest
* @return Result of the DeleteDetectorModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceInUseException
* The resource is in use.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.DeleteDetectorModel
* @see AWS
* API Documentation
*/
@Override
public DeleteDetectorModelResult deleteDetectorModel(DeleteDetectorModelRequest request) {
request = beforeClientExecution(request);
return executeDeleteDetectorModel(request);
}
@SdkInternalApi
final DeleteDetectorModelResult executeDeleteDetectorModel(DeleteDetectorModelRequest deleteDetectorModelRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDetectorModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDetectorModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDetectorModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDetectorModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDetectorModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an input.
*
*
* @param deleteInputRequest
* @return Result of the DeleteInput operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @throws ResourceInUseException
* The resource is in use.
* @sample AWSIoTEvents.DeleteInput
* @see AWS API
* Documentation
*/
@Override
public DeleteInputResult deleteInput(DeleteInputRequest request) {
request = beforeClientExecution(request);
return executeDeleteInput(request);
}
@SdkInternalApi
final DeleteInputResult executeDeleteInput(DeleteInputRequest deleteInputRequest) {
ExecutionContext executionContext = createExecutionContext(deleteInputRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteInputRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteInputRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteInput");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteInputResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves information about an alarm model. If you don't specify a value for the alarmModelVersion
* parameter, the latest version is returned.
*
*
* @param describeAlarmModelRequest
* @return Result of the DescribeAlarmModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.DescribeAlarmModel
* @see AWS
* API Documentation
*/
@Override
public DescribeAlarmModelResult describeAlarmModel(DescribeAlarmModelRequest request) {
request = beforeClientExecution(request);
return executeDescribeAlarmModel(request);
}
@SdkInternalApi
final DescribeAlarmModelResult executeDescribeAlarmModel(DescribeAlarmModelRequest describeAlarmModelRequest) {
ExecutionContext executionContext = createExecutionContext(describeAlarmModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeAlarmModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeAlarmModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeAlarmModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeAlarmModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes a detector model. If the version
parameter is not specified, information about the latest
* version is returned.
*
*
* @param describeDetectorModelRequest
* @return Result of the DescribeDetectorModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.DescribeDetectorModel
* @see AWS API Documentation
*/
@Override
public DescribeDetectorModelResult describeDetectorModel(DescribeDetectorModelRequest request) {
request = beforeClientExecution(request);
return executeDescribeDetectorModel(request);
}
@SdkInternalApi
final DescribeDetectorModelResult executeDescribeDetectorModel(DescribeDetectorModelRequest describeDetectorModelRequest) {
ExecutionContext executionContext = createExecutionContext(describeDetectorModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeDetectorModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDetectorModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDetectorModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory
.createResponseHandler(new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeDetectorModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves runtime information about a detector model analysis.
*
*
*
* After AWS IoT Events starts analyzing your detector model, you have up to 24 hours to retrieve the analysis
* results.
*
*
*
* @param describeDetectorModelAnalysisRequest
* @return Result of the DescribeDetectorModelAnalysis operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.DescribeDetectorModelAnalysis
* @see AWS API Documentation
*/
@Override
public DescribeDetectorModelAnalysisResult describeDetectorModelAnalysis(DescribeDetectorModelAnalysisRequest request) {
request = beforeClientExecution(request);
return executeDescribeDetectorModelAnalysis(request);
}
@SdkInternalApi
final DescribeDetectorModelAnalysisResult executeDescribeDetectorModelAnalysis(DescribeDetectorModelAnalysisRequest describeDetectorModelAnalysisRequest) {
ExecutionContext executionContext = createExecutionContext(describeDetectorModelAnalysisRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeDetectorModelAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeDetectorModelAnalysisRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDetectorModelAnalysis");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeDetectorModelAnalysisResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes an input.
*
*
* @param describeInputRequest
* @return Result of the DescribeInput operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.DescribeInput
* @see AWS API
* Documentation
*/
@Override
public DescribeInputResult describeInput(DescribeInputRequest request) {
request = beforeClientExecution(request);
return executeDescribeInput(request);
}
@SdkInternalApi
final DescribeInputResult executeDescribeInput(DescribeInputRequest describeInputRequest) {
ExecutionContext executionContext = createExecutionContext(describeInputRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeInputRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeInputRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeInput");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeInputResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves the current settings of the AWS IoT Events logging options.
*
*
* @param describeLoggingOptionsRequest
* @return Result of the DescribeLoggingOptions operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @throws UnsupportedOperationException
* The requested operation is not supported.
* @sample AWSIoTEvents.DescribeLoggingOptions
* @see AWS API Documentation
*/
@Override
public DescribeLoggingOptionsResult describeLoggingOptions(DescribeLoggingOptionsRequest request) {
request = beforeClientExecution(request);
return executeDescribeLoggingOptions(request);
}
@SdkInternalApi
final DescribeLoggingOptionsResult executeDescribeLoggingOptions(DescribeLoggingOptionsRequest describeLoggingOptionsRequest) {
ExecutionContext executionContext = createExecutionContext(describeLoggingOptionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeLoggingOptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeLoggingOptionsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeLoggingOptions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeLoggingOptionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Retrieves one or more analysis results of the detector model.
*
*
*
* After AWS IoT Events starts analyzing your detector model, you have up to 24 hours to retrieve the analysis
* results.
*
*
*
* @param getDetectorModelAnalysisResultsRequest
* @return Result of the GetDetectorModelAnalysisResults operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.GetDetectorModelAnalysisResults
* @see AWS API Documentation
*/
@Override
public GetDetectorModelAnalysisResultsResult getDetectorModelAnalysisResults(GetDetectorModelAnalysisResultsRequest request) {
request = beforeClientExecution(request);
return executeGetDetectorModelAnalysisResults(request);
}
@SdkInternalApi
final GetDetectorModelAnalysisResultsResult executeGetDetectorModelAnalysisResults(
GetDetectorModelAnalysisResultsRequest getDetectorModelAnalysisResultsRequest) {
ExecutionContext executionContext = createExecutionContext(getDetectorModelAnalysisResultsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new GetDetectorModelAnalysisResultsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(getDetectorModelAnalysisResultsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "GetDetectorModelAnalysisResults");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new GetDetectorModelAnalysisResultsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all the versions of an alarm model. The operation returns only the metadata associated with each alarm
* model version.
*
*
* @param listAlarmModelVersionsRequest
* @return Result of the ListAlarmModelVersions operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.ListAlarmModelVersions
* @see AWS API Documentation
*/
@Override
public ListAlarmModelVersionsResult listAlarmModelVersions(ListAlarmModelVersionsRequest request) {
request = beforeClientExecution(request);
return executeListAlarmModelVersions(request);
}
@SdkInternalApi
final ListAlarmModelVersionsResult executeListAlarmModelVersions(ListAlarmModelVersionsRequest listAlarmModelVersionsRequest) {
ExecutionContext executionContext = createExecutionContext(listAlarmModelVersionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAlarmModelVersionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAlarmModelVersionsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAlarmModelVersions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListAlarmModelVersionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the alarm models that you created. The operation returns only the metadata associated with each alarm
* model.
*
*
* @param listAlarmModelsRequest
* @return Result of the ListAlarmModels operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.ListAlarmModels
* @see AWS API
* Documentation
*/
@Override
public ListAlarmModelsResult listAlarmModels(ListAlarmModelsRequest request) {
request = beforeClientExecution(request);
return executeListAlarmModels(request);
}
@SdkInternalApi
final ListAlarmModelsResult executeListAlarmModels(ListAlarmModelsRequest listAlarmModelsRequest) {
ExecutionContext executionContext = createExecutionContext(listAlarmModelsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListAlarmModelsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listAlarmModelsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListAlarmModels");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListAlarmModelsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists all the versions of a detector model. Only the metadata associated with each detector model version is
* returned.
*
*
* @param listDetectorModelVersionsRequest
* @return Result of the ListDetectorModelVersions operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.ListDetectorModelVersions
* @see AWS API Documentation
*/
@Override
public ListDetectorModelVersionsResult listDetectorModelVersions(ListDetectorModelVersionsRequest request) {
request = beforeClientExecution(request);
return executeListDetectorModelVersions(request);
}
@SdkInternalApi
final ListDetectorModelVersionsResult executeListDetectorModelVersions(ListDetectorModelVersionsRequest listDetectorModelVersionsRequest) {
ExecutionContext executionContext = createExecutionContext(listDetectorModelVersionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDetectorModelVersionsRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(listDetectorModelVersionsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDetectorModelVersions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListDetectorModelVersionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the detector models you have created. Only the metadata associated with each detector model is returned.
*
*
* @param listDetectorModelsRequest
* @return Result of the ListDetectorModels operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.ListDetectorModels
* @see AWS
* API Documentation
*/
@Override
public ListDetectorModelsResult listDetectorModels(ListDetectorModelsRequest request) {
request = beforeClientExecution(request);
return executeListDetectorModels(request);
}
@SdkInternalApi
final ListDetectorModelsResult executeListDetectorModels(ListDetectorModelsRequest listDetectorModelsRequest) {
ExecutionContext executionContext = createExecutionContext(listDetectorModelsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDetectorModelsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDetectorModelsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDetectorModels");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDetectorModelsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists one or more input routings.
*
*
* @param listInputRoutingsRequest
* @return Result of the ListInputRoutings operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @throws ResourceNotFoundException
* The resource was not found.
* @sample AWSIoTEvents.ListInputRoutings
* @see AWS
* API Documentation
*/
@Override
public ListInputRoutingsResult listInputRoutings(ListInputRoutingsRequest request) {
request = beforeClientExecution(request);
return executeListInputRoutings(request);
}
@SdkInternalApi
final ListInputRoutingsResult executeListInputRoutings(ListInputRoutingsRequest listInputRoutingsRequest) {
ExecutionContext executionContext = createExecutionContext(listInputRoutingsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListInputRoutingsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInputRoutingsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInputRoutings");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListInputRoutingsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the inputs you have created.
*
*
* @param listInputsRequest
* @return Result of the ListInputs operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.ListInputs
* @see AWS API
* Documentation
*/
@Override
public ListInputsResult listInputs(ListInputsRequest request) {
request = beforeClientExecution(request);
return executeListInputs(request);
}
@SdkInternalApi
final ListInputsResult executeListInputs(ListInputsRequest listInputsRequest) {
ExecutionContext executionContext = createExecutionContext(listInputsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListInputsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listInputsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListInputs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListInputsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the tags (metadata) you have assigned to the resource.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ResourceInUseException
* The resource is in use.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @sample AWSIoTEvents.ListTagsForResource
* @see AWS
* API Documentation
*/
@Override
public ListTagsForResourceResult listTagsForResource(ListTagsForResourceRequest request) {
request = beforeClientExecution(request);
return executeListTagsForResource(request);
}
@SdkInternalApi
final ListTagsForResourceResult executeListTagsForResource(ListTagsForResourceRequest listTagsForResourceRequest) {
ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListTagsForResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listTagsForResourceRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListTagsForResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListTagsForResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Sets or updates the AWS IoT Events logging options.
*
*
* If you update the value of any loggingOptions
field, it takes up to one minute for the change to
* take effect. If you change the policy attached to the role you specified in the roleArn
field (for
* example, to correct an invalid policy), it takes up to five minutes for that change to take effect.
*
*
* @param putLoggingOptionsRequest
* @return Result of the PutLoggingOptions operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @throws UnsupportedOperationException
* The requested operation is not supported.
* @throws ResourceInUseException
* The resource is in use.
* @sample AWSIoTEvents.PutLoggingOptions
* @see AWS
* API Documentation
*/
@Override
public PutLoggingOptionsResult putLoggingOptions(PutLoggingOptionsRequest request) {
request = beforeClientExecution(request);
return executePutLoggingOptions(request);
}
@SdkInternalApi
final PutLoggingOptionsResult executePutLoggingOptions(PutLoggingOptionsRequest putLoggingOptionsRequest) {
ExecutionContext executionContext = createExecutionContext(putLoggingOptionsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new PutLoggingOptionsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(putLoggingOptionsRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "PutLoggingOptions");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new PutLoggingOptionsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Performs an analysis of your detector model. For more information, see Troubleshooting a
* detector model in the AWS IoT Events Developer Guide.
*
*
* @param startDetectorModelAnalysisRequest
* @return Result of the StartDetectorModelAnalysis operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws LimitExceededException
* A limit was exceeded.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.StartDetectorModelAnalysis
* @see AWS API Documentation
*/
@Override
public StartDetectorModelAnalysisResult startDetectorModelAnalysis(StartDetectorModelAnalysisRequest request) {
request = beforeClientExecution(request);
return executeStartDetectorModelAnalysis(request);
}
@SdkInternalApi
final StartDetectorModelAnalysisResult executeStartDetectorModelAnalysis(StartDetectorModelAnalysisRequest startDetectorModelAnalysisRequest) {
ExecutionContext executionContext = createExecutionContext(startDetectorModelAnalysisRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartDetectorModelAnalysisRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(startDetectorModelAnalysisRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartDetectorModelAnalysis");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new StartDetectorModelAnalysisResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds to or modifies the tags of the given resource. Tags are metadata that can be used to manage a resource.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ResourceInUseException
* The resource is in use.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws LimitExceededException
* A limit was exceeded.
* @throws InternalFailureException
* An internal failure occurred.
* @sample AWSIoTEvents.TagResource
* @see AWS API
* Documentation
*/
@Override
public TagResourceResult tagResource(TagResourceRequest request) {
request = beforeClientExecution(request);
return executeTagResource(request);
}
@SdkInternalApi
final TagResourceResult executeTagResource(TagResourceRequest tagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(tagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new TagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(tagResourceRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "TagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new TagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Removes the given tags (metadata) from the resource.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ResourceInUseException
* The resource is in use.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @sample AWSIoTEvents.UntagResource
* @see AWS API
* Documentation
*/
@Override
public UntagResourceResult untagResource(UntagResourceRequest request) {
request = beforeClientExecution(request);
return executeUntagResource(request);
}
@SdkInternalApi
final UntagResourceResult executeUntagResource(UntagResourceRequest untagResourceRequest) {
ExecutionContext executionContext = createExecutionContext(untagResourceRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UntagResourceRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(untagResourceRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UntagResource");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UntagResourceResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates an alarm model. Any alarms that were created based on the previous version are deleted and then created
* again as new data arrives.
*
*
* @param updateAlarmModelRequest
* @return Result of the UpdateAlarmModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceInUseException
* The resource is in use.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.UpdateAlarmModel
* @see AWS API
* Documentation
*/
@Override
public UpdateAlarmModelResult updateAlarmModel(UpdateAlarmModelRequest request) {
request = beforeClientExecution(request);
return executeUpdateAlarmModel(request);
}
@SdkInternalApi
final UpdateAlarmModelResult executeUpdateAlarmModel(UpdateAlarmModelRequest updateAlarmModelRequest) {
ExecutionContext executionContext = createExecutionContext(updateAlarmModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateAlarmModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateAlarmModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateAlarmModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateAlarmModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates a detector model. Detectors (instances) spawned by the previous version are deleted and then re-created
* as new inputs arrive.
*
*
* @param updateDetectorModelRequest
* @return Result of the UpdateDetectorModel operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ResourceInUseException
* The resource is in use.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @sample AWSIoTEvents.UpdateDetectorModel
* @see AWS
* API Documentation
*/
@Override
public UpdateDetectorModelResult updateDetectorModel(UpdateDetectorModelRequest request) {
request = beforeClientExecution(request);
return executeUpdateDetectorModel(request);
}
@SdkInternalApi
final UpdateDetectorModelResult executeUpdateDetectorModel(UpdateDetectorModelRequest updateDetectorModelRequest) {
ExecutionContext executionContext = createExecutionContext(updateDetectorModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateDetectorModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDetectorModelRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDetectorModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDetectorModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Updates an input.
*
*
* @param updateInputRequest
* @return Result of the UpdateInput operation returned by the service.
* @throws InvalidRequestException
* The request was invalid.
* @throws ThrottlingException
* The request could not be completed due to throttling.
* @throws ResourceNotFoundException
* The resource was not found.
* @throws InternalFailureException
* An internal failure occurred.
* @throws ServiceUnavailableException
* The service is currently unavailable.
* @throws ResourceInUseException
* The resource is in use.
* @sample AWSIoTEvents.UpdateInput
* @see AWS API
* Documentation
*/
@Override
public UpdateInputResult updateInput(UpdateInputRequest request) {
request = beforeClientExecution(request);
return executeUpdateInput(request);
}
@SdkInternalApi
final UpdateInputResult executeUpdateInput(UpdateInputRequest updateInputRequest) {
ExecutionContext executionContext = createExecutionContext(updateInputRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateInputRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateInputRequest));
// 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, "IoT Events");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateInput");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateInputResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
* Returns additional metadata for a previously executed successful, request, typically used for debugging issues
* where a service isn't acting as expected. This data isn't considered part of the result data returned by an
* operation, so it's available through this separate, diagnostic interface.
*
* Response metadata is only cached for a limited period of time, so if you need to access this extra diagnostic
* information for an executed request, you should use this method to retrieve it as soon as possible after
* executing the request.
*
* @param request
* The originally executed request
*
* @return The response metadata for the specified request, or null if none is available.
*/
public ResponseMetadata getCachedResponseMetadata(AmazonWebServiceRequest request) {
return client.getResponseMetadataForRequest(request);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext) {
return invoke(request, responseHandler, executionContext, null, null);
}
/**
* Normal invoke with authentication. Credentials are required and may be overriden at the request level.
**/
private Response invoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI cachedEndpoint, URI uriFromEndpointTrait) {
executionContext.setCredentialsProvider(CredentialUtils.getCredentialsProvider(request.getOriginalRequest(), awsCredentialsProvider));
return doInvoke(request, responseHandler, executionContext, cachedEndpoint, uriFromEndpointTrait);
}
/**
* Invoke with no authentication. Credentials are not required and any credentials set on the client or request will
* be ignored for this operation.
**/
private Response anonymousInvoke(Request request,
HttpResponseHandler> responseHandler, ExecutionContext executionContext) {
return doInvoke(request, responseHandler, executionContext, null, null);
}
/**
* Invoke the request using the http client. Assumes credentials (or lack thereof) have been configured in the
* ExecutionContext beforehand.
**/
private Response doInvoke(Request request, HttpResponseHandler> responseHandler,
ExecutionContext executionContext, URI discoveredEndpoint, URI uriFromEndpointTrait) {
if (discoveredEndpoint != null) {
request.setEndpoint(discoveredEndpoint);
request.getOriginalRequest().getRequestClientOptions().appendUserAgent("endpoint-discovery");
} else if (uriFromEndpointTrait != null) {
request.setEndpoint(uriFromEndpointTrait);
} else {
request.setEndpoint(endpoint);
}
request.setTimeOffset(timeOffset);
HttpResponseHandler errorResponseHandler = protocolFactory.createErrorResponseHandler(new JsonErrorResponseMetadata());
return client.execute(request, responseHandler, errorResponseHandler, executionContext);
}
@com.amazonaws.annotation.SdkInternalApi
static com.amazonaws.protocol.json.SdkJsonProtocolFactory getProtocolFactory() {
return protocolFactory;
}
@Override
public void shutdown() {
super.shutdown();
}
}