|
1 | 1 | /* |
2 | | - * Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
| 2 | + * Copyright 2010-2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
3 | 3 | * |
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License"). |
5 | 5 | * You may not use this file except in compliance with the License. |
@@ -366,11 +366,22 @@ private static ClientConfiguration adjustClientConfiguration(ClientConfiguration |
366 | 366 | * Compares a face in the <i>source</i> input image with each of the 100 |
367 | 367 | * largest faces detected in the <i>target</i> input image. |
368 | 368 | * </p> |
369 | | - * <note> |
370 | 369 | * <p> |
371 | 370 | * If the source image contains multiple faces, the service detects the |
372 | 371 | * largest face and compares it with each face detected in the target image. |
373 | 372 | * </p> |
| 373 | + * <note> |
| 374 | + * <p> |
| 375 | + * CompareFaces uses machine learning algorithms, which are probabilistic. A |
| 376 | + * false negative is an incorrect prediction that a face in the target image |
| 377 | + * has a low similarity confidence score when compared to the face in the |
| 378 | + * source image. To reduce the probability of false negatives, we recommend |
| 379 | + * that you compare the target image against multiple source images. If you |
| 380 | + * plan to use <code>CompareFaces</code> to make a decision that impacts an |
| 381 | + * individual's rights, privacy, or access to services, we recommend that |
| 382 | + * you pass the result to a human for review and further validation before |
| 383 | + * taking action. |
| 384 | + * </p> |
374 | 385 | * </note> |
375 | 386 | * <p> |
376 | 387 | * You pass the input and target images either as base64-encoded image bytes |
@@ -517,6 +528,7 @@ public CompareFacesResult compareFaces(CompareFacesRequest compareFacesRequest) |
517 | 528 | * @throws ThrottlingException |
518 | 529 | * @throws ProvisionedThroughputExceededException |
519 | 530 | * @throws ResourceAlreadyExistsException |
| 531 | + * @throws ServiceQuotaExceededException |
520 | 532 | * @throws AmazonClientException If any internal errors are encountered |
521 | 533 | * inside the client while attempting to make the request or |
522 | 534 | * handle the response. For example if a network connection is |
@@ -650,6 +662,7 @@ public CreateProjectResult createProject(CreateProjectRequest createProjectReque |
650 | 662 | * @throws InternalServerErrorException |
651 | 663 | * @throws ThrottlingException |
652 | 664 | * @throws ProvisionedThroughputExceededException |
| 665 | + * @throws ServiceQuotaExceededException |
653 | 666 | * @throws AmazonClientException If any internal errors are encountered |
654 | 667 | * inside the client while attempting to make the request or |
655 | 668 | * handle the response. For example if a network connection is |
@@ -726,6 +739,7 @@ public CreateProjectVersionResult createProjectVersion( |
726 | 739 | * @throws LimitExceededException |
727 | 740 | * @throws ResourceInUseException |
728 | 741 | * @throws ProvisionedThroughputExceededException |
| 742 | + * @throws ServiceQuotaExceededException |
729 | 743 | * @throws AmazonClientException If any internal errors are encountered |
730 | 744 | * inside the client while attempting to make the request or |
731 | 745 | * handle the response. For example if a network connection is |
@@ -3137,6 +3151,61 @@ public ListStreamProcessorsResult listStreamProcessors( |
3137 | 3151 | } |
3138 | 3152 | } |
3139 | 3153 |
|
| 3154 | + /** |
| 3155 | + * <p> |
| 3156 | + * Returns a list of tags in an Amazon Rekognition collection, stream |
| 3157 | + * processor, or Custom Labels model. |
| 3158 | + * </p> |
| 3159 | + * |
| 3160 | + * @param listTagsForResourceRequest |
| 3161 | + * @return listTagsForResourceResult The response from the |
| 3162 | + * ListTagsForResource service method, as returned by Amazon |
| 3163 | + * Rekognition. |
| 3164 | + * @throws ResourceNotFoundException |
| 3165 | + * @throws InvalidParameterException |
| 3166 | + * @throws AccessDeniedException |
| 3167 | + * @throws InternalServerErrorException |
| 3168 | + * @throws ThrottlingException |
| 3169 | + * @throws ProvisionedThroughputExceededException |
| 3170 | + * @throws AmazonClientException If any internal errors are encountered |
| 3171 | + * inside the client while attempting to make the request or |
| 3172 | + * handle the response. For example if a network connection is |
| 3173 | + * not available. |
| 3174 | + * @throws AmazonServiceException If an error response is returned by Amazon |
| 3175 | + * Rekognition indicating either a problem with the data in the |
| 3176 | + * request, or a server side issue. |
| 3177 | + */ |
| 3178 | + public ListTagsForResourceResult listTagsForResource( |
| 3179 | + ListTagsForResourceRequest listTagsForResourceRequest) |
| 3180 | + throws AmazonServiceException, AmazonClientException { |
| 3181 | + ExecutionContext executionContext = createExecutionContext(listTagsForResourceRequest); |
| 3182 | + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
| 3183 | + awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
| 3184 | + Request<ListTagsForResourceRequest> request = null; |
| 3185 | + Response<ListTagsForResourceResult> response = null; |
| 3186 | + try { |
| 3187 | + awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
| 3188 | + try { |
| 3189 | + request = new ListTagsForResourceRequestMarshaller() |
| 3190 | + .marshall(listTagsForResourceRequest); |
| 3191 | + // Binds the request metrics to the current request. |
| 3192 | + request.setAWSRequestMetrics(awsRequestMetrics); |
| 3193 | + } finally { |
| 3194 | + awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
| 3195 | + } |
| 3196 | + Unmarshaller<ListTagsForResourceResult, JsonUnmarshallerContext> unmarshaller = new ListTagsForResourceResultJsonUnmarshaller(); |
| 3197 | + JsonResponseHandler<ListTagsForResourceResult> responseHandler = new JsonResponseHandler<ListTagsForResourceResult>( |
| 3198 | + unmarshaller); |
| 3199 | + |
| 3200 | + response = invoke(request, responseHandler, executionContext); |
| 3201 | + |
| 3202 | + return response.getAwsResponse(); |
| 3203 | + } finally { |
| 3204 | + awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
| 3205 | + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
| 3206 | + } |
| 3207 | + } |
| 3208 | + |
3140 | 3209 | /** |
3141 | 3210 | * <p> |
3142 | 3211 | * Returns an array of celebrities recognized in the input image. For more |
@@ -4270,6 +4339,113 @@ public StopStreamProcessorResult stopStreamProcessor( |
4270 | 4339 | } |
4271 | 4340 | } |
4272 | 4341 |
|
| 4342 | + /** |
| 4343 | + * <p> |
| 4344 | + * Adds one or more key-value tags to an Amazon Rekognition collection, |
| 4345 | + * stream processor, or Custom Labels model. For more information, see <a |
| 4346 | + * href="https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html"> |
| 4347 | + * Tagging AWS Resources</a>. |
| 4348 | + * </p> |
| 4349 | + * |
| 4350 | + * @param tagResourceRequest |
| 4351 | + * @return tagResourceResult The response from the TagResource service |
| 4352 | + * method, as returned by Amazon Rekognition. |
| 4353 | + * @throws ResourceNotFoundException |
| 4354 | + * @throws InvalidParameterException |
| 4355 | + * @throws ServiceQuotaExceededException |
| 4356 | + * @throws AccessDeniedException |
| 4357 | + * @throws InternalServerErrorException |
| 4358 | + * @throws ThrottlingException |
| 4359 | + * @throws ProvisionedThroughputExceededException |
| 4360 | + * @throws AmazonClientException If any internal errors are encountered |
| 4361 | + * inside the client while attempting to make the request or |
| 4362 | + * handle the response. For example if a network connection is |
| 4363 | + * not available. |
| 4364 | + * @throws AmazonServiceException If an error response is returned by Amazon |
| 4365 | + * Rekognition indicating either a problem with the data in the |
| 4366 | + * request, or a server side issue. |
| 4367 | + */ |
| 4368 | + public TagResourceResult tagResource(TagResourceRequest tagResourceRequest) |
| 4369 | + throws AmazonServiceException, AmazonClientException { |
| 4370 | + ExecutionContext executionContext = createExecutionContext(tagResourceRequest); |
| 4371 | + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
| 4372 | + awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
| 4373 | + Request<TagResourceRequest> request = null; |
| 4374 | + Response<TagResourceResult> response = null; |
| 4375 | + try { |
| 4376 | + awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
| 4377 | + try { |
| 4378 | + request = new TagResourceRequestMarshaller().marshall(tagResourceRequest); |
| 4379 | + // Binds the request metrics to the current request. |
| 4380 | + request.setAWSRequestMetrics(awsRequestMetrics); |
| 4381 | + } finally { |
| 4382 | + awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
| 4383 | + } |
| 4384 | + Unmarshaller<TagResourceResult, JsonUnmarshallerContext> unmarshaller = new TagResourceResultJsonUnmarshaller(); |
| 4385 | + JsonResponseHandler<TagResourceResult> responseHandler = new JsonResponseHandler<TagResourceResult>( |
| 4386 | + unmarshaller); |
| 4387 | + |
| 4388 | + response = invoke(request, responseHandler, executionContext); |
| 4389 | + |
| 4390 | + return response.getAwsResponse(); |
| 4391 | + } finally { |
| 4392 | + awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
| 4393 | + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
| 4394 | + } |
| 4395 | + } |
| 4396 | + |
| 4397 | + /** |
| 4398 | + * <p> |
| 4399 | + * Removes one or more tags from an Amazon Rekognition collection, stream |
| 4400 | + * processor, or Custom Labels model. |
| 4401 | + * </p> |
| 4402 | + * |
| 4403 | + * @param untagResourceRequest |
| 4404 | + * @return untagResourceResult The response from the UntagResource service |
| 4405 | + * method, as returned by Amazon Rekognition. |
| 4406 | + * @throws ResourceNotFoundException |
| 4407 | + * @throws InvalidParameterException |
| 4408 | + * @throws AccessDeniedException |
| 4409 | + * @throws InternalServerErrorException |
| 4410 | + * @throws ThrottlingException |
| 4411 | + * @throws ProvisionedThroughputExceededException |
| 4412 | + * @throws AmazonClientException If any internal errors are encountered |
| 4413 | + * inside the client while attempting to make the request or |
| 4414 | + * handle the response. For example if a network connection is |
| 4415 | + * not available. |
| 4416 | + * @throws AmazonServiceException If an error response is returned by Amazon |
| 4417 | + * Rekognition indicating either a problem with the data in the |
| 4418 | + * request, or a server side issue. |
| 4419 | + */ |
| 4420 | + public UntagResourceResult untagResource(UntagResourceRequest untagResourceRequest) |
| 4421 | + throws AmazonServiceException, AmazonClientException { |
| 4422 | + ExecutionContext executionContext = createExecutionContext(untagResourceRequest); |
| 4423 | + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); |
| 4424 | + awsRequestMetrics.startEvent(Field.ClientExecuteTime); |
| 4425 | + Request<UntagResourceRequest> request = null; |
| 4426 | + Response<UntagResourceResult> response = null; |
| 4427 | + try { |
| 4428 | + awsRequestMetrics.startEvent(Field.RequestMarshallTime); |
| 4429 | + try { |
| 4430 | + request = new UntagResourceRequestMarshaller().marshall(untagResourceRequest); |
| 4431 | + // Binds the request metrics to the current request. |
| 4432 | + request.setAWSRequestMetrics(awsRequestMetrics); |
| 4433 | + } finally { |
| 4434 | + awsRequestMetrics.endEvent(Field.RequestMarshallTime); |
| 4435 | + } |
| 4436 | + Unmarshaller<UntagResourceResult, JsonUnmarshallerContext> unmarshaller = new UntagResourceResultJsonUnmarshaller(); |
| 4437 | + JsonResponseHandler<UntagResourceResult> responseHandler = new JsonResponseHandler<UntagResourceResult>( |
| 4438 | + unmarshaller); |
| 4439 | + |
| 4440 | + response = invoke(request, responseHandler, executionContext); |
| 4441 | + |
| 4442 | + return response.getAwsResponse(); |
| 4443 | + } finally { |
| 4444 | + awsRequestMetrics.endEvent(Field.ClientExecuteTime); |
| 4445 | + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); |
| 4446 | + } |
| 4447 | + } |
| 4448 | + |
4273 | 4449 | /** |
4274 | 4450 | * Returns additional metadata for a previously executed successful, |
4275 | 4451 | * request, typically used for debugging issues where a service isn't acting |
|
0 commit comments