com.amazonaws.services.lookoutforvision.AmazonLookoutforVisionClient Maven / Gradle / Ivy
Show all versions of aws-java-sdk-lookoutforvision 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.lookoutforvision;
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.lookoutforvision.AmazonLookoutforVisionClientBuilder;
import com.amazonaws.AmazonServiceException;
import com.amazonaws.services.lookoutforvision.model.*;
import com.amazonaws.services.lookoutforvision.model.transform.*;
/**
* Client for accessing Amazon Lookout for Vision. All service calls made using this client are blocking, and will not
* return until the service call completes.
*
*
* This is the Amazon Lookout for Vision API Reference. It provides descriptions of actions, data types, common
* parameters, and common errors.
*
*
* Amazon Lookout for Vision enables you to find visual defects in industrial products, accurately and at scale. It uses
* computer vision to identify missing components in an industrial product, damage to vehicles or structures,
* irregularities in production lines, and even minuscule defects in silicon wafers — or any other physical item where
* quality is important such as a missing capacitor on printed circuit boards.
*
*/
@ThreadSafe
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class AmazonLookoutforVisionClient extends AmazonWebServiceClient implements AmazonLookoutforVision {
/** Provider for AWS credentials. */
private final AWSCredentialsProvider awsCredentialsProvider;
private static final Log log = LogFactory.getLog(AmazonLookoutforVision.class);
/** Default signing name for the service. */
private static final String DEFAULT_SIGNING_NAME = "lookoutvision";
/** 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("AccessDeniedException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.AccessDeniedExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ConflictException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.ConflictExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ResourceNotFoundException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.ResourceNotFoundExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ThrottlingException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.ThrottlingExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ValidationException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.ValidationExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("ServiceQuotaExceededException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.ServiceQuotaExceededExceptionUnmarshaller.getInstance()))
.addErrorMetadata(
new JsonErrorShapeMetadata().withErrorCode("InternalServerException").withExceptionUnmarshaller(
com.amazonaws.services.lookoutforvision.model.transform.InternalServerExceptionUnmarshaller.getInstance()))
.withBaseServiceExceptionClass(com.amazonaws.services.lookoutforvision.model.AmazonLookoutforVisionException.class));
public static AmazonLookoutforVisionClientBuilder builder() {
return AmazonLookoutforVisionClientBuilder.standard();
}
/**
* Constructs a new client to invoke service methods on Amazon Lookout for Vision 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.
*/
AmazonLookoutforVisionClient(AwsSyncClientParams clientParams) {
this(clientParams, false);
}
/**
* Constructs a new client to invoke service methods on Amazon Lookout for Vision 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.
*/
AmazonLookoutforVisionClient(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("lookoutvision.us-east-1.amazonaws.com");
HandlerChainFactory chainFactory = new HandlerChainFactory();
requestHandler2s.addAll(chainFactory.newRequestHandlerChain("/com/amazonaws/services/lookoutforvision/request.handlers"));
requestHandler2s.addAll(chainFactory.newRequestHandler2Chain("/com/amazonaws/services/lookoutforvision/request.handler2s"));
requestHandler2s.addAll(chainFactory.getGlobalHandlers());
}
/**
*
* Creates a new dataset in an Amazon Lookout for Vision project. CreateDataset
can create a training
* or a test dataset from a valid dataset source (DatasetSource
).
*
*
* If you want a single dataset project, specify train
for the value of DatasetType
.
*
*
* To have a project with separate training and test datasets, call CreateDataset
twice. On the first
* call, specify train
for the value of DatasetType
. On the second call, specify
* test
for the value of DatasetType
.
*
*
* This operation requires permissions to perform the lookoutvision:CreateDataset
operation.
*
*
* @param createDatasetRequest
* @return Result of the CreateDataset operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @throws ServiceQuotaExceededException
* A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for
* Vision in the Amazon Lookout for Vision Developer Guide.
* @sample AmazonLookoutforVision.CreateDataset
* @see AWS
* API Documentation
*/
@Override
public CreateDatasetResult createDataset(CreateDatasetRequest request) {
request = beforeClientExecution(request);
return executeCreateDataset(request);
}
@SdkInternalApi
final CreateDatasetResult executeCreateDataset(CreateDatasetRequest createDatasetRequest) {
ExecutionContext executionContext = createExecutionContext(createDatasetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createDatasetRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateDataset");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateDatasetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates a new version of a model within an an Amazon Lookout for Vision project. CreateModel
is an
* asynchronous operation in which Amazon Lookout for Vision trains, tests, and evaluates a new version of a model.
*
*
* To get the current status, check the Status
field returned in the response from
* DescribeModel.
*
*
* If the project has a single dataset, Amazon Lookout for Vision internally splits the dataset to create a training
* and a test dataset. If the project has a training and a test dataset, Lookout for Vision uses the respective
* datasets to train and test the model.
*
*
* After training completes, the evaluation metrics are stored at the location specified in
* OutputConfig
.
*
*
* This operation requires permissions to perform the lookoutvision:CreateModel
operation. If you want
* to tag your model, you also require permission to the lookoutvision:TagResource
operation.
*
*
* @param createModelRequest
* @return Result of the CreateModel operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @throws ServiceQuotaExceededException
* A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for
* Vision in the Amazon Lookout for Vision Developer Guide.
* @sample AmazonLookoutforVision.CreateModel
* @see AWS API
* Documentation
*/
@Override
public CreateModelResult createModel(CreateModelRequest request) {
request = beforeClientExecution(request);
return executeCreateModel(request);
}
@SdkInternalApi
final CreateModelResult executeCreateModel(CreateModelRequest createModelRequest) {
ExecutionContext executionContext = createExecutionContext(createModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createModelRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Creates an empty Amazon Lookout for Vision project. After you create the project, add a dataset by calling
* CreateDataset.
*
*
* This operation requires permissions to perform the lookoutvision:CreateProject
operation.
*
*
* @param createProjectRequest
* @return Result of the CreateProject operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @throws ServiceQuotaExceededException
* A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for
* Vision in the Amazon Lookout for Vision Developer Guide.
* @sample AmazonLookoutforVision.CreateProject
* @see AWS
* API Documentation
*/
@Override
public CreateProjectResult createProject(CreateProjectRequest request) {
request = beforeClientExecution(request);
return executeCreateProject(request);
}
@SdkInternalApi
final CreateProjectResult executeCreateProject(CreateProjectRequest createProjectRequest) {
ExecutionContext executionContext = createExecutionContext(createProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new CreateProjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(createProjectRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "CreateProject");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new CreateProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an existing Amazon Lookout for Vision dataset
.
*
*
* If your the project has a single dataset, you must create a new dataset before you can create a model.
*
*
* If you project has a training dataset and a test dataset consider the following.
*
*
* -
*
* If you delete the test dataset, your project reverts to a single dataset project. If you then train the model,
* Amazon Lookout for Vision internally splits the remaining dataset into a training and test dataset.
*
*
* -
*
* If you delete the training dataset, you must create a training dataset before you can create a model.
*
*
*
*
* This operation requires permissions to perform the lookoutvision:DeleteDataset
operation.
*
*
* @param deleteDatasetRequest
* @return Result of the DeleteDataset operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DeleteDataset
* @see AWS
* API Documentation
*/
@Override
public DeleteDatasetResult deleteDataset(DeleteDatasetRequest request) {
request = beforeClientExecution(request);
return executeDeleteDataset(request);
}
@SdkInternalApi
final DeleteDatasetResult executeDeleteDataset(DeleteDatasetRequest deleteDatasetRequest) {
ExecutionContext executionContext = createExecutionContext(deleteDatasetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteDatasetRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteDataset");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteDatasetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an Amazon Lookout for Vision model. You can't delete a running model. To stop a running model, use the
* StopModel operation.
*
*
* It might take a few seconds to delete a model. To determine if a model has been deleted, call ListModels
* and check if the version of the model (ModelVersion
) is in the Models
array.
*
*
*
* This operation requires permissions to perform the lookoutvision:DeleteModel
operation.
*
*
* @param deleteModelRequest
* @return Result of the DeleteModel operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DeleteModel
* @see AWS API
* Documentation
*/
@Override
public DeleteModelResult deleteModel(DeleteModelRequest request) {
request = beforeClientExecution(request);
return executeDeleteModel(request);
}
@SdkInternalApi
final DeleteModelResult executeDeleteModel(DeleteModelRequest deleteModelRequest) {
ExecutionContext executionContext = createExecutionContext(deleteModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteModelRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Deletes an Amazon Lookout for Vision project.
*
*
* To delete a project, you must first delete each version of the model associated with the project. To delete a
* model use the DeleteModel operation.
*
*
* You also have to delete the dataset(s) associated with the model. For more information, see DeleteDataset.
* The images referenced by the training and test datasets aren't deleted.
*
*
* This operation requires permissions to perform the lookoutvision:DeleteProject
operation.
*
*
* @param deleteProjectRequest
* @return Result of the DeleteProject operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DeleteProject
* @see AWS
* API Documentation
*/
@Override
public DeleteProjectResult deleteProject(DeleteProjectRequest request) {
request = beforeClientExecution(request);
return executeDeleteProject(request);
}
@SdkInternalApi
final DeleteProjectResult executeDeleteProject(DeleteProjectRequest deleteProjectRequest) {
ExecutionContext executionContext = createExecutionContext(deleteProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DeleteProjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(deleteProjectRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DeleteProject");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DeleteProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describe an Amazon Lookout for Vision dataset.
*
*
* This operation requires permissions to perform the lookoutvision:DescribeDataset
operation.
*
*
* @param describeDatasetRequest
* @return Result of the DescribeDataset operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DescribeDataset
* @see AWS
* API Documentation
*/
@Override
public DescribeDatasetResult describeDataset(DescribeDatasetRequest request) {
request = beforeClientExecution(request);
return executeDescribeDataset(request);
}
@SdkInternalApi
final DescribeDatasetResult executeDescribeDataset(DescribeDatasetRequest describeDatasetRequest) {
ExecutionContext executionContext = createExecutionContext(describeDatasetRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeDatasetRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeDatasetRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeDataset");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeDatasetResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes a version of an Amazon Lookout for Vision model.
*
*
* This operation requires permissions to perform the lookoutvision:DescribeModel
operation.
*
*
* @param describeModelRequest
* @return Result of the DescribeModel operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DescribeModel
* @see AWS
* API Documentation
*/
@Override
public DescribeModelResult describeModel(DescribeModelRequest request) {
request = beforeClientExecution(request);
return executeDescribeModel(request);
}
@SdkInternalApi
final DescribeModelResult executeDescribeModel(DescribeModelRequest describeModelRequest) {
ExecutionContext executionContext = createExecutionContext(describeModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeModelRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes an Amazon Lookout for Vision model packaging job.
*
*
* This operation requires permissions to perform the lookoutvision:DescribeModelPackagingJob
* operation.
*
*
* For more information, see Using your Amazon Lookout for Vision model on an edge device in the Amazon
* Lookout for Vision Developer Guide.
*
*
* @param describeModelPackagingJobRequest
* @return Result of the DescribeModelPackagingJob operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DescribeModelPackagingJob
* @see AWS API Documentation
*/
@Override
public DescribeModelPackagingJobResult describeModelPackagingJob(DescribeModelPackagingJobRequest request) {
request = beforeClientExecution(request);
return executeDescribeModelPackagingJob(request);
}
@SdkInternalApi
final DescribeModelPackagingJobResult executeDescribeModelPackagingJob(DescribeModelPackagingJobRequest describeModelPackagingJobRequest) {
ExecutionContext executionContext = createExecutionContext(describeModelPackagingJobRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeModelPackagingJobRequestProtocolMarshaller(protocolFactory).marshall(super
.beforeMarshalling(describeModelPackagingJobRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeModelPackagingJob");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new DescribeModelPackagingJobResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Describes an Amazon Lookout for Vision project.
*
*
* This operation requires permissions to perform the lookoutvision:DescribeProject
operation.
*
*
* @param describeProjectRequest
* @return Result of the DescribeProject operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DescribeProject
* @see AWS
* API Documentation
*/
@Override
public DescribeProjectResult describeProject(DescribeProjectRequest request) {
request = beforeClientExecution(request);
return executeDescribeProject(request);
}
@SdkInternalApi
final DescribeProjectResult executeDescribeProject(DescribeProjectRequest describeProjectRequest) {
ExecutionContext executionContext = createExecutionContext(describeProjectRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DescribeProjectRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(describeProjectRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DescribeProject");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DescribeProjectResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Detects anomalies in an image that you supply.
*
*
* The response from DetectAnomalies
includes a boolean prediction that the image contains one or more
* anomalies and a confidence value for the prediction. If the model is an image segmentation model, the response
* also includes segmentation information for each type of anomaly found in the image.
*
*
*
* Before calling DetectAnomalies
, you must first start your model with the StartModel
* operation. You are charged for the amount of time, in minutes, that a model runs and for the number of anomaly
* detection units that your model uses. If you are not using a model, use the StopModel operation to stop
* your model.
*
*
*
* For more information, see Detecting anomalies in an image in the Amazon Lookout for Vision developer
* guide.
*
*
* This operation requires permissions to perform the lookoutvision:DetectAnomalies
operation.
*
*
* @param detectAnomaliesRequest
* @return Result of the DetectAnomalies operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.DetectAnomalies
* @see AWS
* API Documentation
*/
@Override
public DetectAnomaliesResult detectAnomalies(DetectAnomaliesRequest request) {
request = beforeClientExecution(request);
return executeDetectAnomalies(request);
}
@SdkInternalApi
final DetectAnomaliesResult executeDetectAnomalies(DetectAnomaliesRequest detectAnomaliesRequest) {
ExecutionContext executionContext = createExecutionContext(detectAnomaliesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new DetectAnomaliesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(detectAnomaliesRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "DetectAnomalies");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
request.addHandlerContext(HandlerContextKey.REQUIRES_LENGTH, Boolean.TRUE);
request.addHandlerContext(HandlerContextKey.HAS_STREAMING_INPUT, Boolean.TRUE);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new DetectAnomaliesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the JSON Lines within a dataset. An Amazon Lookout for Vision JSON Line contains the anomaly information
* for a single image, including the image location and the assigned label.
*
*
* This operation requires permissions to perform the lookoutvision:ListDatasetEntries
operation.
*
*
* @param listDatasetEntriesRequest
* @return Result of the ListDatasetEntries operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.ListDatasetEntries
* @see AWS API Documentation
*/
@Override
public ListDatasetEntriesResult listDatasetEntries(ListDatasetEntriesRequest request) {
request = beforeClientExecution(request);
return executeListDatasetEntries(request);
}
@SdkInternalApi
final ListDatasetEntriesResult executeListDatasetEntries(ListDatasetEntriesRequest listDatasetEntriesRequest) {
ExecutionContext executionContext = createExecutionContext(listDatasetEntriesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListDatasetEntriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listDatasetEntriesRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListDatasetEntries");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListDatasetEntriesResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the model packaging jobs created for an Amazon Lookout for Vision project.
*
*
* This operation requires permissions to perform the lookoutvision:ListModelPackagingJobs
operation.
*
*
* For more information, see Using your Amazon Lookout for Vision model on an edge device in the Amazon
* Lookout for Vision Developer Guide.
*
*
* @param listModelPackagingJobsRequest
* @return Result of the ListModelPackagingJobs operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.ListModelPackagingJobs
* @see AWS API Documentation
*/
@Override
public ListModelPackagingJobsResult listModelPackagingJobs(ListModelPackagingJobsRequest request) {
request = beforeClientExecution(request);
return executeListModelPackagingJobs(request);
}
@SdkInternalApi
final ListModelPackagingJobsResult executeListModelPackagingJobs(ListModelPackagingJobsRequest listModelPackagingJobsRequest) {
ExecutionContext executionContext = createExecutionContext(listModelPackagingJobsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListModelPackagingJobsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listModelPackagingJobsRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListModelPackagingJobs");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new ListModelPackagingJobsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the versions of a model in an Amazon Lookout for Vision project.
*
*
* The ListModels
operation is eventually consistent. Recent calls to CreateModel
might
* take a while to appear in the response from ListProjects
.
*
*
* This operation requires permissions to perform the lookoutvision:ListModels
operation.
*
*
* @param listModelsRequest
* @return Result of the ListModels operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.ListModels
* @see AWS API
* Documentation
*/
@Override
public ListModelsResult listModels(ListModelsRequest request) {
request = beforeClientExecution(request);
return executeListModels(request);
}
@SdkInternalApi
final ListModelsResult executeListModels(ListModelsRequest listModelsRequest) {
ExecutionContext executionContext = createExecutionContext(listModelsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListModelsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listModelsRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListModels");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListModelsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Lists the Amazon Lookout for Vision projects in your AWS account that are in the AWS Region in which you call
* ListProjects
.
*
*
* The ListProjects
operation is eventually consistent. Recent calls to CreateProject
and
* DeleteProject
might take a while to appear in the response from ListProjects
.
*
*
* This operation requires permissions to perform the lookoutvision:ListProjects
operation.
*
*
* @param listProjectsRequest
* @return Result of the ListProjects operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.ListProjects
* @see AWS API
* Documentation
*/
@Override
public ListProjectsResult listProjects(ListProjectsRequest request) {
request = beforeClientExecution(request);
return executeListProjects(request);
}
@SdkInternalApi
final ListProjectsResult executeListProjects(ListProjectsRequest listProjectsRequest) {
ExecutionContext executionContext = createExecutionContext(listProjectsRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new ListProjectsRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(listProjectsRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "ListProjects");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new ListProjectsResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Returns a list of tags attached to the specified Amazon Lookout for Vision model.
*
*
* This operation requires permissions to perform the lookoutvision:ListTagsForResource
operation.
*
*
* @param listTagsForResourceRequest
* @return Result of the ListTagsForResource operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.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, "LookoutVision");
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);
}
}
/**
*
* Starts the running of the version of an Amazon Lookout for Vision model. Starting a model takes a while to
* complete. To check the current state of the model, use DescribeModel.
*
*
* A model is ready to use when its status is HOSTED
.
*
*
* Once the model is running, you can detect custom labels in new images by calling DetectAnomalies.
*
*
*
* You are charged for the amount of time that the model is running. To stop a running model, call StopModel.
*
*
*
* This operation requires permissions to perform the lookoutvision:StartModel
operation.
*
*
* @param startModelRequest
* @return Result of the StartModel operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @throws ServiceQuotaExceededException
* A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for
* Vision in the Amazon Lookout for Vision Developer Guide.
* @sample AmazonLookoutforVision.StartModel
* @see AWS API
* Documentation
*/
@Override
public StartModelResult startModel(StartModelRequest request) {
request = beforeClientExecution(request);
return executeStartModel(request);
}
@SdkInternalApi
final StartModelResult executeStartModel(StartModelRequest startModelRequest) {
ExecutionContext executionContext = createExecutionContext(startModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startModelRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new StartModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Starts an Amazon Lookout for Vision model packaging job. A model packaging job creates an AWS IoT Greengrass
* component for a Lookout for Vision model. You can use the component to deploy your model to an edge device
* managed by Greengrass.
*
*
* Use the DescribeModelPackagingJob API to determine the current status of the job. The model packaging job
* is complete if the value of Status
is SUCCEEDED
.
*
*
* To deploy the component to the target device, use the component name and component version with the AWS IoT
* Greengrass CreateDeployment API.
*
*
* This operation requires the following permissions:
*
*
* -
*
* lookoutvision:StartModelPackagingJob
*
*
* -
*
* s3:PutObject
*
*
* -
*
* s3:GetBucketLocation
*
*
* -
*
* kms:GenerateDataKey
*
*
* -
*
* greengrass:CreateComponentVersion
*
*
* -
*
* greengrass:DescribeComponent
*
*
* -
*
* (Optional) greengrass:TagResource
. Only required if you want to tag the component.
*
*
*
*
* For more information, see Using your Amazon Lookout for Vision model on an edge device in the Amazon
* Lookout for Vision Developer Guide.
*
*
* @param startModelPackagingJobRequest
* @return Result of the StartModelPackagingJob operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @throws ServiceQuotaExceededException
* A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for
* Vision in the Amazon Lookout for Vision Developer Guide.
* @sample AmazonLookoutforVision.StartModelPackagingJob
* @see AWS API Documentation
*/
@Override
public StartModelPackagingJobResult startModelPackagingJob(StartModelPackagingJobRequest request) {
request = beforeClientExecution(request);
return executeStartModelPackagingJob(request);
}
@SdkInternalApi
final StartModelPackagingJobResult executeStartModelPackagingJob(StartModelPackagingJobRequest startModelPackagingJobRequest) {
ExecutionContext executionContext = createExecutionContext(startModelPackagingJobRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StartModelPackagingJobRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(startModelPackagingJobRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StartModelPackagingJob");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false),
new StartModelPackagingJobResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Stops the hosting of a running model. The operation might take a while to complete. To check the current status,
* call DescribeModel.
*
*
* After the model hosting stops, the Status
of the model is TRAINED
.
*
*
* This operation requires permissions to perform the lookoutvision:StopModel
operation.
*
*
* @param stopModelRequest
* @return Result of the StopModel operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.StopModel
* @see AWS API
* Documentation
*/
@Override
public StopModelResult stopModel(StopModelRequest request) {
request = beforeClientExecution(request);
return executeStopModel(request);
}
@SdkInternalApi
final StopModelResult executeStopModel(StopModelRequest stopModelRequest) {
ExecutionContext executionContext = createExecutionContext(stopModelRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new StopModelRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(stopModelRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "StopModel");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(new JsonOperationMetadata()
.withPayloadJson(true).withHasStreamingSuccessResponse(false), new StopModelResultJsonUnmarshaller());
response = invoke(request, responseHandler, executionContext);
return response.getAwsResponse();
} finally {
endClientExecution(awsRequestMetrics, request, response);
}
}
/**
*
* Adds one or more key-value tags to an Amazon Lookout for Vision model. For more information, see Tagging a
* model in the Amazon Lookout for Vision Developer Guide.
*
*
* This operation requires permissions to perform the lookoutvision:TagResource
operation.
*
*
* @param tagResourceRequest
* @return Result of the TagResource operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @throws ServiceQuotaExceededException
* A service quota was exceeded the allowed limit. For more information, see Limits in Amazon Lookout for
* Vision in the Amazon Lookout for Vision Developer Guide.
* @sample AmazonLookoutforVision.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, "LookoutVision");
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 one or more tags from an Amazon Lookout for Vision model. For more information, see Tagging a
* model in the Amazon Lookout for Vision Developer Guide.
*
*
* This operation requires permissions to perform the lookoutvision:UntagResource
operation.
*
*
* @param untagResourceRequest
* @return Result of the UntagResource operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.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, "LookoutVision");
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);
}
}
/**
*
* Adds or updates one or more JSON Line entries in a dataset. A JSON Line includes information about an image used
* for training or testing an Amazon Lookout for Vision model.
*
*
* To update an existing JSON Line, use the source-ref
field to identify the JSON Line. The JSON line
* that you supply replaces the existing JSON line. Any existing annotations that are not in the new JSON line are
* removed from the dataset.
*
*
* For more information, see Defining JSON lines for anomaly classification in the Amazon Lookout for Vision
* Developer Guide.
*
*
*
* The images you reference in the source-ref
field of a JSON line, must be in the same S3 bucket as
* the existing images in the dataset.
*
*
*
* Updating a dataset might take a while to complete. To check the current status, call DescribeDataset and
* check the Status
field in the response.
*
*
* This operation requires permissions to perform the lookoutvision:UpdateDatasetEntries
operation.
*
*
* @param updateDatasetEntriesRequest
* @return Result of the UpdateDatasetEntries operation returned by the service.
* @throws AccessDeniedException
* You are not authorized to perform the action.
* @throws InternalServerException
* Amazon Lookout for Vision experienced a service issue. Try your call again.
* @throws ValidationException
* An input validation error occured. For example, invalid characters in a project name, or if a pagination
* token is invalid.
* @throws ConflictException
* The update or deletion of a resource caused an inconsistent state.
* @throws ResourceNotFoundException
* The resource could not be found.
* @throws ThrottlingException
* Amazon Lookout for Vision is temporarily unable to process the request. Try your call again.
* @sample AmazonLookoutforVision.UpdateDatasetEntries
* @see AWS API Documentation
*/
@Override
public UpdateDatasetEntriesResult updateDatasetEntries(UpdateDatasetEntriesRequest request) {
request = beforeClientExecution(request);
return executeUpdateDatasetEntries(request);
}
@SdkInternalApi
final UpdateDatasetEntriesResult executeUpdateDatasetEntries(UpdateDatasetEntriesRequest updateDatasetEntriesRequest) {
ExecutionContext executionContext = createExecutionContext(updateDatasetEntriesRequest);
AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics();
awsRequestMetrics.startEvent(Field.ClientExecuteTime);
Request request = null;
Response response = null;
try {
awsRequestMetrics.startEvent(Field.RequestMarshallTime);
try {
request = new UpdateDatasetEntriesRequestProtocolMarshaller(protocolFactory).marshall(super.beforeMarshalling(updateDatasetEntriesRequest));
// 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, "LookoutVision");
request.addHandlerContext(HandlerContextKey.OPERATION_NAME, "UpdateDatasetEntries");
request.addHandlerContext(HandlerContextKey.ADVANCED_CONFIG, advancedConfig);
} finally {
awsRequestMetrics.endEvent(Field.RequestMarshallTime);
}
HttpResponseHandler> responseHandler = protocolFactory.createResponseHandler(
new JsonOperationMetadata().withPayloadJson(true).withHasStreamingSuccessResponse(false), new UpdateDatasetEntriesResultJsonUnmarshaller());
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();
}
}