diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java index 9fc3218cef..7aad56e9ea 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognition.java @@ -40,6 +40,13 @@ *
  • *

    * AssociateFaces + *

    + *
  • + *
  • + *

    + * CompareFaces *

    @@ -54,6 +61,13 @@ *
  • *

    * CreateUser + *

    + *
  • + *
  • + *

    + * DeleteCollection *

    @@ -68,6 +82,13 @@ *
  • *

    * DeleteUser + *

    + *
  • + *
  • + *

    + * DescribeCollection *

    @@ -110,6 +131,13 @@ *
  • *

    * DisassociateFaces + *

    + *
  • + *
  • + *

    + * GetCelebrityInfo *

    @@ -138,6 +166,13 @@ *
  • *

    * ListUsers + *

    + *
  • + *
  • + *

    + * RecognizeCelebrities *

    @@ -156,6 +191,20 @@ * >SearchFacesByImage *

    *
  • + *
  • + *

    + * SearchUsers + *

    + *
  • + *
  • + *

    + * SearchUsersByImage + *

    + *
  • * *

    * Amazon Rekognition Custom Labels @@ -534,6 +583,80 @@ public interface AmazonRekognition { */ public void setRegion(Region region) throws java.lang.IllegalArgumentException; + /** + *

    + * Associates one or more faces with an existing UserID. Takes an array of + * FaceIds. Each FaceId that are present in the + * FaceIds list is associated with the provided UserID. The + * maximum number of total FaceIds per UserID is 100. + *

    + *

    + * The UserMatchThreshold parameter specifies the minimum user + * match confidence required for the face to be associated with a UserID + * that has at least one FaceID already associated. This + * ensures that the FaceIds are associated with the right + * UserID. The value ranges from 0-100 and default value is 75. + *

    + *

    + * If successful, an array of AssociatedFace objects containing + * the associated FaceIds is returned. If a given face is + * already associated with the given UserID, it will be ignored + * and will not be returned in the response. If a given face is already + * associated to a different UserID, isn't found in the + * collection, doesn’t meet the UserMatchThreshold, or there + * are already 100 faces associated with the UserID, it will be + * returned as part of an array of + * UnsuccessfulFaceAssociations. + *

    + *

    + * The UserStatus reflects the status of an operation which + * updates a UserID representation with a list of given faces. The + * UserStatus can be: + *

    + * + * + * @param associateFacesRequest + * @return associateFacesResult The response from the AssociateFaces service + * method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + AssociateFacesResult associateFaces(AssociateFacesRequest associateFacesRequest) + throws AmazonClientException, AmazonServiceException; + /** *

    * Compares a face in the source input image with each of the 100 @@ -1040,6 +1163,45 @@ CreateStreamProcessorResult createStreamProcessor( CreateStreamProcessorRequest createStreamProcessorRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Creates a new User within a collection specified by + * CollectionId. Takes UserId as a parameter, + * which is a user provided ID which should be unique within the collection. + * The provided UserId will alias the system generated UUID to + * make the UserId more user friendly. + *

    + *

    + * Uses a ClientToken, an idempotency token that ensures a call + * to CreateUser completes only once. If the value is not + * supplied, the AWS SDK generates an idempotency token for the requests. + * This prevents retries after a network error results from making multiple + * CreateUser calls. + *

    + * + * @param createUserRequest + * @return createUserResult The response from the CreateUser service method, + * as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ConflictException + * @throws ResourceNotFoundException + * @throws ServiceQuotaExceededException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + CreateUserResult createUser(CreateUserRequest createUserRequest) throws AmazonClientException, + AmazonServiceException; + /** *

    * Deletes the specified collection. Note that this operation removes all @@ -1290,6 +1452,38 @@ DeleteStreamProcessorResult deleteStreamProcessor( DeleteStreamProcessorRequest deleteStreamProcessorRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Deletes the specified UserID within the collection. Faces that are + * associated with the UserID are disassociated from the UserID before + * deleting the specified UserID. If the specified Collection + * or UserID is already deleted or not found, a + * ResourceNotFoundException will be thrown. If the action is + * successful with a 200 response, an empty HTTP body is returned. + *

    + * + * @param deleteUserRequest + * @return deleteUserResult The response from the DeleteUser service method, + * as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ConflictException + * @throws ResourceNotFoundException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + DeleteUserResult deleteUser(DeleteUserRequest deleteUserRequest) throws AmazonClientException, + AmazonServiceException; + /** *

    * Describes the specified collection. You can use @@ -1993,6 +2187,41 @@ DetectProtectiveEquipmentResult detectProtectiveEquipment( DetectTextResult detectText(DetectTextRequest detectTextRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Removes the association between a Face supplied in an array + * of FaceIds and the User. If the User is not present already, + * then a ResourceNotFound exception is thrown. If successful, + * an array of faces that are disassociated from the User is returned. If a + * given face is already disassociated from the given UserID, it will be + * ignored and not be returned in the response. If a given face is already + * associated with a different User or not found in the collection it will + * be returned as part of UnsuccessfulDisassociations. You can + * remove 1 - 100 face IDs from a user at one time. + *

    + * + * @param disassociateFacesRequest + * @return disassociateFacesResult The response from the DisassociateFaces + * service method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + DisassociateFacesResult disassociateFaces(DisassociateFacesRequest disassociateFacesRequest) + throws AmazonClientException, AmazonServiceException; + /** *

    * Distributes the entries (images) in a training dataset across the @@ -3186,6 +3415,37 @@ ListTagsForResourceResult listTagsForResource( ListTagsForResourceRequest listTagsForResourceRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Returns metadata of the User such as UserID in the specified + * collection. Anonymous User (to reserve faces without any identity) is not + * returned as part of this request. The results are sorted by system + * generated primary key ID. If the response is truncated, + * NextToken is returned in the response that can be used in + * the subsequent request to retrieve the next set of identities. + *

    + * + * @param listUsersRequest + * @return listUsersResult The response from the ListUsers service method, + * as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws InvalidPaginationTokenException + * @throws ProvisionedThroughputExceededException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + ListUsersResult listUsers(ListUsersRequest listUsersRequest) throws AmazonClientException, + AmazonServiceException; + /** *

    * Attaches a project policy to a Amazon Rekognition Custom Labels project @@ -3451,6 +3711,80 @@ SearchFacesResult searchFaces(SearchFacesRequest searchFacesRequest) SearchFacesByImageResult searchFacesByImage(SearchFacesByImageRequest searchFacesByImageRequest) throws AmazonClientException, AmazonServiceException; + /** + *

    + * Searches for UserIDs within a collection based on a FaceId + * or UserId. This API can be used to find the closest UserID + * (with a highest similarity) to associate a face. The request must be + * provided with either FaceId or UserId. The + * operation returns an array of UserID that match the FaceId + * or UserId, ordered by similarity score with the highest + * similarity first. + *

    + * + * @param searchUsersRequest + * @return searchUsersResult The response from the SearchUsers service + * method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws ProvisionedThroughputExceededException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + SearchUsersResult searchUsers(SearchUsersRequest searchUsersRequest) + throws AmazonClientException, AmazonServiceException; + + /** + *

    + * Searches for UserIDs using a supplied image. It first detects the largest + * face in the image, and then searches a specified collection for matching + * UserIDs. + *

    + *

    + * The operation returns an array of UserIDs that match the face in the + * supplied image, ordered by similarity score with the highest similarity + * first. It also returns a bounding box for the face found in the input + * image. + *

    + *

    + * Information about faces detected in the supplied image, but not used for + * the search, is returned in an array of UnsearchedFace + * objects. If no valid face is detected in the image, the response will + * contain an empty UserMatches list and no + * SearchedFace object. + *

    + * + * @param searchUsersByImageRequest + * @return searchUsersByImageResult The response from the SearchUsersByImage + * service method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws InvalidImageFormatException + * @throws InvalidS3ObjectException + * @throws ImageTooLargeException + * @throws ProvisionedThroughputExceededException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + SearchUsersByImageResult searchUsersByImage(SearchUsersByImageRequest searchUsersByImageRequest) + throws AmazonClientException, AmazonServiceException; + /** *

    * Starts asynchronous recognition of celebrities in a stored video. diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java index 3d1d424e79..6c9b3ec554 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/AmazonRekognitionClient.java @@ -53,6 +53,13 @@ *

  • *

    * AssociateFaces + *

    + *
  • + *
  • + *

    + * CompareFaces *

    @@ -67,6 +74,13 @@ *
  • *

    * CreateUser + *

    + *
  • + *
  • + *

    + * DeleteCollection *

    @@ -81,6 +95,13 @@ *
  • *

    * DeleteUser + *

    + *
  • + *
  • + *

    + * DescribeCollection *

    @@ -123,6 +144,13 @@ *
  • *

    * DisassociateFaces + *

    + *
  • + *
  • + *

    + * GetCelebrityInfo *

    @@ -151,6 +179,13 @@ *
  • *

    * ListUsers + *

    + *
  • + *
  • + *

    + * RecognizeCelebrities *

    @@ -169,6 +204,20 @@ * >SearchFacesByImage *

    *
  • + *
  • + *

    + * SearchUsers + *

    + *
  • + *
  • + *

    + * SearchUsersByImage + *

    + *
  • * *

    * Amazon Rekognition Custom Labels @@ -774,6 +823,7 @@ public AmazonRekognitionClient(AWSCredentialsProvider awsCredentialsProvider, private void init() { jsonErrorUnmarshallers = new ArrayList(); jsonErrorUnmarshallers.add(new AccessDeniedExceptionUnmarshaller()); + jsonErrorUnmarshallers.add(new ConflictExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new HumanLoopQuotaExceededExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new IdempotentParameterMismatchExceptionUnmarshaller()); jsonErrorUnmarshallers.add(new ImageTooLargeExceptionUnmarshaller()); @@ -813,6 +863,106 @@ private static ClientConfiguration adjustClientConfiguration(ClientConfiguration return config; } + /** + *

    + * Associates one or more faces with an existing UserID. Takes an array of + * FaceIds. Each FaceId that are present in the + * FaceIds list is associated with the provided UserID. The + * maximum number of total FaceIds per UserID is 100. + *

    + *

    + * The UserMatchThreshold parameter specifies the minimum user + * match confidence required for the face to be associated with a UserID + * that has at least one FaceID already associated. This + * ensures that the FaceIds are associated with the right + * UserID. The value ranges from 0-100 and default value is 75. + *

    + *

    + * If successful, an array of AssociatedFace objects containing + * the associated FaceIds is returned. If a given face is + * already associated with the given UserID, it will be ignored + * and will not be returned in the response. If a given face is already + * associated to a different UserID, isn't found in the + * collection, doesn’t meet the UserMatchThreshold, or there + * are already 100 faces associated with the UserID, it will be + * returned as part of an array of + * UnsuccessfulFaceAssociations. + *

    + *

    + * The UserStatus reflects the status of an operation which + * updates a UserID representation with a list of given faces. The + * UserStatus can be: + *

    + * + * + * @param associateFacesRequest + * @return associateFacesResult The response from the AssociateFaces service + * method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws ServiceQuotaExceededException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public AssociateFacesResult associateFaces(AssociateFacesRequest associateFacesRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(associateFacesRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new AssociateFacesRequestMarshaller().marshall(associateFacesRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new AssociateFacesResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Compares a face in the source input image with each of the 100 @@ -1532,6 +1682,71 @@ public CreateStreamProcessorResult createStreamProcessor( } } + /** + *

    + * Creates a new User within a collection specified by + * CollectionId. Takes UserId as a parameter, + * which is a user provided ID which should be unique within the collection. + * The provided UserId will alias the system generated UUID to + * make the UserId more user friendly. + *

    + *

    + * Uses a ClientToken, an idempotency token that ensures a call + * to CreateUser completes only once. If the value is not + * supplied, the AWS SDK generates an idempotency token for the requests. + * This prevents retries after a network error results from making multiple + * CreateUser calls. + *

    + * + * @param createUserRequest + * @return createUserResult The response from the CreateUser service method, + * as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ConflictException + * @throws ResourceNotFoundException + * @throws ServiceQuotaExceededException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public CreateUserResult createUser(CreateUserRequest createUserRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(createUserRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new CreateUserRequestMarshaller().marshall(createUserRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new CreateUserResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Deletes the specified collection. Note that this operation removes all @@ -1967,6 +2182,64 @@ public DeleteStreamProcessorResult deleteStreamProcessor( } } + /** + *

    + * Deletes the specified UserID within the collection. Faces that are + * associated with the UserID are disassociated from the UserID before + * deleting the specified UserID. If the specified Collection + * or UserID is already deleted or not found, a + * ResourceNotFoundException will be thrown. If the action is + * successful with a 200 response, an empty HTTP body is returned. + *

    + * + * @param deleteUserRequest + * @return deleteUserResult The response from the DeleteUser service method, + * as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ConflictException + * @throws ResourceNotFoundException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public DeleteUserResult deleteUser(DeleteUserRequest deleteUserRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(deleteUserRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DeleteUserRequestMarshaller().marshall(deleteUserRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DeleteUserResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Describes the specified collection. You can use @@ -2964,6 +3237,69 @@ public DetectTextResult detectText(DetectTextRequest detectTextRequest) } } + /** + *

    + * Removes the association between a Face supplied in an array + * of FaceIds and the User. If the User is not present already, + * then a ResourceNotFound exception is thrown. If successful, + * an array of faces that are disassociated from the User is returned. If a + * given face is already disassociated from the given UserID, it will be + * ignored and not be returned in the response. If a given face is already + * associated with a different User or not found in the collection it will + * be returned as part of UnsuccessfulDisassociations. You can + * remove 1 - 100 face IDs from a user at one time. + *

    + * + * @param disassociateFacesRequest + * @return disassociateFacesResult The response from the DisassociateFaces + * service method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws ProvisionedThroughputExceededException + * @throws IdempotentParameterMismatchException + * @throws ResourceNotFoundException + * @throws ConflictException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public DisassociateFacesResult disassociateFaces( + DisassociateFacesRequest disassociateFacesRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(disassociateFacesRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new DisassociateFacesRequestMarshaller() + .marshall(disassociateFacesRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new DisassociateFacesResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Distributes the entries (images) in a training dataset across the @@ -4667,6 +5003,63 @@ public ListTagsForResourceResult listTagsForResource( } } + /** + *

    + * Returns metadata of the User such as UserID in the specified + * collection. Anonymous User (to reserve faces without any identity) is not + * returned as part of this request. The results are sorted by system + * generated primary key ID. If the response is truncated, + * NextToken is returned in the response that can be used in + * the subsequent request to retrieve the next set of identities. + *

    + * + * @param listUsersRequest + * @return listUsersResult The response from the ListUsers service method, + * as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws InvalidPaginationTokenException + * @throws ProvisionedThroughputExceededException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public ListUsersResult listUsers(ListUsersRequest listUsersRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(listUsersRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new ListUsersRequestMarshaller().marshall(listUsersRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new ListUsersResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Attaches a project policy to a Amazon Rekognition Custom Labels project @@ -5039,6 +5432,134 @@ public SearchFacesByImageResult searchFacesByImage( } } + /** + *

    + * Searches for UserIDs within a collection based on a FaceId + * or UserId. This API can be used to find the closest UserID + * (with a highest similarity) to associate a face. The request must be + * provided with either FaceId or UserId. The + * operation returns an array of UserID that match the FaceId + * or UserId, ordered by similarity score with the highest + * similarity first. + *

    + * + * @param searchUsersRequest + * @return searchUsersResult The response from the SearchUsers service + * method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws ProvisionedThroughputExceededException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public SearchUsersResult searchUsers(SearchUsersRequest searchUsersRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(searchUsersRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new SearchUsersRequestMarshaller().marshall(searchUsersRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new SearchUsersResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + + /** + *

    + * Searches for UserIDs using a supplied image. It first detects the largest + * face in the image, and then searches a specified collection for matching + * UserIDs. + *

    + *

    + * The operation returns an array of UserIDs that match the face in the + * supplied image, ordered by similarity score with the highest similarity + * first. It also returns a bounding box for the face found in the input + * image. + *

    + *

    + * Information about faces detected in the supplied image, but not used for + * the search, is returned in an array of UnsearchedFace + * objects. If no valid face is detected in the image, the response will + * contain an empty UserMatches list and no + * SearchedFace object. + *

    + * + * @param searchUsersByImageRequest + * @return searchUsersByImageResult The response from the SearchUsersByImage + * service method, as returned by Amazon Rekognition. + * @throws InvalidParameterException + * @throws ResourceNotFoundException + * @throws InvalidImageFormatException + * @throws InvalidS3ObjectException + * @throws ImageTooLargeException + * @throws ProvisionedThroughputExceededException + * @throws AccessDeniedException + * @throws InternalServerErrorException + * @throws ThrottlingException + * @throws AmazonClientException If any internal errors are encountered + * inside the client while attempting to make the request or + * handle the response. For example if a network connection is + * not available. + * @throws AmazonServiceException If an error response is returned by Amazon + * Rekognition indicating either a problem with the data in the + * request, or a server side issue. + */ + public SearchUsersByImageResult searchUsersByImage( + SearchUsersByImageRequest searchUsersByImageRequest) + throws AmazonServiceException, AmazonClientException { + ExecutionContext executionContext = createExecutionContext(searchUsersByImageRequest); + AWSRequestMetrics awsRequestMetrics = executionContext.getAwsRequestMetrics(); + awsRequestMetrics.startEvent(Field.ClientExecuteTime); + Request request = null; + Response response = null; + try { + awsRequestMetrics.startEvent(Field.RequestMarshallTime); + try { + request = new SearchUsersByImageRequestMarshaller() + .marshall(searchUsersByImageRequest); + // Binds the request metrics to the current request. + request.setAWSRequestMetrics(awsRequestMetrics); + } finally { + awsRequestMetrics.endEvent(Field.RequestMarshallTime); + } + Unmarshaller unmarshaller = new SearchUsersByImageResultJsonUnmarshaller(); + JsonResponseHandler responseHandler = new JsonResponseHandler( + unmarshaller); + + response = invoke(request, responseHandler, executionContext); + + return response.getAwsResponse(); + } finally { + awsRequestMetrics.endEvent(Field.ClientExecuteTime); + endClientExecution(awsRequestMetrics, request, response, LOGGING_AWS_REQUEST_METRIC); + } + } + /** *

    * Starts asynchronous recognition of celebrities in a stored video. diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociateFacesRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociateFacesRequest.java new file mode 100644 index 0000000000..ed8cf344d1 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociateFacesRequest.java @@ -0,0 +1,533 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Associates one or more faces with an existing UserID. Takes an array of + * FaceIds. Each FaceId that are present in the + * FaceIds list is associated with the provided UserID. The maximum + * number of total FaceIds per UserID is 100. + *

    + *

    + * The UserMatchThreshold parameter specifies the minimum user + * match confidence required for the face to be associated with a UserID that + * has at least one FaceID already associated. This ensures that + * the FaceIds are associated with the right UserID. The value + * ranges from 0-100 and default value is 75. + *

    + *

    + * If successful, an array of AssociatedFace objects containing the + * associated FaceIds is returned. If a given face is already + * associated with the given UserID, it will be ignored and will + * not be returned in the response. If a given face is already associated to a + * different UserID, isn't found in the collection, doesn’t meet + * the UserMatchThreshold, or there are already 100 faces + * associated with the UserID, it will be returned as part of an + * array of UnsuccessfulFaceAssociations. + *

    + *

    + * The UserStatus reflects the status of an operation which updates + * a UserID representation with a list of given faces. The + * UserStatus can be: + *

    + *
      + *
    • + *

      + * ACTIVE - All associations or disassociations of FaceID(s) for a UserID are + * complete. + *

      + *
    • + *
    • + *

      + * CREATED - A UserID has been created, but has no FaceID(s) associated with it. + *

      + *
    • + *
    • + *

      + * UPDATING - A UserID is being updated and there are current associations or + * disassociations of FaceID(s) taking place. + *

      + *
    • + *
    + */ +public class AssociateFacesRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * The ID for the existing UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * An array of FaceIDs to associate with the UserID. + *

    + */ + private java.util.List faceIds; + + /** + *

    + * An optional value specifying the minimum confidence in the UserID match + * to return. The default value is 75. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + */ + private Float userMatchThreshold; + + /** + *

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with multiple + * AssociateFaces requests, the same response is returned. Use + * ClientRequestToken to prevent the same request from being processed more + * than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + */ + private String clientRequestToken; + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection containing the UserID. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * The ID for the existing UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * The ID for the existing UserID. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * The ID for the existing UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * The ID for the existing UserID. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * The ID for the existing UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * The ID for the existing UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesRequest withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * An array of FaceIDs to associate with the UserID. + *

    + * + * @return

    + * An array of FaceIDs to associate with the UserID. + *

    + */ + public java.util.List getFaceIds() { + return faceIds; + } + + /** + *

    + * An array of FaceIDs to associate with the UserID. + *

    + * + * @param faceIds

    + * An array of FaceIDs to associate with the UserID. + *

    + */ + public void setFaceIds(java.util.Collection faceIds) { + if (faceIds == null) { + this.faceIds = null; + return; + } + + this.faceIds = new java.util.ArrayList(faceIds); + } + + /** + *

    + * An array of FaceIDs to associate with the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceIds

    + * An array of FaceIDs to associate with the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesRequest withFaceIds(String... faceIds) { + if (getFaceIds() == null) { + this.faceIds = new java.util.ArrayList(faceIds.length); + } + for (String value : faceIds) { + this.faceIds.add(value); + } + return this; + } + + /** + *

    + * An array of FaceIDs to associate with the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceIds

    + * An array of FaceIDs to associate with the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesRequest withFaceIds(java.util.Collection faceIds) { + setFaceIds(faceIds); + return this; + } + + /** + *

    + * An optional value specifying the minimum confidence in the UserID match + * to return. The default value is 75. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @return

    + * An optional value specifying the minimum confidence in the UserID + * match to return. The default value is 75. + *

    + */ + public Float getUserMatchThreshold() { + return userMatchThreshold; + } + + /** + *

    + * An optional value specifying the minimum confidence in the UserID match + * to return. The default value is 75. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param userMatchThreshold

    + * An optional value specifying the minimum confidence in the + * UserID match to return. The default value is 75. + *

    + */ + public void setUserMatchThreshold(Float userMatchThreshold) { + this.userMatchThreshold = userMatchThreshold; + } + + /** + *

    + * An optional value specifying the minimum confidence in the UserID match + * to return. The default value is 75. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param userMatchThreshold

    + * An optional value specifying the minimum confidence in the + * UserID match to return. The default value is 75. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesRequest withUserMatchThreshold(Float userMatchThreshold) { + this.userMatchThreshold = userMatchThreshold; + return this; + } + + /** + *

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with multiple + * AssociateFaces requests, the same response is returned. Use + * ClientRequestToken to prevent the same request from being processed more + * than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @return

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with + * multiple AssociateFaces requests, the same response + * is returned. Use ClientRequestToken to prevent the same request + * from being processed more than once. + *

    + */ + public String getClientRequestToken() { + return clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with multiple + * AssociateFaces requests, the same response is returned. Use + * ClientRequestToken to prevent the same request from being processed more + * than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with + * multiple AssociateFaces requests, the same + * response is returned. Use ClientRequestToken to prevent the + * same request from being processed more than once. + *

    + */ + public void setClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with multiple + * AssociateFaces requests, the same response is returned. Use + * ClientRequestToken to prevent the same request from being processed more + * than once. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * AssociateFaces. If you use the same token with + * multiple AssociateFaces requests, the same + * response is returned. Use ClientRequestToken to prevent the + * same request from being processed more than once. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesRequest withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getFaceIds() != null) + sb.append("FaceIds: " + getFaceIds() + ","); + if (getUserMatchThreshold() != null) + sb.append("UserMatchThreshold: " + getUserMatchThreshold() + ","); + if (getClientRequestToken() != null) + sb.append("ClientRequestToken: " + getClientRequestToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getFaceIds() == null) ? 0 : getFaceIds().hashCode()); + hashCode = prime * hashCode + + ((getUserMatchThreshold() == null) ? 0 : getUserMatchThreshold().hashCode()); + hashCode = prime * hashCode + + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AssociateFacesRequest == false) + return false; + AssociateFacesRequest other = (AssociateFacesRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getFaceIds() == null ^ this.getFaceIds() == null) + return false; + if (other.getFaceIds() != null && other.getFaceIds().equals(this.getFaceIds()) == false) + return false; + if (other.getUserMatchThreshold() == null ^ this.getUserMatchThreshold() == null) + return false; + if (other.getUserMatchThreshold() != null + && other.getUserMatchThreshold().equals(this.getUserMatchThreshold()) == false) + return false; + if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) + return false; + if (other.getClientRequestToken() != null + && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociateFacesResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociateFacesResult.java new file mode 100644 index 0000000000..f57f5802a8 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociateFacesResult.java @@ -0,0 +1,409 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class AssociateFacesResult implements Serializable { + /** + *

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned if the + * AssociateFaces action is successful. + *

    + */ + private java.util.List associatedFaces; + + /** + *

    + * An array of UnsuccessfulAssociation objects containing FaceIDs that are + * not successfully associated along with the reasons. Returned if the + * AssociateFaces action is successful. + *

    + */ + private java.util.List unsuccessfulFaceAssociations; + + /** + *

    + * The status of an update made to a UserID. Reflects if the UserID has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + */ + private String userStatus; + + /** + *

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned if the + * AssociateFaces action is successful. + *

    + * + * @return

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned if + * the AssociateFaces action is successful. + *

    + */ + public java.util.List getAssociatedFaces() { + return associatedFaces; + } + + /** + *

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned if the + * AssociateFaces action is successful. + *

    + * + * @param associatedFaces

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned + * if the AssociateFaces action is successful. + *

    + */ + public void setAssociatedFaces(java.util.Collection associatedFaces) { + if (associatedFaces == null) { + this.associatedFaces = null; + return; + } + + this.associatedFaces = new java.util.ArrayList(associatedFaces); + } + + /** + *

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned if the + * AssociateFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param associatedFaces

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned + * if the AssociateFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesResult withAssociatedFaces(AssociatedFace... associatedFaces) { + if (getAssociatedFaces() == null) { + this.associatedFaces = new java.util.ArrayList(associatedFaces.length); + } + for (AssociatedFace value : associatedFaces) { + this.associatedFaces.add(value); + } + return this; + } + + /** + *

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned if the + * AssociateFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param associatedFaces

    + * An array of AssociatedFace objects containing FaceIDs that are + * successfully associated with the UserID is returned. Returned + * if the AssociateFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesResult withAssociatedFaces( + java.util.Collection associatedFaces) { + setAssociatedFaces(associatedFaces); + return this; + } + + /** + *

    + * An array of UnsuccessfulAssociation objects containing FaceIDs that are + * not successfully associated along with the reasons. Returned if the + * AssociateFaces action is successful. + *

    + * + * @return

    + * An array of UnsuccessfulAssociation objects containing FaceIDs + * that are not successfully associated along with the reasons. + * Returned if the AssociateFaces action is successful. + *

    + */ + public java.util.List getUnsuccessfulFaceAssociations() { + return unsuccessfulFaceAssociations; + } + + /** + *

    + * An array of UnsuccessfulAssociation objects containing FaceIDs that are + * not successfully associated along with the reasons. Returned if the + * AssociateFaces action is successful. + *

    + * + * @param unsuccessfulFaceAssociations

    + * An array of UnsuccessfulAssociation objects containing FaceIDs + * that are not successfully associated along with the reasons. + * Returned if the AssociateFaces action is successful. + *

    + */ + public void setUnsuccessfulFaceAssociations( + java.util.Collection unsuccessfulFaceAssociations) { + if (unsuccessfulFaceAssociations == null) { + this.unsuccessfulFaceAssociations = null; + return; + } + + this.unsuccessfulFaceAssociations = new java.util.ArrayList( + unsuccessfulFaceAssociations); + } + + /** + *

    + * An array of UnsuccessfulAssociation objects containing FaceIDs that are + * not successfully associated along with the reasons. Returned if the + * AssociateFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsuccessfulFaceAssociations

    + * An array of UnsuccessfulAssociation objects containing FaceIDs + * that are not successfully associated along with the reasons. + * Returned if the AssociateFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesResult withUnsuccessfulFaceAssociations( + UnsuccessfulFaceAssociation... unsuccessfulFaceAssociations) { + if (getUnsuccessfulFaceAssociations() == null) { + this.unsuccessfulFaceAssociations = new java.util.ArrayList( + unsuccessfulFaceAssociations.length); + } + for (UnsuccessfulFaceAssociation value : unsuccessfulFaceAssociations) { + this.unsuccessfulFaceAssociations.add(value); + } + return this; + } + + /** + *

    + * An array of UnsuccessfulAssociation objects containing FaceIDs that are + * not successfully associated along with the reasons. Returned if the + * AssociateFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsuccessfulFaceAssociations

    + * An array of UnsuccessfulAssociation objects containing FaceIDs + * that are not successfully associated along with the reasons. + * Returned if the AssociateFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociateFacesResult withUnsuccessfulFaceAssociations( + java.util.Collection unsuccessfulFaceAssociations) { + setUnsuccessfulFaceAssociations(unsuccessfulFaceAssociations); + return this; + } + + /** + *

    + * The status of an update made to a UserID. Reflects if the UserID has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @return

    + * The status of an update made to a UserID. Reflects if the UserID + * has been updated for every requested change. + *

    + * @see UserStatus + */ + public String getUserStatus() { + return userStatus; + } + + /** + *

    + * The status of an update made to a UserID. Reflects if the UserID has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a UserID. Reflects if the + * UserID has been updated for every requested change. + *

    + * @see UserStatus + */ + public void setUserStatus(String userStatus) { + this.userStatus = userStatus; + } + + /** + *

    + * The status of an update made to a UserID. Reflects if the UserID has been + * updated for every requested change. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a UserID. Reflects if the + * UserID has been updated for every requested change. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public AssociateFacesResult withUserStatus(String userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + *

    + * The status of an update made to a UserID. Reflects if the UserID has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a UserID. Reflects if the + * UserID has been updated for every requested change. + *

    + * @see UserStatus + */ + public void setUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + } + + /** + *

    + * The status of an update made to a UserID. Reflects if the UserID has been + * updated for every requested change. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a UserID. Reflects if the + * UserID has been updated for every requested change. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public AssociateFacesResult withUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getAssociatedFaces() != null) + sb.append("AssociatedFaces: " + getAssociatedFaces() + ","); + if (getUnsuccessfulFaceAssociations() != null) + sb.append("UnsuccessfulFaceAssociations: " + getUnsuccessfulFaceAssociations() + ","); + if (getUserStatus() != null) + sb.append("UserStatus: " + getUserStatus()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getAssociatedFaces() == null) ? 0 : getAssociatedFaces().hashCode()); + hashCode = prime + * hashCode + + ((getUnsuccessfulFaceAssociations() == null) ? 0 + : getUnsuccessfulFaceAssociations().hashCode()); + hashCode = prime * hashCode + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AssociateFacesResult == false) + return false; + AssociateFacesResult other = (AssociateFacesResult) obj; + + if (other.getAssociatedFaces() == null ^ this.getAssociatedFaces() == null) + return false; + if (other.getAssociatedFaces() != null + && other.getAssociatedFaces().equals(this.getAssociatedFaces()) == false) + return false; + if (other.getUnsuccessfulFaceAssociations() == null + ^ this.getUnsuccessfulFaceAssociations() == null) + return false; + if (other.getUnsuccessfulFaceAssociations() != null + && other.getUnsuccessfulFaceAssociations().equals( + this.getUnsuccessfulFaceAssociations()) == false) + return false; + if (other.getUserStatus() == null ^ this.getUserStatus() == null) + return false; + if (other.getUserStatus() != null + && other.getUserStatus().equals(this.getUserStatus()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociatedFace.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociatedFace.java new file mode 100644 index 0000000000..b9bd9c5478 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/AssociatedFace.java @@ -0,0 +1,138 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Provides face metadata for the faces that are associated to a specific + * UserID. + *

    + */ +public class AssociatedFace implements Serializable { + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * Unique identifier assigned to the face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * Unique identifier assigned to the face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * Unique identifier assigned to the face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public AssociatedFace withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof AssociatedFace == false) + return false; + AssociatedFace other = (AssociatedFace) obj; + + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ConflictException.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ConflictException.java new file mode 100644 index 0000000000..959c1cdc30 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ConflictException.java @@ -0,0 +1,37 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import com.amazonaws.AmazonServiceException; + +/** + *

    + * A User with the same Id already exists within the collection, or the update + * or deletion of the User caused an inconsistent state. ** + *

    + */ +public class ConflictException extends AmazonServiceException { + private static final long serialVersionUID = 1L; + + /** + * Constructs a new ConflictException with the specified error message. + * + * @param message Describes the error encountered. + */ + public ConflictException(String message) { + super(message); + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateUserRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateUserRequest.java new file mode 100644 index 0000000000..3149d9c6c5 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateUserRequest.java @@ -0,0 +1,342 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Creates a new User within a collection specified by CollectionId + * . Takes UserId as a parameter, which is a user provided ID which + * should be unique within the collection. The provided UserId will + * alias the system generated UUID to make the UserId more user + * friendly. + *

    + *

    + * Uses a ClientToken, an idempotency token that ensures a call to + * CreateUser completes only once. If the value is not supplied, + * the AWS SDK generates an idempotency token for the requests. This prevents + * retries after a network error results from making multiple + * CreateUser calls. + *

    + */ +public class CreateUserRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection to which the new UserID needs to be + * created. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * ID for the UserID to be created. This ID needs to be unique within the + * collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * Idempotent token used to identify the request to CreateUser. + * If you use the same token with multiple CreateUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + */ + private String clientRequestToken; + + /** + *

    + * The ID of an existing collection to which the new UserID needs to be + * created. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection to which the new UserID needs to + * be created. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection to which the new UserID needs to be + * created. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection to which the new UserID needs + * to be created. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection to which the new UserID needs to be + * created. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection to which the new UserID needs + * to be created. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateUserRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * ID for the UserID to be created. This ID needs to be unique within the + * collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * ID for the UserID to be created. This ID needs to be unique + * within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * ID for the UserID to be created. This ID needs to be unique within the + * collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the UserID to be created. This ID needs to be unique + * within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * ID for the UserID to be created. This ID needs to be unique within the + * collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the UserID to be created. This ID needs to be unique + * within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateUserRequest withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * Idempotent token used to identify the request to CreateUser. + * If you use the same token with multiple CreateUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @return

    + * Idempotent token used to identify the request to + * CreateUser. If you use the same token with multiple + * CreateUser requests, the same response is returned. + * Use ClientRequestToken to prevent the same request from being + * processed more than once. + *

    + */ + public String getClientRequestToken() { + return clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to CreateUser. + * If you use the same token with multiple CreateUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * CreateUser. If you use the same token with + * multiple CreateUser requests, the same response + * is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + */ + public void setClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to CreateUser. + * If you use the same token with multiple CreateUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * CreateUser. If you use the same token with + * multiple CreateUser requests, the same response + * is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public CreateUserRequest withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getClientRequestToken() != null) + sb.append("ClientRequestToken: " + getClientRequestToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateUserRequest == false) + return false; + CreateUserRequest other = (CreateUserRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) + return false; + if (other.getClientRequestToken() != null + && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateUserResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateUserResult.java new file mode 100644 index 0000000000..aa00216066 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/CreateUserResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class CreateUserResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof CreateUserResult == false) + return false; + CreateUserResult other = (CreateUserResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteFacesResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteFacesResult.java index 96ee18ba54..513db054e2 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteFacesResult.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteFacesResult.java @@ -25,6 +25,13 @@ public class DeleteFacesResult implements Serializable { */ private java.util.List deletedFaces; + /** + *

    + * An array of any faces that weren't deleted. + *

    + */ + private java.util.List unsuccessfulFaceDeletions; + /** *

    * An array of strings (face IDs) of the faces that were deleted. @@ -99,6 +106,85 @@ public DeleteFacesResult withDeletedFaces(java.util.Collection deletedFa return this; } + /** + *

    + * An array of any faces that weren't deleted. + *

    + * + * @return

    + * An array of any faces that weren't deleted. + *

    + */ + public java.util.List getUnsuccessfulFaceDeletions() { + return unsuccessfulFaceDeletions; + } + + /** + *

    + * An array of any faces that weren't deleted. + *

    + * + * @param unsuccessfulFaceDeletions

    + * An array of any faces that weren't deleted. + *

    + */ + public void setUnsuccessfulFaceDeletions( + java.util.Collection unsuccessfulFaceDeletions) { + if (unsuccessfulFaceDeletions == null) { + this.unsuccessfulFaceDeletions = null; + return; + } + + this.unsuccessfulFaceDeletions = new java.util.ArrayList( + unsuccessfulFaceDeletions); + } + + /** + *

    + * An array of any faces that weren't deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsuccessfulFaceDeletions

    + * An array of any faces that weren't deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteFacesResult withUnsuccessfulFaceDeletions( + UnsuccessfulFaceDeletion... unsuccessfulFaceDeletions) { + if (getUnsuccessfulFaceDeletions() == null) { + this.unsuccessfulFaceDeletions = new java.util.ArrayList( + unsuccessfulFaceDeletions.length); + } + for (UnsuccessfulFaceDeletion value : unsuccessfulFaceDeletions) { + this.unsuccessfulFaceDeletions.add(value); + } + return this; + } + + /** + *

    + * An array of any faces that weren't deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsuccessfulFaceDeletions

    + * An array of any faces that weren't deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteFacesResult withUnsuccessfulFaceDeletions( + java.util.Collection unsuccessfulFaceDeletions) { + setUnsuccessfulFaceDeletions(unsuccessfulFaceDeletions); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -111,7 +197,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getDeletedFaces() != null) - sb.append("DeletedFaces: " + getDeletedFaces()); + sb.append("DeletedFaces: " + getDeletedFaces() + ","); + if (getUnsuccessfulFaceDeletions() != null) + sb.append("UnsuccessfulFaceDeletions: " + getUnsuccessfulFaceDeletions()); sb.append("}"); return sb.toString(); } @@ -123,6 +211,10 @@ public int hashCode() { hashCode = prime * hashCode + ((getDeletedFaces() == null) ? 0 : getDeletedFaces().hashCode()); + hashCode = prime + * hashCode + + ((getUnsuccessfulFaceDeletions() == null) ? 0 : getUnsuccessfulFaceDeletions() + .hashCode()); return hashCode; } @@ -142,6 +234,12 @@ public boolean equals(Object obj) { if (other.getDeletedFaces() != null && other.getDeletedFaces().equals(this.getDeletedFaces()) == false) return false; + if (other.getUnsuccessfulFaceDeletions() == null + ^ this.getUnsuccessfulFaceDeletions() == null) + return false; + if (other.getUnsuccessfulFaceDeletions() != null + && other.getUnsuccessfulFaceDeletions().equals(this.getUnsuccessfulFaceDeletions()) == false) + return false; return true; } } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteUserRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteUserRequest.java new file mode 100644 index 0000000000..6603b15855 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteUserRequest.java @@ -0,0 +1,329 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Deletes the specified UserID within the collection. Faces that are associated + * with the UserID are disassociated from the UserID before deleting the + * specified UserID. If the specified Collection or + * UserID is already deleted or not found, a + * ResourceNotFoundException will be thrown. If the action is + * successful with a 200 response, an empty HTTP body is returned. + *

    + */ +public class DeleteUserRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection from which the UserID needs to be + * deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * ID for the UserID to be deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * Idempotent token used to identify the request to DeleteUser. + * If you use the same token with multiple DeleteUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + */ + private String clientRequestToken; + + /** + *

    + * The ID of an existing collection from which the UserID needs to be + * deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection from which the UserID needs to + * be deleted. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection from which the UserID needs to be + * deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection from which the UserID needs + * to be deleted. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection from which the UserID needs to be + * deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection from which the UserID needs + * to be deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteUserRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * ID for the UserID to be deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * ID for the UserID to be deleted. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * ID for the UserID to be deleted. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the UserID to be deleted. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * ID for the UserID to be deleted. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the UserID to be deleted. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteUserRequest withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * Idempotent token used to identify the request to DeleteUser. + * If you use the same token with multiple DeleteUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @return

    + * Idempotent token used to identify the request to + * DeleteUser. If you use the same token with multiple + * DeleteUser requests, the same response is returned. + * Use ClientRequestToken to prevent the same request from being + * processed more than once. + *

    + */ + public String getClientRequestToken() { + return clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to DeleteUser. + * If you use the same token with multiple DeleteUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * DeleteUser. If you use the same token with + * multiple DeleteUser requests, the same response + * is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + */ + public void setClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to DeleteUser. + * If you use the same token with multiple DeleteUser requests, + * the same response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * DeleteUser. If you use the same token with + * multiple DeleteUser requests, the same response + * is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DeleteUserRequest withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getClientRequestToken() != null) + sb.append("ClientRequestToken: " + getClientRequestToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteUserRequest == false) + return false; + DeleteUserRequest other = (DeleteUserRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) + return false; + if (other.getClientRequestToken() != null + && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteUserResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteUserResult.java new file mode 100644 index 0000000000..6f76308710 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DeleteUserResult.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class DeleteUserResult implements Serializable { + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DeleteUserResult == false) + return false; + DeleteUserResult other = (DeleteUserResult) obj; + + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DescribeCollectionResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DescribeCollectionResult.java index fce94d36ee..d73ca3f9ad 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DescribeCollectionResult.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DescribeCollectionResult.java @@ -57,6 +57,16 @@ public class DescribeCollectionResult implements Serializable { */ private java.util.Date creationTimestamp; + /** + *

    + * The number of UserIDs assigned to the specified colleciton. + *

    + *

    + * Constraints:
    + * Range: 0 -
    + */ + private Long userCount; + /** *

    * The number of faces that are indexed into the collection. To index faces @@ -294,6 +304,60 @@ public DescribeCollectionResult withCreationTimestamp(java.util.Date creationTim return this; } + /** + *

    + * The number of UserIDs assigned to the specified colleciton. + *

    + *

    + * Constraints:
    + * Range: 0 -
    + * + * @return

    + * The number of UserIDs assigned to the specified colleciton. + *

    + */ + public Long getUserCount() { + return userCount; + } + + /** + *

    + * The number of UserIDs assigned to the specified colleciton. + *

    + *

    + * Constraints:
    + * Range: 0 -
    + * + * @param userCount

    + * The number of UserIDs assigned to the specified colleciton. + *

    + */ + public void setUserCount(Long userCount) { + this.userCount = userCount; + } + + /** + *

    + * The number of UserIDs assigned to the specified colleciton. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Range: 0 -
    + * + * @param userCount

    + * The number of UserIDs assigned to the specified colleciton. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DescribeCollectionResult withUserCount(Long userCount) { + this.userCount = userCount; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -312,7 +376,9 @@ public String toString() { if (getCollectionARN() != null) sb.append("CollectionARN: " + getCollectionARN() + ","); if (getCreationTimestamp() != null) - sb.append("CreationTimestamp: " + getCreationTimestamp()); + sb.append("CreationTimestamp: " + getCreationTimestamp() + ","); + if (getUserCount() != null) + sb.append("UserCount: " + getUserCount()); sb.append("}"); return sb.toString(); } @@ -329,6 +395,7 @@ public int hashCode() { + ((getCollectionARN() == null) ? 0 : getCollectionARN().hashCode()); hashCode = prime * hashCode + ((getCreationTimestamp() == null) ? 0 : getCreationTimestamp().hashCode()); + hashCode = prime * hashCode + ((getUserCount() == null) ? 0 : getUserCount().hashCode()); return hashCode; } @@ -363,6 +430,11 @@ public boolean equals(Object obj) { if (other.getCreationTimestamp() != null && other.getCreationTimestamp().equals(this.getCreationTimestamp()) == false) return false; + if (other.getUserCount() == null ^ this.getUserCount() == null) + return false; + if (other.getUserCount() != null + && other.getUserCount().equals(this.getUserCount()) == false) + return false; return true; } } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociateFacesRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociateFacesRequest.java new file mode 100644 index 0000000000..820d2dde65 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociateFacesRequest.java @@ -0,0 +1,417 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Removes the association between a Face supplied in an array of + * FaceIds and the User. If the User is not present already, then a + * ResourceNotFound exception is thrown. If successful, an array of + * faces that are disassociated from the User is returned. If a given face is + * already disassociated from the given UserID, it will be ignored and not be + * returned in the response. If a given face is already associated with a + * different User or not found in the collection it will be returned as part of + * UnsuccessfulDisassociations. You can remove 1 - 100 face IDs + * from a user at one time. + *

    + */ +public class DisassociateFacesRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * ID for the existing UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with multiple + * DisassociateFaces requests, the same response is returned. + * Use ClientRequestToken to prevent the same request from being processed + * more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + */ + private String clientRequestToken; + + /** + *

    + * An array of face IDs to disassociate from the UserID. + *

    + */ + private java.util.List faceIds; + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection containing the UserID. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * ID for the existing UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * ID for the existing UserID. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * ID for the existing UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the existing UserID. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * ID for the existing UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the existing UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesRequest withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with multiple + * DisassociateFaces requests, the same response is returned. + * Use ClientRequestToken to prevent the same request from being processed + * more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @return

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with + * multiple DisassociateFaces requests, the same + * response is returned. Use ClientRequestToken to prevent the same + * request from being processed more than once. + *

    + */ + public String getClientRequestToken() { + return clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with multiple + * DisassociateFaces requests, the same response is returned. + * Use ClientRequestToken to prevent the same request from being processed + * more than once. + *

    + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with + * multiple DisassociateFaces requests, the same + * response is returned. Use ClientRequestToken to prevent the + * same request from being processed more than once. + *

    + */ + public void setClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + } + + /** + *

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with multiple + * DisassociateFaces requests, the same response is returned. + * Use ClientRequestToken to prevent the same request from being processed + * more than once. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 64
    + * Pattern: ^[a-zA-Z0-9-_]+$
    + * + * @param clientRequestToken

    + * Idempotent token used to identify the request to + * DisassociateFaces. If you use the same token with + * multiple DisassociateFaces requests, the same + * response is returned. Use ClientRequestToken to prevent the + * same request from being processed more than once. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesRequest withClientRequestToken(String clientRequestToken) { + this.clientRequestToken = clientRequestToken; + return this; + } + + /** + *

    + * An array of face IDs to disassociate from the UserID. + *

    + * + * @return

    + * An array of face IDs to disassociate from the UserID. + *

    + */ + public java.util.List getFaceIds() { + return faceIds; + } + + /** + *

    + * An array of face IDs to disassociate from the UserID. + *

    + * + * @param faceIds

    + * An array of face IDs to disassociate from the UserID. + *

    + */ + public void setFaceIds(java.util.Collection faceIds) { + if (faceIds == null) { + this.faceIds = null; + return; + } + + this.faceIds = new java.util.ArrayList(faceIds); + } + + /** + *

    + * An array of face IDs to disassociate from the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceIds

    + * An array of face IDs to disassociate from the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesRequest withFaceIds(String... faceIds) { + if (getFaceIds() == null) { + this.faceIds = new java.util.ArrayList(faceIds.length); + } + for (String value : faceIds) { + this.faceIds.add(value); + } + return this; + } + + /** + *

    + * An array of face IDs to disassociate from the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceIds

    + * An array of face IDs to disassociate from the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesRequest withFaceIds(java.util.Collection faceIds) { + setFaceIds(faceIds); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getClientRequestToken() != null) + sb.append("ClientRequestToken: " + getClientRequestToken() + ","); + if (getFaceIds() != null) + sb.append("FaceIds: " + getFaceIds()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + + ((getClientRequestToken() == null) ? 0 : getClientRequestToken().hashCode()); + hashCode = prime * hashCode + ((getFaceIds() == null) ? 0 : getFaceIds().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DisassociateFacesRequest == false) + return false; + DisassociateFacesRequest other = (DisassociateFacesRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getClientRequestToken() == null ^ this.getClientRequestToken() == null) + return false; + if (other.getClientRequestToken() != null + && other.getClientRequestToken().equals(this.getClientRequestToken()) == false) + return false; + if (other.getFaceIds() == null ^ this.getFaceIds() == null) + return false; + if (other.getFaceIds() != null && other.getFaceIds().equals(this.getFaceIds()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociateFacesResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociateFacesResult.java new file mode 100644 index 0000000000..a38a3fa8bf --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociateFacesResult.java @@ -0,0 +1,415 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class DisassociateFacesResult implements Serializable { + /** + *

    + * An array of DissociatedFace objects containing FaceIds that are + * successfully disassociated with the UserID is returned. Returned if the + * DisassociatedFaces action is successful. + *

    + */ + private java.util.List disassociatedFaces; + + /** + *

    + * An array of UnsuccessfulDisassociation objects containing FaceIds that + * are not successfully associated, along with the reasons for the failure + * to associate. Returned if the DisassociateFaces action is successful. + *

    + */ + private java.util.List unsuccessfulFaceDisassociations; + + /** + *

    + * The status of an update made to a User. Reflects if the User has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + */ + private String userStatus; + + /** + *

    + * An array of DissociatedFace objects containing FaceIds that are + * successfully disassociated with the UserID is returned. Returned if the + * DisassociatedFaces action is successful. + *

    + * + * @return

    + * An array of DissociatedFace objects containing FaceIds that are + * successfully disassociated with the UserID is returned. Returned + * if the DisassociatedFaces action is successful. + *

    + */ + public java.util.List getDisassociatedFaces() { + return disassociatedFaces; + } + + /** + *

    + * An array of DissociatedFace objects containing FaceIds that are + * successfully disassociated with the UserID is returned. Returned if the + * DisassociatedFaces action is successful. + *

    + * + * @param disassociatedFaces

    + * An array of DissociatedFace objects containing FaceIds that + * are successfully disassociated with the UserID is returned. + * Returned if the DisassociatedFaces action is successful. + *

    + */ + public void setDisassociatedFaces(java.util.Collection disassociatedFaces) { + if (disassociatedFaces == null) { + this.disassociatedFaces = null; + return; + } + + this.disassociatedFaces = new java.util.ArrayList(disassociatedFaces); + } + + /** + *

    + * An array of DissociatedFace objects containing FaceIds that are + * successfully disassociated with the UserID is returned. Returned if the + * DisassociatedFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param disassociatedFaces

    + * An array of DissociatedFace objects containing FaceIds that + * are successfully disassociated with the UserID is returned. + * Returned if the DisassociatedFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesResult withDisassociatedFaces(DisassociatedFace... disassociatedFaces) { + if (getDisassociatedFaces() == null) { + this.disassociatedFaces = new java.util.ArrayList( + disassociatedFaces.length); + } + for (DisassociatedFace value : disassociatedFaces) { + this.disassociatedFaces.add(value); + } + return this; + } + + /** + *

    + * An array of DissociatedFace objects containing FaceIds that are + * successfully disassociated with the UserID is returned. Returned if the + * DisassociatedFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param disassociatedFaces

    + * An array of DissociatedFace objects containing FaceIds that + * are successfully disassociated with the UserID is returned. + * Returned if the DisassociatedFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesResult withDisassociatedFaces( + java.util.Collection disassociatedFaces) { + setDisassociatedFaces(disassociatedFaces); + return this; + } + + /** + *

    + * An array of UnsuccessfulDisassociation objects containing FaceIds that + * are not successfully associated, along with the reasons for the failure + * to associate. Returned if the DisassociateFaces action is successful. + *

    + * + * @return

    + * An array of UnsuccessfulDisassociation objects containing FaceIds + * that are not successfully associated, along with the reasons for + * the failure to associate. Returned if the DisassociateFaces + * action is successful. + *

    + */ + public java.util.List getUnsuccessfulFaceDisassociations() { + return unsuccessfulFaceDisassociations; + } + + /** + *

    + * An array of UnsuccessfulDisassociation objects containing FaceIds that + * are not successfully associated, along with the reasons for the failure + * to associate. Returned if the DisassociateFaces action is successful. + *

    + * + * @param unsuccessfulFaceDisassociations

    + * An array of UnsuccessfulDisassociation objects containing + * FaceIds that are not successfully associated, along with the + * reasons for the failure to associate. Returned if the + * DisassociateFaces action is successful. + *

    + */ + public void setUnsuccessfulFaceDisassociations( + java.util.Collection unsuccessfulFaceDisassociations) { + if (unsuccessfulFaceDisassociations == null) { + this.unsuccessfulFaceDisassociations = null; + return; + } + + this.unsuccessfulFaceDisassociations = new java.util.ArrayList( + unsuccessfulFaceDisassociations); + } + + /** + *

    + * An array of UnsuccessfulDisassociation objects containing FaceIds that + * are not successfully associated, along with the reasons for the failure + * to associate. Returned if the DisassociateFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsuccessfulFaceDisassociations

    + * An array of UnsuccessfulDisassociation objects containing + * FaceIds that are not successfully associated, along with the + * reasons for the failure to associate. Returned if the + * DisassociateFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesResult withUnsuccessfulFaceDisassociations( + UnsuccessfulFaceDisassociation... unsuccessfulFaceDisassociations) { + if (getUnsuccessfulFaceDisassociations() == null) { + this.unsuccessfulFaceDisassociations = new java.util.ArrayList( + unsuccessfulFaceDisassociations.length); + } + for (UnsuccessfulFaceDisassociation value : unsuccessfulFaceDisassociations) { + this.unsuccessfulFaceDisassociations.add(value); + } + return this; + } + + /** + *

    + * An array of UnsuccessfulDisassociation objects containing FaceIds that + * are not successfully associated, along with the reasons for the failure + * to associate. Returned if the DisassociateFaces action is successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsuccessfulFaceDisassociations

    + * An array of UnsuccessfulDisassociation objects containing + * FaceIds that are not successfully associated, along with the + * reasons for the failure to associate. Returned if the + * DisassociateFaces action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociateFacesResult withUnsuccessfulFaceDisassociations( + java.util.Collection unsuccessfulFaceDisassociations) { + setUnsuccessfulFaceDisassociations(unsuccessfulFaceDisassociations); + return this; + } + + /** + *

    + * The status of an update made to a User. Reflects if the User has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @return

    + * The status of an update made to a User. Reflects if the User has + * been updated for every requested change. + *

    + * @see UserStatus + */ + public String getUserStatus() { + return userStatus; + } + + /** + *

    + * The status of an update made to a User. Reflects if the User has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a User. Reflects if the User + * has been updated for every requested change. + *

    + * @see UserStatus + */ + public void setUserStatus(String userStatus) { + this.userStatus = userStatus; + } + + /** + *

    + * The status of an update made to a User. Reflects if the User has been + * updated for every requested change. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a User. Reflects if the User + * has been updated for every requested change. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public DisassociateFacesResult withUserStatus(String userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + *

    + * The status of an update made to a User. Reflects if the User has been + * updated for every requested change. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a User. Reflects if the User + * has been updated for every requested change. + *

    + * @see UserStatus + */ + public void setUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + } + + /** + *

    + * The status of an update made to a User. Reflects if the User has been + * updated for every requested change. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of an update made to a User. Reflects if the User + * has been updated for every requested change. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public DisassociateFacesResult withUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getDisassociatedFaces() != null) + sb.append("DisassociatedFaces: " + getDisassociatedFaces() + ","); + if (getUnsuccessfulFaceDisassociations() != null) + sb.append("UnsuccessfulFaceDisassociations: " + getUnsuccessfulFaceDisassociations() + + ","); + if (getUserStatus() != null) + sb.append("UserStatus: " + getUserStatus()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getDisassociatedFaces() == null) ? 0 : getDisassociatedFaces().hashCode()); + hashCode = prime + * hashCode + + ((getUnsuccessfulFaceDisassociations() == null) ? 0 + : getUnsuccessfulFaceDisassociations().hashCode()); + hashCode = prime * hashCode + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DisassociateFacesResult == false) + return false; + DisassociateFacesResult other = (DisassociateFacesResult) obj; + + if (other.getDisassociatedFaces() == null ^ this.getDisassociatedFaces() == null) + return false; + if (other.getDisassociatedFaces() != null + && other.getDisassociatedFaces().equals(this.getDisassociatedFaces()) == false) + return false; + if (other.getUnsuccessfulFaceDisassociations() == null + ^ this.getUnsuccessfulFaceDisassociations() == null) + return false; + if (other.getUnsuccessfulFaceDisassociations() != null + && other.getUnsuccessfulFaceDisassociations().equals( + this.getUnsuccessfulFaceDisassociations()) == false) + return false; + if (other.getUserStatus() == null ^ this.getUserStatus() == null) + return false; + if (other.getUserStatus() != null + && other.getUserStatus().equals(this.getUserStatus()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociatedFace.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociatedFace.java new file mode 100644 index 0000000000..a2e330d823 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/DisassociatedFace.java @@ -0,0 +1,138 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Provides face metadata for the faces that are disassociated from a specific + * UserID. + *

    + */ +public class DisassociatedFace implements Serializable { + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * Unique identifier assigned to the face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * Unique identifier assigned to the face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * Unique identifier assigned to the face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public DisassociatedFace withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof DisassociatedFace == false) + return false; + DisassociatedFace other = (DisassociatedFace) obj; + + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Face.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Face.java index 4ce818db3a..cba4efa288 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Face.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/Face.java @@ -86,6 +86,17 @@ public class Face implements Serializable { */ private String indexFacesModelVersion; + /** + *

    + * Unique identifier assigned to the user. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + /** *

    * Unique identifier that Amazon Rekognition assigns to the face. @@ -427,6 +438,63 @@ public Face withIndexFacesModelVersion(String indexFacesModelVersion) { return this; } + /** + *

    + * Unique identifier assigned to the user. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * Unique identifier assigned to the user. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * Unique identifier assigned to the user. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * Unique identifier assigned to the user. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * Unique identifier assigned to the user. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * Unique identifier assigned to the user. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public Face withUserId(String userId) { + this.userId = userId; + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -449,7 +517,9 @@ public String toString() { if (getConfidence() != null) sb.append("Confidence: " + getConfidence() + ","); if (getIndexFacesModelVersion() != null) - sb.append("IndexFacesModelVersion: " + getIndexFacesModelVersion()); + sb.append("IndexFacesModelVersion: " + getIndexFacesModelVersion() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId()); sb.append("}"); return sb.toString(); } @@ -470,6 +540,7 @@ public int hashCode() { * hashCode + ((getIndexFacesModelVersion() == null) ? 0 : getIndexFacesModelVersion() .hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); return hashCode; } @@ -512,6 +583,10 @@ public boolean equals(Object obj) { if (other.getIndexFacesModelVersion() != null && other.getIndexFacesModelVersion().equals(this.getIndexFacesModelVersion()) == false) return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; return true; } } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListFacesRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListFacesRequest.java index 90254076d3..9e18d9917d 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListFacesRequest.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListFacesRequest.java @@ -65,6 +65,24 @@ public class ListFacesRequest extends AmazonWebServiceRequest implements Seriali */ private Integer maxResults; + /** + *

    + * An array of user IDs to match when listing faces in a collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * An array of face IDs to match when listing faces in a collection. + *

    + */ + private java.util.List faceIds; + /** * Default constructor for ListFacesRequest object. Callers should use the * setter or fluent setter (with...) methods to initialize any additional @@ -266,6 +284,142 @@ public ListFacesRequest withMaxResults(Integer maxResults) { return this; } + /** + *

    + * An array of user IDs to match when listing faces in a collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * An array of user IDs to match when listing faces in a collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * An array of user IDs to match when listing faces in a collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * An array of user IDs to match when listing faces in a + * collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * An array of user IDs to match when listing faces in a collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * An array of user IDs to match when listing faces in a + * collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListFacesRequest withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * An array of face IDs to match when listing faces in a collection. + *

    + * + * @return

    + * An array of face IDs to match when listing faces in a collection. + *

    + */ + public java.util.List getFaceIds() { + return faceIds; + } + + /** + *

    + * An array of face IDs to match when listing faces in a collection. + *

    + * + * @param faceIds

    + * An array of face IDs to match when listing faces in a + * collection. + *

    + */ + public void setFaceIds(java.util.Collection faceIds) { + if (faceIds == null) { + this.faceIds = null; + return; + } + + this.faceIds = new java.util.ArrayList(faceIds); + } + + /** + *

    + * An array of face IDs to match when listing faces in a collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceIds

    + * An array of face IDs to match when listing faces in a + * collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListFacesRequest withFaceIds(String... faceIds) { + if (getFaceIds() == null) { + this.faceIds = new java.util.ArrayList(faceIds.length); + } + for (String value : faceIds) { + this.faceIds.add(value); + } + return this; + } + + /** + *

    + * An array of face IDs to match when listing faces in a collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceIds

    + * An array of face IDs to match when listing faces in a + * collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListFacesRequest withFaceIds(java.util.Collection faceIds) { + setFaceIds(faceIds); + return this; + } + /** * Returns a string representation of this object; useful for testing and * debugging. @@ -282,7 +436,11 @@ public String toString() { if (getNextToken() != null) sb.append("NextToken: " + getNextToken() + ","); if (getMaxResults() != null) - sb.append("MaxResults: " + getMaxResults()); + sb.append("MaxResults: " + getMaxResults() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getFaceIds() != null) + sb.append("FaceIds: " + getFaceIds()); sb.append("}"); return sb.toString(); } @@ -296,6 +454,8 @@ public int hashCode() { + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getFaceIds() == null) ? 0 : getFaceIds().hashCode()); return hashCode; } @@ -325,6 +485,14 @@ public boolean equals(Object obj) { if (other.getMaxResults() != null && other.getMaxResults().equals(this.getMaxResults()) == false) return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getFaceIds() == null ^ this.getFaceIds() == null) + return false; + if (other.getFaceIds() != null && other.getFaceIds().equals(this.getFaceIds()) == false) + return false; return true; } } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListUsersRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListUsersRequest.java new file mode 100644 index 0000000000..712240ce96 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListUsersRequest.java @@ -0,0 +1,290 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Returns metadata of the User such as UserID in the specified + * collection. Anonymous User (to reserve faces without any identity) is not + * returned as part of this request. The results are sorted by system generated + * primary key ID. If the response is truncated, NextToken is + * returned in the response that can be used in the subsequent request to + * retrieve the next set of identities. + *

    + */ +public class ListUsersRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * Maximum number of UsersID to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + */ + private Integer maxResults; + + /** + *

    + * Pagingation token to receive the next set of UsersID. + *

    + *

    + * Constraints:
    + * Length: - 255
    + */ + private String nextToken; + + /** + *

    + * The ID of an existing collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListUsersRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * Maximum number of UsersID to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @return

    + * Maximum number of UsersID to return. + *

    + */ + public Integer getMaxResults() { + return maxResults; + } + + /** + *

    + * Maximum number of UsersID to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @param maxResults

    + * Maximum number of UsersID to return. + *

    + */ + public void setMaxResults(Integer maxResults) { + this.maxResults = maxResults; + } + + /** + *

    + * Maximum number of UsersID to return. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @param maxResults

    + * Maximum number of UsersID to return. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListUsersRequest withMaxResults(Integer maxResults) { + this.maxResults = maxResults; + return this; + } + + /** + *

    + * Pagingation token to receive the next set of UsersID. + *

    + *

    + * Constraints:
    + * Length: - 255
    + * + * @return

    + * Pagingation token to receive the next set of UsersID. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * Pagingation token to receive the next set of UsersID. + *

    + *

    + * Constraints:
    + * Length: - 255
    + * + * @param nextToken

    + * Pagingation token to receive the next set of UsersID. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * Pagingation token to receive the next set of UsersID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: - 255
    + * + * @param nextToken

    + * Pagingation token to receive the next set of UsersID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListUsersRequest withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getMaxResults() != null) + sb.append("MaxResults: " + getMaxResults() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getMaxResults() == null) ? 0 : getMaxResults().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListUsersRequest == false) + return false; + ListUsersRequest other = (ListUsersRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getMaxResults() == null ^ this.getMaxResults() == null) + return false; + if (other.getMaxResults() != null + && other.getMaxResults().equals(this.getMaxResults()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListUsersResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListUsersResult.java new file mode 100644 index 0000000000..10ee573a16 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/ListUsersResult.java @@ -0,0 +1,224 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class ListUsersResult implements Serializable { + /** + *

    + * List of UsersID associated with the specified collection. + *

    + */ + private java.util.List users; + + /** + *

    + * A pagination token to be used with the subsequent request if the response + * is truncated. + *

    + *

    + * Constraints:
    + * Length: - 255
    + */ + private String nextToken; + + /** + *

    + * List of UsersID associated with the specified collection. + *

    + * + * @return

    + * List of UsersID associated with the specified collection. + *

    + */ + public java.util.List getUsers() { + return users; + } + + /** + *

    + * List of UsersID associated with the specified collection. + *

    + * + * @param users

    + * List of UsersID associated with the specified collection. + *

    + */ + public void setUsers(java.util.Collection users) { + if (users == null) { + this.users = null; + return; + } + + this.users = new java.util.ArrayList(users); + } + + /** + *

    + * List of UsersID associated with the specified collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param users

    + * List of UsersID associated with the specified collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListUsersResult withUsers(User... users) { + if (getUsers() == null) { + this.users = new java.util.ArrayList(users.length); + } + for (User value : users) { + this.users.add(value); + } + return this; + } + + /** + *

    + * List of UsersID associated with the specified collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param users

    + * List of UsersID associated with the specified collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListUsersResult withUsers(java.util.Collection users) { + setUsers(users); + return this; + } + + /** + *

    + * A pagination token to be used with the subsequent request if the response + * is truncated. + *

    + *

    + * Constraints:
    + * Length: - 255
    + * + * @return

    + * A pagination token to be used with the subsequent request if the + * response is truncated. + *

    + */ + public String getNextToken() { + return nextToken; + } + + /** + *

    + * A pagination token to be used with the subsequent request if the response + * is truncated. + *

    + *

    + * Constraints:
    + * Length: - 255
    + * + * @param nextToken

    + * A pagination token to be used with the subsequent request if + * the response is truncated. + *

    + */ + public void setNextToken(String nextToken) { + this.nextToken = nextToken; + } + + /** + *

    + * A pagination token to be used with the subsequent request if the response + * is truncated. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: - 255
    + * + * @param nextToken

    + * A pagination token to be used with the subsequent request if + * the response is truncated. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public ListUsersResult withNextToken(String nextToken) { + this.nextToken = nextToken; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getUsers() != null) + sb.append("Users: " + getUsers() + ","); + if (getNextToken() != null) + sb.append("NextToken: " + getNextToken()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getUsers() == null) ? 0 : getUsers().hashCode()); + hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof ListUsersResult == false) + return false; + ListUsersResult other = (ListUsersResult) obj; + + if (other.getUsers() == null ^ this.getUsers() == null) + return false; + if (other.getUsers() != null && other.getUsers().equals(this.getUsers()) == false) + return false; + if (other.getNextToken() == null ^ this.getNextToken() == null) + return false; + if (other.getNextToken() != null + && other.getNextToken().equals(this.getNextToken()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MatchedUser.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MatchedUser.java new file mode 100644 index 0000000000..c91f727b8e --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/MatchedUser.java @@ -0,0 +1,252 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Contains metadata for a UserID matched with a given face. + *

    + */ +public class MatchedUser implements Serializable { + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * The status of the user matched to a provided FaceID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + */ + private String userStatus; + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public MatchedUser withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * The status of the user matched to a provided FaceID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @return

    + * The status of the user matched to a provided FaceID. + *

    + * @see UserStatus + */ + public String getUserStatus() { + return userStatus; + } + + /** + *

    + * The status of the user matched to a provided FaceID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of the user matched to a provided FaceID. + *

    + * @see UserStatus + */ + public void setUserStatus(String userStatus) { + this.userStatus = userStatus; + } + + /** + *

    + * The status of the user matched to a provided FaceID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of the user matched to a provided FaceID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public MatchedUser withUserStatus(String userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + *

    + * The status of the user matched to a provided FaceID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of the user matched to a provided FaceID. + *

    + * @see UserStatus + */ + public void setUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + } + + /** + *

    + * The status of the user matched to a provided FaceID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * The status of the user matched to a provided FaceID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public MatchedUser withUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getUserStatus() != null) + sb.append("UserStatus: " + getUserStatus()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof MatchedUser == false) + return false; + MatchedUser other = (MatchedUser) obj; + + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getUserStatus() == null ^ this.getUserStatus() == null) + return false; + if (other.getUserStatus() != null + && other.getUserStatus().equals(this.getUserStatus()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersByImageRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersByImageRequest.java new file mode 100644 index 0000000000..1e6e7c8709 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersByImageRequest.java @@ -0,0 +1,734 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Searches for UserIDs using a supplied image. It first detects the largest + * face in the image, and then searches a specified collection for matching + * UserIDs. + *

    + *

    + * The operation returns an array of UserIDs that match the face in the supplied + * image, ordered by similarity score with the highest similarity first. It also + * returns a bounding box for the face found in the input image. + *

    + *

    + * Information about faces detected in the supplied image, but not used for the + * search, is returned in an array of UnsearchedFace objects. If no + * valid face is detected in the image, the response will contain an empty + * UserMatches list and no SearchedFace object. + *

    + */ +public class SearchUsersByImageRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by using the + * Bytes property. For example, you would use the + * Bytes property to pass an image loaded from a local file + * system. Image bytes passed by using the Bytes property must + * be base64-encoded. Your code may not need to encode image bytes if you + * are using an AWS SDK to call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a Local File + * System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon Rekognition API + * operation by using the S3Object property. Images stored in + * an S3 bucket do not need to be base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must match the + * region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, passing + * image bytes using the Bytes property is not supported. You must first + * upload the image to an Amazon S3 bucket and then call the operation using + * the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must have + * permission to access the S3 object. For more information, see How Amazon + * Rekognition works with IAM in the Amazon Rekognition Developer Guide. + *

    + */ + private Image image; + + /** + *

    + * Specifies the minimum confidence in the UserID match to return. Default + * value is 80. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + */ + private Float userMatchThreshold; + + /** + *

    + * Maximum number of UserIDs to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + */ + private Integer maxUsers; + + /** + *

    + * A filter that specifies a quality bar for how much filtering is done to + * identify faces. Filtered faces aren't searched for in the collection. The + * default value is NONE. + *

    + *

    + * Constraints:
    + * Allowed Values: NONE, AUTO, LOW, MEDIUM, HIGH + */ + private String qualityFilter; + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection containing the UserID. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by using the + * Bytes property. For example, you would use the + * Bytes property to pass an image loaded from a local file + * system. Image bytes passed by using the Bytes property must + * be base64-encoded. Your code may not need to encode image bytes if you + * are using an AWS SDK to call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a Local File + * System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon Rekognition API + * operation by using the S3Object property. Images stored in + * an S3 bucket do not need to be base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must match the + * region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, passing + * image bytes using the Bytes property is not supported. You must first + * upload the image to an Amazon S3 bucket and then call the operation using + * the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must have + * permission to access the S3 object. For more information, see How Amazon + * Rekognition works with IAM in the Amazon Rekognition Developer Guide. + *

    + * + * @return

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by + * using the Bytes property. For example, you would use + * the Bytes property to pass an image loaded from a + * local file system. Image bytes passed by using the + * Bytes property must be base64-encoded. Your code may + * not need to encode image bytes if you are using an AWS SDK to + * call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a Local + * File System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon Rekognition + * API operation by using the S3Object property. Images + * stored in an S3 bucket do not need to be base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must match + * the region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, + * passing image bytes using the Bytes property is not supported. + * You must first upload the image to an Amazon S3 bucket and then + * call the operation using the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must + * have permission to access the S3 object. For more information, + * see How Amazon Rekognition works with IAM in the Amazon + * Rekognition Developer Guide. + *

    + */ + public Image getImage() { + return image; + } + + /** + *

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by using the + * Bytes property. For example, you would use the + * Bytes property to pass an image loaded from a local file + * system. Image bytes passed by using the Bytes property must + * be base64-encoded. Your code may not need to encode image bytes if you + * are using an AWS SDK to call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a Local File + * System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon Rekognition API + * operation by using the S3Object property. Images stored in + * an S3 bucket do not need to be base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must match the + * region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, passing + * image bytes using the Bytes property is not supported. You must first + * upload the image to an Amazon S3 bucket and then call the operation using + * the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must have + * permission to access the S3 object. For more information, see How Amazon + * Rekognition works with IAM in the Amazon Rekognition Developer Guide. + *

    + * + * @param image

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by + * using the Bytes property. For example, you would + * use the Bytes property to pass an image loaded + * from a local file system. Image bytes passed by using the + * Bytes property must be base64-encoded. Your code + * may not need to encode image bytes if you are using an AWS SDK + * to call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a + * Local File System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon + * Rekognition API operation by using the S3Object + * property. Images stored in an S3 bucket do not need to be + * base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must + * match the region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, + * passing image bytes using the Bytes property is not supported. + * You must first upload the image to an Amazon S3 bucket and + * then call the operation using the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must + * have permission to access the S3 object. For more information, + * see How Amazon Rekognition works with IAM in the Amazon + * Rekognition Developer Guide. + *

    + */ + public void setImage(Image image) { + this.image = image; + } + + /** + *

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by using the + * Bytes property. For example, you would use the + * Bytes property to pass an image loaded from a local file + * system. Image bytes passed by using the Bytes property must + * be base64-encoded. Your code may not need to encode image bytes if you + * are using an AWS SDK to call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a Local File + * System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon Rekognition API + * operation by using the S3Object property. Images stored in + * an S3 bucket do not need to be base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must match the + * region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, passing + * image bytes using the Bytes property is not supported. You must first + * upload the image to an Amazon S3 bucket and then call the operation using + * the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must have + * permission to access the S3 object. For more information, see How Amazon + * Rekognition works with IAM in the Amazon Rekognition Developer Guide. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param image

    + * Provides the input image either as bytes or an S3 object. + *

    + *

    + * You pass image bytes to an Amazon Rekognition API operation by + * using the Bytes property. For example, you would + * use the Bytes property to pass an image loaded + * from a local file system. Image bytes passed by using the + * Bytes property must be base64-encoded. Your code + * may not need to encode image bytes if you are using an AWS SDK + * to call Amazon Rekognition API operations. + *

    + *

    + * For more information, see Analyzing an Image Loaded from a + * Local File System in the Amazon Rekognition Developer Guide. + *

    + *

    + * You pass images stored in an S3 bucket to an Amazon + * Rekognition API operation by using the S3Object + * property. Images stored in an S3 bucket do not need to be + * base64-encoded. + *

    + *

    + * The region for the S3 bucket containing the S3 object must + * match the region you use for Amazon Rekognition operations. + *

    + *

    + * If you use the AWS CLI to call Amazon Rekognition operations, + * passing image bytes using the Bytes property is not supported. + * You must first upload the image to an Amazon S3 bucket and + * then call the operation using the S3Object property. + *

    + *

    + * For Amazon Rekognition to process an S3 object, the user must + * have permission to access the S3 object. For more information, + * see How Amazon Rekognition works with IAM in the Amazon + * Rekognition Developer Guide. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageRequest withImage(Image image) { + this.image = image; + return this; + } + + /** + *

    + * Specifies the minimum confidence in the UserID match to return. Default + * value is 80. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @return

    + * Specifies the minimum confidence in the UserID match to return. + * Default value is 80. + *

    + */ + public Float getUserMatchThreshold() { + return userMatchThreshold; + } + + /** + *

    + * Specifies the minimum confidence in the UserID match to return. Default + * value is 80. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param userMatchThreshold

    + * Specifies the minimum confidence in the UserID match to + * return. Default value is 80. + *

    + */ + public void setUserMatchThreshold(Float userMatchThreshold) { + this.userMatchThreshold = userMatchThreshold; + } + + /** + *

    + * Specifies the minimum confidence in the UserID match to return. Default + * value is 80. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param userMatchThreshold

    + * Specifies the minimum confidence in the UserID match to + * return. Default value is 80. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageRequest withUserMatchThreshold(Float userMatchThreshold) { + this.userMatchThreshold = userMatchThreshold; + return this; + } + + /** + *

    + * Maximum number of UserIDs to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @return

    + * Maximum number of UserIDs to return. + *

    + */ + public Integer getMaxUsers() { + return maxUsers; + } + + /** + *

    + * Maximum number of UserIDs to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @param maxUsers

    + * Maximum number of UserIDs to return. + *

    + */ + public void setMaxUsers(Integer maxUsers) { + this.maxUsers = maxUsers; + } + + /** + *

    + * Maximum number of UserIDs to return. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @param maxUsers

    + * Maximum number of UserIDs to return. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageRequest withMaxUsers(Integer maxUsers) { + this.maxUsers = maxUsers; + return this; + } + + /** + *

    + * A filter that specifies a quality bar for how much filtering is done to + * identify faces. Filtered faces aren't searched for in the collection. The + * default value is NONE. + *

    + *

    + * Constraints:
    + * Allowed Values: NONE, AUTO, LOW, MEDIUM, HIGH + * + * @return

    + * A filter that specifies a quality bar for how much filtering is + * done to identify faces. Filtered faces aren't searched for in the + * collection. The default value is NONE. + *

    + * @see QualityFilter + */ + public String getQualityFilter() { + return qualityFilter; + } + + /** + *

    + * A filter that specifies a quality bar for how much filtering is done to + * identify faces. Filtered faces aren't searched for in the collection. The + * default value is NONE. + *

    + *

    + * Constraints:
    + * Allowed Values: NONE, AUTO, LOW, MEDIUM, HIGH + * + * @param qualityFilter

    + * A filter that specifies a quality bar for how much filtering + * is done to identify faces. Filtered faces aren't searched for + * in the collection. The default value is NONE. + *

    + * @see QualityFilter + */ + public void setQualityFilter(String qualityFilter) { + this.qualityFilter = qualityFilter; + } + + /** + *

    + * A filter that specifies a quality bar for how much filtering is done to + * identify faces. Filtered faces aren't searched for in the collection. The + * default value is NONE. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: NONE, AUTO, LOW, MEDIUM, HIGH + * + * @param qualityFilter

    + * A filter that specifies a quality bar for how much filtering + * is done to identify faces. Filtered faces aren't searched for + * in the collection. The default value is NONE. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see QualityFilter + */ + public SearchUsersByImageRequest withQualityFilter(String qualityFilter) { + this.qualityFilter = qualityFilter; + return this; + } + + /** + *

    + * A filter that specifies a quality bar for how much filtering is done to + * identify faces. Filtered faces aren't searched for in the collection. The + * default value is NONE. + *

    + *

    + * Constraints:
    + * Allowed Values: NONE, AUTO, LOW, MEDIUM, HIGH + * + * @param qualityFilter

    + * A filter that specifies a quality bar for how much filtering + * is done to identify faces. Filtered faces aren't searched for + * in the collection. The default value is NONE. + *

    + * @see QualityFilter + */ + public void setQualityFilter(QualityFilter qualityFilter) { + this.qualityFilter = qualityFilter.toString(); + } + + /** + *

    + * A filter that specifies a quality bar for how much filtering is done to + * identify faces. Filtered faces aren't searched for in the collection. The + * default value is NONE. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: NONE, AUTO, LOW, MEDIUM, HIGH + * + * @param qualityFilter

    + * A filter that specifies a quality bar for how much filtering + * is done to identify faces. Filtered faces aren't searched for + * in the collection. The default value is NONE. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see QualityFilter + */ + public SearchUsersByImageRequest withQualityFilter(QualityFilter qualityFilter) { + this.qualityFilter = qualityFilter.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getImage() != null) + sb.append("Image: " + getImage() + ","); + if (getUserMatchThreshold() != null) + sb.append("UserMatchThreshold: " + getUserMatchThreshold() + ","); + if (getMaxUsers() != null) + sb.append("MaxUsers: " + getMaxUsers() + ","); + if (getQualityFilter() != null) + sb.append("QualityFilter: " + getQualityFilter()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getImage() == null) ? 0 : getImage().hashCode()); + hashCode = prime * hashCode + + ((getUserMatchThreshold() == null) ? 0 : getUserMatchThreshold().hashCode()); + hashCode = prime * hashCode + ((getMaxUsers() == null) ? 0 : getMaxUsers().hashCode()); + hashCode = prime * hashCode + + ((getQualityFilter() == null) ? 0 : getQualityFilter().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchUsersByImageRequest == false) + return false; + SearchUsersByImageRequest other = (SearchUsersByImageRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getImage() == null ^ this.getImage() == null) + return false; + if (other.getImage() != null && other.getImage().equals(this.getImage()) == false) + return false; + if (other.getUserMatchThreshold() == null ^ this.getUserMatchThreshold() == null) + return false; + if (other.getUserMatchThreshold() != null + && other.getUserMatchThreshold().equals(this.getUserMatchThreshold()) == false) + return false; + if (other.getMaxUsers() == null ^ this.getMaxUsers() == null) + return false; + if (other.getMaxUsers() != null && other.getMaxUsers().equals(this.getMaxUsers()) == false) + return false; + if (other.getQualityFilter() == null ^ this.getQualityFilter() == null) + return false; + if (other.getQualityFilter() != null + && other.getQualityFilter().equals(this.getQualityFilter()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersByImageResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersByImageResult.java new file mode 100644 index 0000000000..ff53a1f369 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersByImageResult.java @@ -0,0 +1,438 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class SearchUsersByImageResult implements Serializable { + /** + *

    + * An array of UserID objects that matched the input face, along with the + * confidence in the match. The returned structure will be empty if there + * are no matches. Returned if the SearchUsersByImageResponse action is + * successful. + *

    + */ + private java.util.List userMatches; + + /** + *

    + * Version number of the face detection model associated with the input + * collection CollectionId. + *

    + */ + private String faceModelVersion; + + /** + *

    + * A list of FaceDetail objects containing the BoundingBox for the largest + * face in image, as well as the confidence in the bounding box, that was + * searched for matches. If no valid face is detected in the image the + * response will contain no SearchedFace object. + *

    + */ + private SearchedFaceDetails searchedFace; + + /** + *

    + * List of UnsearchedFace objects. Contains the face details infered from + * the specified image but not used for search. Contains reasons that + * describe why a face wasn't used for Search. + *

    + */ + private java.util.List unsearchedFaces; + + /** + *

    + * An array of UserID objects that matched the input face, along with the + * confidence in the match. The returned structure will be empty if there + * are no matches. Returned if the SearchUsersByImageResponse action is + * successful. + *

    + * + * @return

    + * An array of UserID objects that matched the input face, along + * with the confidence in the match. The returned structure will be + * empty if there are no matches. Returned if the + * SearchUsersByImageResponse action is successful. + *

    + */ + public java.util.List getUserMatches() { + return userMatches; + } + + /** + *

    + * An array of UserID objects that matched the input face, along with the + * confidence in the match. The returned structure will be empty if there + * are no matches. Returned if the SearchUsersByImageResponse action is + * successful. + *

    + * + * @param userMatches

    + * An array of UserID objects that matched the input face, along + * with the confidence in the match. The returned structure will + * be empty if there are no matches. Returned if the + * SearchUsersByImageResponse action is successful. + *

    + */ + public void setUserMatches(java.util.Collection userMatches) { + if (userMatches == null) { + this.userMatches = null; + return; + } + + this.userMatches = new java.util.ArrayList(userMatches); + } + + /** + *

    + * An array of UserID objects that matched the input face, along with the + * confidence in the match. The returned structure will be empty if there + * are no matches. Returned if the SearchUsersByImageResponse action is + * successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param userMatches

    + * An array of UserID objects that matched the input face, along + * with the confidence in the match. The returned structure will + * be empty if there are no matches. Returned if the + * SearchUsersByImageResponse action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageResult withUserMatches(UserMatch... userMatches) { + if (getUserMatches() == null) { + this.userMatches = new java.util.ArrayList(userMatches.length); + } + for (UserMatch value : userMatches) { + this.userMatches.add(value); + } + return this; + } + + /** + *

    + * An array of UserID objects that matched the input face, along with the + * confidence in the match. The returned structure will be empty if there + * are no matches. Returned if the SearchUsersByImageResponse action is + * successful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param userMatches

    + * An array of UserID objects that matched the input face, along + * with the confidence in the match. The returned structure will + * be empty if there are no matches. Returned if the + * SearchUsersByImageResponse action is successful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageResult withUserMatches(java.util.Collection userMatches) { + setUserMatches(userMatches); + return this; + } + + /** + *

    + * Version number of the face detection model associated with the input + * collection CollectionId. + *

    + * + * @return

    + * Version number of the face detection model associated with the + * input collection CollectionId. + *

    + */ + public String getFaceModelVersion() { + return faceModelVersion; + } + + /** + *

    + * Version number of the face detection model associated with the input + * collection CollectionId. + *

    + * + * @param faceModelVersion

    + * Version number of the face detection model associated with the + * input collection CollectionId. + *

    + */ + public void setFaceModelVersion(String faceModelVersion) { + this.faceModelVersion = faceModelVersion; + } + + /** + *

    + * Version number of the face detection model associated with the input + * collection CollectionId. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceModelVersion

    + * Version number of the face detection model associated with the + * input collection CollectionId. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageResult withFaceModelVersion(String faceModelVersion) { + this.faceModelVersion = faceModelVersion; + return this; + } + + /** + *

    + * A list of FaceDetail objects containing the BoundingBox for the largest + * face in image, as well as the confidence in the bounding box, that was + * searched for matches. If no valid face is detected in the image the + * response will contain no SearchedFace object. + *

    + * + * @return

    + * A list of FaceDetail objects containing the BoundingBox for the + * largest face in image, as well as the confidence in the bounding + * box, that was searched for matches. If no valid face is detected + * in the image the response will contain no SearchedFace object. + *

    + */ + public SearchedFaceDetails getSearchedFace() { + return searchedFace; + } + + /** + *

    + * A list of FaceDetail objects containing the BoundingBox for the largest + * face in image, as well as the confidence in the bounding box, that was + * searched for matches. If no valid face is detected in the image the + * response will contain no SearchedFace object. + *

    + * + * @param searchedFace

    + * A list of FaceDetail objects containing the BoundingBox for + * the largest face in image, as well as the confidence in the + * bounding box, that was searched for matches. If no valid face + * is detected in the image the response will contain no + * SearchedFace object. + *

    + */ + public void setSearchedFace(SearchedFaceDetails searchedFace) { + this.searchedFace = searchedFace; + } + + /** + *

    + * A list of FaceDetail objects containing the BoundingBox for the largest + * face in image, as well as the confidence in the bounding box, that was + * searched for matches. If no valid face is detected in the image the + * response will contain no SearchedFace object. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param searchedFace

    + * A list of FaceDetail objects containing the BoundingBox for + * the largest face in image, as well as the confidence in the + * bounding box, that was searched for matches. If no valid face + * is detected in the image the response will contain no + * SearchedFace object. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageResult withSearchedFace(SearchedFaceDetails searchedFace) { + this.searchedFace = searchedFace; + return this; + } + + /** + *

    + * List of UnsearchedFace objects. Contains the face details infered from + * the specified image but not used for search. Contains reasons that + * describe why a face wasn't used for Search. + *

    + * + * @return

    + * List of UnsearchedFace objects. Contains the face details infered + * from the specified image but not used for search. Contains + * reasons that describe why a face wasn't used for Search. + *

    + */ + public java.util.List getUnsearchedFaces() { + return unsearchedFaces; + } + + /** + *

    + * List of UnsearchedFace objects. Contains the face details infered from + * the specified image but not used for search. Contains reasons that + * describe why a face wasn't used for Search. + *

    + * + * @param unsearchedFaces

    + * List of UnsearchedFace objects. Contains the face details + * infered from the specified image but not used for search. + * Contains reasons that describe why a face wasn't used for + * Search. + *

    + */ + public void setUnsearchedFaces(java.util.Collection unsearchedFaces) { + if (unsearchedFaces == null) { + this.unsearchedFaces = null; + return; + } + + this.unsearchedFaces = new java.util.ArrayList(unsearchedFaces); + } + + /** + *

    + * List of UnsearchedFace objects. Contains the face details infered from + * the specified image but not used for search. Contains reasons that + * describe why a face wasn't used for Search. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsearchedFaces

    + * List of UnsearchedFace objects. Contains the face details + * infered from the specified image but not used for search. + * Contains reasons that describe why a face wasn't used for + * Search. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageResult withUnsearchedFaces(UnsearchedFace... unsearchedFaces) { + if (getUnsearchedFaces() == null) { + this.unsearchedFaces = new java.util.ArrayList(unsearchedFaces.length); + } + for (UnsearchedFace value : unsearchedFaces) { + this.unsearchedFaces.add(value); + } + return this; + } + + /** + *

    + * List of UnsearchedFace objects. Contains the face details infered from + * the specified image but not used for search. Contains reasons that + * describe why a face wasn't used for Search. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param unsearchedFaces

    + * List of UnsearchedFace objects. Contains the face details + * infered from the specified image but not used for search. + * Contains reasons that describe why a face wasn't used for + * Search. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersByImageResult withUnsearchedFaces( + java.util.Collection unsearchedFaces) { + setUnsearchedFaces(unsearchedFaces); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getUserMatches() != null) + sb.append("UserMatches: " + getUserMatches() + ","); + if (getFaceModelVersion() != null) + sb.append("FaceModelVersion: " + getFaceModelVersion() + ","); + if (getSearchedFace() != null) + sb.append("SearchedFace: " + getSearchedFace() + ","); + if (getUnsearchedFaces() != null) + sb.append("UnsearchedFaces: " + getUnsearchedFaces()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getUserMatches() == null) ? 0 : getUserMatches().hashCode()); + hashCode = prime * hashCode + + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); + hashCode = prime * hashCode + + ((getSearchedFace() == null) ? 0 : getSearchedFace().hashCode()); + hashCode = prime * hashCode + + ((getUnsearchedFaces() == null) ? 0 : getUnsearchedFaces().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchUsersByImageResult == false) + return false; + SearchUsersByImageResult other = (SearchUsersByImageResult) obj; + + if (other.getUserMatches() == null ^ this.getUserMatches() == null) + return false; + if (other.getUserMatches() != null + && other.getUserMatches().equals(this.getUserMatches()) == false) + return false; + if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null) + return false; + if (other.getFaceModelVersion() != null + && other.getFaceModelVersion().equals(this.getFaceModelVersion()) == false) + return false; + if (other.getSearchedFace() == null ^ this.getSearchedFace() == null) + return false; + if (other.getSearchedFace() != null + && other.getSearchedFace().equals(this.getSearchedFace()) == false) + return false; + if (other.getUnsearchedFaces() == null ^ this.getUnsearchedFaces() == null) + return false; + if (other.getUnsearchedFaces() != null + && other.getUnsearchedFaces().equals(this.getUnsearchedFaces()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersRequest.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersRequest.java new file mode 100644 index 0000000000..0b46ace937 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersRequest.java @@ -0,0 +1,461 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +import com.amazonaws.AmazonWebServiceRequest; + +/** + *

    + * Searches for UserIDs within a collection based on a FaceId or + * UserId. This API can be used to find the closest UserID (with a + * highest similarity) to associate a face. The request must be provided with + * either FaceId or UserId. The operation returns an + * array of UserID that match the FaceId or UserId, + * ordered by similarity score with the highest similarity first. + *

    + */ +public class SearchUsersRequest extends AmazonWebServiceRequest implements Serializable { + /** + *

    + * The ID of an existing collection containing the UserID, used with a + * UserId or FaceId. If a FaceId is provided, UserId isn’t required to be + * present in the Collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + */ + private String collectionId; + + /** + *

    + * ID for the existing User. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * ID for the existing face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * Optional value that specifies the minimum confidence in the matched + * UserID to return. Default value of 80. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + */ + private Float userMatchThreshold; + + /** + *

    + * Maximum number of identities to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + */ + private Integer maxUsers; + + /** + *

    + * The ID of an existing collection containing the UserID, used with a + * UserId or FaceId. If a FaceId is provided, UserId isn’t required to be + * present in the Collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @return

    + * The ID of an existing collection containing the UserID, used with + * a UserId or FaceId. If a FaceId is provided, UserId isn’t + * required to be present in the Collection. + *

    + */ + public String getCollectionId() { + return collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID, used with a + * UserId or FaceId. If a FaceId is provided, UserId isn’t required to be + * present in the Collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID, used + * with a UserId or FaceId. If a FaceId is provided, UserId isn’t + * required to be present in the Collection. + *

    + */ + public void setCollectionId(String collectionId) { + this.collectionId = collectionId; + } + + /** + *

    + * The ID of an existing collection containing the UserID, used with a + * UserId or FaceId. If a FaceId is provided, UserId isn’t required to be + * present in the Collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 255
    + * Pattern: [a-zA-Z0-9_.\-]+
    + * + * @param collectionId

    + * The ID of an existing collection containing the UserID, used + * with a UserId or FaceId. If a FaceId is provided, UserId isn’t + * required to be present in the Collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersRequest withCollectionId(String collectionId) { + this.collectionId = collectionId; + return this; + } + + /** + *

    + * ID for the existing User. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * ID for the existing User. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * ID for the existing User. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the existing User. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * ID for the existing User. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * ID for the existing User. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersRequest withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * ID for the existing face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * ID for the existing face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * ID for the existing face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * ID for the existing face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * ID for the existing face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * ID for the existing face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersRequest withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + *

    + * Optional value that specifies the minimum confidence in the matched + * UserID to return. Default value of 80. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @return

    + * Optional value that specifies the minimum confidence in the + * matched UserID to return. Default value of 80. + *

    + */ + public Float getUserMatchThreshold() { + return userMatchThreshold; + } + + /** + *

    + * Optional value that specifies the minimum confidence in the matched + * UserID to return. Default value of 80. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param userMatchThreshold

    + * Optional value that specifies the minimum confidence in the + * matched UserID to return. Default value of 80. + *

    + */ + public void setUserMatchThreshold(Float userMatchThreshold) { + this.userMatchThreshold = userMatchThreshold; + } + + /** + *

    + * Optional value that specifies the minimum confidence in the matched + * UserID to return. Default value of 80. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param userMatchThreshold

    + * Optional value that specifies the minimum confidence in the + * matched UserID to return. Default value of 80. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersRequest withUserMatchThreshold(Float userMatchThreshold) { + this.userMatchThreshold = userMatchThreshold; + return this; + } + + /** + *

    + * Maximum number of identities to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @return

    + * Maximum number of identities to return. + *

    + */ + public Integer getMaxUsers() { + return maxUsers; + } + + /** + *

    + * Maximum number of identities to return. + *

    + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @param maxUsers

    + * Maximum number of identities to return. + *

    + */ + public void setMaxUsers(Integer maxUsers) { + this.maxUsers = maxUsers; + } + + /** + *

    + * Maximum number of identities to return. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Range: 1 - 500
    + * + * @param maxUsers

    + * Maximum number of identities to return. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersRequest withMaxUsers(Integer maxUsers) { + this.maxUsers = maxUsers; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getCollectionId() != null) + sb.append("CollectionId: " + getCollectionId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId() + ","); + if (getUserMatchThreshold() != null) + sb.append("UserMatchThreshold: " + getUserMatchThreshold() + ","); + if (getMaxUsers() != null) + sb.append("MaxUsers: " + getMaxUsers()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getCollectionId() == null) ? 0 : getCollectionId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + hashCode = prime * hashCode + + ((getUserMatchThreshold() == null) ? 0 : getUserMatchThreshold().hashCode()); + hashCode = prime * hashCode + ((getMaxUsers() == null) ? 0 : getMaxUsers().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchUsersRequest == false) + return false; + SearchUsersRequest other = (SearchUsersRequest) obj; + + if (other.getCollectionId() == null ^ this.getCollectionId() == null) + return false; + if (other.getCollectionId() != null + && other.getCollectionId().equals(this.getCollectionId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + if (other.getUserMatchThreshold() == null ^ this.getUserMatchThreshold() == null) + return false; + if (other.getUserMatchThreshold() != null + && other.getUserMatchThreshold().equals(this.getUserMatchThreshold()) == false) + return false; + if (other.getMaxUsers() == null ^ this.getMaxUsers() == null) + return false; + if (other.getMaxUsers() != null && other.getMaxUsers().equals(this.getMaxUsers()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersResult.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersResult.java new file mode 100644 index 0000000000..1bedaba91c --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchUsersResult.java @@ -0,0 +1,364 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +public class SearchUsersResult implements Serializable { + /** + *

    + * An array of UserMatch objects that matched the input face along with the + * confidence in the match. Array will be empty if there are no matches. + *

    + */ + private java.util.List userMatches; + + /** + *

    + * Version number of the face detection model associated with the input + * CollectionId. + *

    + */ + private String faceModelVersion; + + /** + *

    + * Contains the ID of a face that was used to search for matches in a + * collection. + *

    + */ + private SearchedFace searchedFace; + + /** + *

    + * Contains the ID of the UserID that was used to search for matches in a + * collection. + *

    + */ + private SearchedUser searchedUser; + + /** + *

    + * An array of UserMatch objects that matched the input face along with the + * confidence in the match. Array will be empty if there are no matches. + *

    + * + * @return

    + * An array of UserMatch objects that matched the input face along + * with the confidence in the match. Array will be empty if there + * are no matches. + *

    + */ + public java.util.List getUserMatches() { + return userMatches; + } + + /** + *

    + * An array of UserMatch objects that matched the input face along with the + * confidence in the match. Array will be empty if there are no matches. + *

    + * + * @param userMatches

    + * An array of UserMatch objects that matched the input face + * along with the confidence in the match. Array will be empty if + * there are no matches. + *

    + */ + public void setUserMatches(java.util.Collection userMatches) { + if (userMatches == null) { + this.userMatches = null; + return; + } + + this.userMatches = new java.util.ArrayList(userMatches); + } + + /** + *

    + * An array of UserMatch objects that matched the input face along with the + * confidence in the match. Array will be empty if there are no matches. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param userMatches

    + * An array of UserMatch objects that matched the input face + * along with the confidence in the match. Array will be empty if + * there are no matches. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersResult withUserMatches(UserMatch... userMatches) { + if (getUserMatches() == null) { + this.userMatches = new java.util.ArrayList(userMatches.length); + } + for (UserMatch value : userMatches) { + this.userMatches.add(value); + } + return this; + } + + /** + *

    + * An array of UserMatch objects that matched the input face along with the + * confidence in the match. Array will be empty if there are no matches. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param userMatches

    + * An array of UserMatch objects that matched the input face + * along with the confidence in the match. Array will be empty if + * there are no matches. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersResult withUserMatches(java.util.Collection userMatches) { + setUserMatches(userMatches); + return this; + } + + /** + *

    + * Version number of the face detection model associated with the input + * CollectionId. + *

    + * + * @return

    + * Version number of the face detection model associated with the + * input CollectionId. + *

    + */ + public String getFaceModelVersion() { + return faceModelVersion; + } + + /** + *

    + * Version number of the face detection model associated with the input + * CollectionId. + *

    + * + * @param faceModelVersion

    + * Version number of the face detection model associated with the + * input CollectionId. + *

    + */ + public void setFaceModelVersion(String faceModelVersion) { + this.faceModelVersion = faceModelVersion; + } + + /** + *

    + * Version number of the face detection model associated with the input + * CollectionId. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceModelVersion

    + * Version number of the face detection model associated with the + * input CollectionId. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersResult withFaceModelVersion(String faceModelVersion) { + this.faceModelVersion = faceModelVersion; + return this; + } + + /** + *

    + * Contains the ID of a face that was used to search for matches in a + * collection. + *

    + * + * @return

    + * Contains the ID of a face that was used to search for matches in + * a collection. + *

    + */ + public SearchedFace getSearchedFace() { + return searchedFace; + } + + /** + *

    + * Contains the ID of a face that was used to search for matches in a + * collection. + *

    + * + * @param searchedFace

    + * Contains the ID of a face that was used to search for matches + * in a collection. + *

    + */ + public void setSearchedFace(SearchedFace searchedFace) { + this.searchedFace = searchedFace; + } + + /** + *

    + * Contains the ID of a face that was used to search for matches in a + * collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param searchedFace

    + * Contains the ID of a face that was used to search for matches + * in a collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersResult withSearchedFace(SearchedFace searchedFace) { + this.searchedFace = searchedFace; + return this; + } + + /** + *

    + * Contains the ID of the UserID that was used to search for matches in a + * collection. + *

    + * + * @return

    + * Contains the ID of the UserID that was used to search for matches + * in a collection. + *

    + */ + public SearchedUser getSearchedUser() { + return searchedUser; + } + + /** + *

    + * Contains the ID of the UserID that was used to search for matches in a + * collection. + *

    + * + * @param searchedUser

    + * Contains the ID of the UserID that was used to search for + * matches in a collection. + *

    + */ + public void setSearchedUser(SearchedUser searchedUser) { + this.searchedUser = searchedUser; + } + + /** + *

    + * Contains the ID of the UserID that was used to search for matches in a + * collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param searchedUser

    + * Contains the ID of the UserID that was used to search for + * matches in a collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchUsersResult withSearchedUser(SearchedUser searchedUser) { + this.searchedUser = searchedUser; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getUserMatches() != null) + sb.append("UserMatches: " + getUserMatches() + ","); + if (getFaceModelVersion() != null) + sb.append("FaceModelVersion: " + getFaceModelVersion() + ","); + if (getSearchedFace() != null) + sb.append("SearchedFace: " + getSearchedFace() + ","); + if (getSearchedUser() != null) + sb.append("SearchedUser: " + getSearchedUser()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getUserMatches() == null) ? 0 : getUserMatches().hashCode()); + hashCode = prime * hashCode + + ((getFaceModelVersion() == null) ? 0 : getFaceModelVersion().hashCode()); + hashCode = prime * hashCode + + ((getSearchedFace() == null) ? 0 : getSearchedFace().hashCode()); + hashCode = prime * hashCode + + ((getSearchedUser() == null) ? 0 : getSearchedUser().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchUsersResult == false) + return false; + SearchUsersResult other = (SearchUsersResult) obj; + + if (other.getUserMatches() == null ^ this.getUserMatches() == null) + return false; + if (other.getUserMatches() != null + && other.getUserMatches().equals(this.getUserMatches()) == false) + return false; + if (other.getFaceModelVersion() == null ^ this.getFaceModelVersion() == null) + return false; + if (other.getFaceModelVersion() != null + && other.getFaceModelVersion().equals(this.getFaceModelVersion()) == false) + return false; + if (other.getSearchedFace() == null ^ this.getSearchedFace() == null) + return false; + if (other.getSearchedFace() != null + && other.getSearchedFace().equals(this.getSearchedFace()) == false) + return false; + if (other.getSearchedUser() == null ^ this.getSearchedUser() == null) + return false; + if (other.getSearchedUser() != null + && other.getSearchedUser().equals(this.getSearchedUser()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedFace.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedFace.java new file mode 100644 index 0000000000..7781ed42d0 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedFace.java @@ -0,0 +1,138 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Provides face metadata such as FaceId, BoundingBox, Confidence of the input + * face used for search. + *

    + */ +public class SearchedFace implements Serializable { + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * Unique identifier assigned to the face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * Unique identifier assigned to the face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * Unique identifier assigned to the face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * Unique identifier assigned to the face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchedFace withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchedFace == false) + return false; + SearchedFace other = (SearchedFace) obj; + + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedFaceDetails.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedFaceDetails.java new file mode 100644 index 0000000000..f04b18eb61 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedFaceDetails.java @@ -0,0 +1,405 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Contains data regarding the input face used for a search. + *

    + */ +public class SearchedFaceDetails implements Serializable { + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + */ + private FaceDetail faceDetail; + + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + * + * @return

    + * Structure containing attributes of the face that the algorithm + * detected. + *

    + *

    + * A FaceDetail object contains either the default + * facial attributes or all facial attributes. The default + * attributes are BoundingBox, Confidence, + * Landmarks, Pose, and + * Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video + * stored video operation that can return a FaceDetail + * object with all attributes. To specify which attributes to + * return, use the FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding + * Start operations don't have a FaceAttributes input + * parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and + * IndexFaces operations can return all facial attributes. To + * specify which attributes to return, use the + * Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + */ + public FaceDetail getFaceDetail() { + return faceDetail; + } + + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + * + * @param faceDetail

    + * Structure containing attributes of the face that the algorithm + * detected. + *

    + *

    + * A FaceDetail object contains either the default + * facial attributes or all facial attributes. The default + * attributes are BoundingBox, + * Confidence, Landmarks, + * Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video + * stored video operation that can return a + * FaceDetail object with all attributes. To specify + * which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition + * Video operations return only the default attributes. The + * corresponding Start operations don't have a + * FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and + * IndexFaces operations can return all facial attributes. + * To specify which attributes to return, use the + * Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + */ + public void setFaceDetail(FaceDetail faceDetail) { + this.faceDetail = faceDetail; + } + + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceDetail

    + * Structure containing attributes of the face that the algorithm + * detected. + *

    + *

    + * A FaceDetail object contains either the default + * facial attributes or all facial attributes. The default + * attributes are BoundingBox, + * Confidence, Landmarks, + * Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video + * stored video operation that can return a + * FaceDetail object with all attributes. To specify + * which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition + * Video operations return only the default attributes. The + * corresponding Start operations don't have a + * FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and + * IndexFaces operations can return all facial attributes. + * To specify which attributes to return, use the + * Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchedFaceDetails withFaceDetail(FaceDetail faceDetail) { + this.faceDetail = faceDetail; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceDetail() != null) + sb.append("FaceDetail: " + getFaceDetail()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceDetail() == null) ? 0 : getFaceDetail().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchedFaceDetails == false) + return false; + SearchedFaceDetails other = (SearchedFaceDetails) obj; + + if (other.getFaceDetail() == null ^ this.getFaceDetail() == null) + return false; + if (other.getFaceDetail() != null + && other.getFaceDetail().equals(this.getFaceDetail()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedUser.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedUser.java new file mode 100644 index 0000000000..5bb0f0da86 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/SearchedUser.java @@ -0,0 +1,137 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Contains metadata about a User searched for within a collection. + *

    + */ +public class SearchedUser implements Serializable { + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public SearchedUser withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getUserId() != null) + sb.append("UserId: " + getUserId()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof SearchedUser == false) + return false; + SearchedUser other = (SearchedUser) obj; + + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsearchedFace.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsearchedFace.java new file mode 100644 index 0000000000..b396f686ad --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsearchedFace.java @@ -0,0 +1,495 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Face details inferred from the image but not used for search. The response + * attribute contains reasons for why a face wasn't used for Search. + *

    + */ +public class UnsearchedFace implements Serializable { + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + */ + private FaceDetail faceDetails; + + /** + *

    + * Reasons why a face wasn't used for Search. + *

    + */ + private java.util.List reasons; + + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + * + * @return

    + * Structure containing attributes of the face that the algorithm + * detected. + *

    + *

    + * A FaceDetail object contains either the default + * facial attributes or all facial attributes. The default + * attributes are BoundingBox, Confidence, + * Landmarks, Pose, and + * Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video + * stored video operation that can return a FaceDetail + * object with all attributes. To specify which attributes to + * return, use the FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding + * Start operations don't have a FaceAttributes input + * parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and + * IndexFaces operations can return all facial attributes. To + * specify which attributes to return, use the + * Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + */ + public FaceDetail getFaceDetails() { + return faceDetails; + } + + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + * + * @param faceDetails

    + * Structure containing attributes of the face that the algorithm + * detected. + *

    + *

    + * A FaceDetail object contains either the default + * facial attributes or all facial attributes. The default + * attributes are BoundingBox, + * Confidence, Landmarks, + * Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video + * stored video operation that can return a + * FaceDetail object with all attributes. To specify + * which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition + * Video operations return only the default attributes. The + * corresponding Start operations don't have a + * FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and + * IndexFaces operations can return all facial attributes. + * To specify which attributes to return, use the + * Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + */ + public void setFaceDetails(FaceDetail faceDetails) { + this.faceDetails = faceDetails; + } + + /** + *

    + * Structure containing attributes of the face that the algorithm detected. + *

    + *

    + * A FaceDetail object contains either the default facial + * attributes or all facial attributes. The default attributes are + * BoundingBox, Confidence, Landmarks, Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video stored video + * operation that can return a FaceDetail object with all + * attributes. To specify which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition Video + * operations return only the default attributes. The corresponding Start + * operations don't have a FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and IndexFaces + * operations can return all facial attributes. To specify which attributes + * to return, use the Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param faceDetails

    + * Structure containing attributes of the face that the algorithm + * detected. + *

    + *

    + * A FaceDetail object contains either the default + * facial attributes or all facial attributes. The default + * attributes are BoundingBox, + * Confidence, Landmarks, + * Pose, and Quality. + *

    + *

    + * GetFaceDetection is the only Amazon Rekognition Video + * stored video operation that can return a + * FaceDetail object with all attributes. To specify + * which attributes to return, use the + * FaceAttributes input parameter for + * StartFaceDetection. The following Amazon Rekognition + * Video operations return only the default attributes. The + * corresponding Start operations don't have a + * FaceAttributes input parameter: + *

    + *
      + *
    • + *

      + * GetCelebrityRecognition + *

      + *
    • + *
    • + *

      + * GetPersonTracking + *

      + *
    • + *
    • + *

      + * GetFaceSearch + *

      + *
    • + *
    + *

    + * The Amazon Rekognition Image DetectFaces and + * IndexFaces operations can return all facial attributes. + * To specify which attributes to return, use the + * Attributes input parameter for + * DetectFaces. For IndexFaces, use the + * DetectAttributes input parameter. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsearchedFace withFaceDetails(FaceDetail faceDetails) { + this.faceDetails = faceDetails; + return this; + } + + /** + *

    + * Reasons why a face wasn't used for Search. + *

    + * + * @return

    + * Reasons why a face wasn't used for Search. + *

    + */ + public java.util.List getReasons() { + return reasons; + } + + /** + *

    + * Reasons why a face wasn't used for Search. + *

    + * + * @param reasons

    + * Reasons why a face wasn't used for Search. + *

    + */ + public void setReasons(java.util.Collection reasons) { + if (reasons == null) { + this.reasons = null; + return; + } + + this.reasons = new java.util.ArrayList(reasons); + } + + /** + *

    + * Reasons why a face wasn't used for Search. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * Reasons why a face wasn't used for Search. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsearchedFace withReasons(String... reasons) { + if (getReasons() == null) { + this.reasons = new java.util.ArrayList(reasons.length); + } + for (String value : reasons) { + this.reasons.add(value); + } + return this; + } + + /** + *

    + * Reasons why a face wasn't used for Search. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * Reasons why a face wasn't used for Search. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsearchedFace withReasons(java.util.Collection reasons) { + setReasons(reasons); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceDetails() != null) + sb.append("FaceDetails: " + getFaceDetails() + ","); + if (getReasons() != null) + sb.append("Reasons: " + getReasons()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + + ((getFaceDetails() == null) ? 0 : getFaceDetails().hashCode()); + hashCode = prime * hashCode + ((getReasons() == null) ? 0 : getReasons().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UnsearchedFace == false) + return false; + UnsearchedFace other = (UnsearchedFace) obj; + + if (other.getFaceDetails() == null ^ this.getFaceDetails() == null) + return false; + if (other.getFaceDetails() != null + && other.getFaceDetails().equals(this.getFaceDetails()) == false) + return false; + if (other.getReasons() == null ^ this.getReasons() == null) + return false; + if (other.getReasons() != null && other.getReasons().equals(this.getReasons()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsearchedFaceReason.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsearchedFaceReason.java new file mode 100644 index 0000000000..a6ca78e7e2 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsearchedFaceReason.java @@ -0,0 +1,74 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Unsearched Face Reason + */ +public enum UnsearchedFaceReason { + + FACE_NOT_LARGEST("FACE_NOT_LARGEST"), + EXCEEDS_MAX_FACES("EXCEEDS_MAX_FACES"), + EXTREME_POSE("EXTREME_POSE"), + LOW_BRIGHTNESS("LOW_BRIGHTNESS"), + LOW_SHARPNESS("LOW_SHARPNESS"), + LOW_CONFIDENCE("LOW_CONFIDENCE"), + SMALL_BOUNDING_BOX("SMALL_BOUNDING_BOX"), + LOW_FACE_QUALITY("LOW_FACE_QUALITY"); + + private String value; + + private UnsearchedFaceReason(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("FACE_NOT_LARGEST", FACE_NOT_LARGEST); + enumMap.put("EXCEEDS_MAX_FACES", EXCEEDS_MAX_FACES); + enumMap.put("EXTREME_POSE", EXTREME_POSE); + enumMap.put("LOW_BRIGHTNESS", LOW_BRIGHTNESS); + enumMap.put("LOW_SHARPNESS", LOW_SHARPNESS); + enumMap.put("LOW_CONFIDENCE", LOW_CONFIDENCE); + enumMap.put("SMALL_BOUNDING_BOX", SMALL_BOUNDING_BOX); + enumMap.put("LOW_FACE_QUALITY", LOW_FACE_QUALITY); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return UnsearchedFaceReason corresponding to the value + */ + public static UnsearchedFaceReason fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceAssociation.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceAssociation.java new file mode 100644 index 0000000000..2e245a5350 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceAssociation.java @@ -0,0 +1,387 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Contains metadata like FaceId, UserID, and Reasons, for a face that was + * unsuccessfully associated. + *

    + */ +public class UnsuccessfulFaceAssociation implements Serializable { + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * Match confidence with the UserID, provides information regarding if a + * face association was unsuccessful because it didn't meet + * UserMatchThreshold. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + */ + private Float confidence; + + /** + *

    + * The reason why the association was unsuccessful. + *

    + */ + private java.util.List reasons; + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * A unique identifier assigned to the face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * A unique identifier assigned to the face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * A unique identifier assigned to the face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceAssociation withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceAssociation withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * Match confidence with the UserID, provides information regarding if a + * face association was unsuccessful because it didn't meet + * UserMatchThreshold. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @return

    + * Match confidence with the UserID, provides information regarding + * if a face association was unsuccessful because it didn't meet + * UserMatchThreshold. + *

    + */ + public Float getConfidence() { + return confidence; + } + + /** + *

    + * Match confidence with the UserID, provides information regarding if a + * face association was unsuccessful because it didn't meet + * UserMatchThreshold. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param confidence

    + * Match confidence with the UserID, provides information + * regarding if a face association was unsuccessful because it + * didn't meet UserMatchThreshold. + *

    + */ + public void setConfidence(Float confidence) { + this.confidence = confidence; + } + + /** + *

    + * Match confidence with the UserID, provides information regarding if a + * face association was unsuccessful because it didn't meet + * UserMatchThreshold. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param confidence

    + * Match confidence with the UserID, provides information + * regarding if a face association was unsuccessful because it + * didn't meet UserMatchThreshold. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceAssociation withConfidence(Float confidence) { + this.confidence = confidence; + return this; + } + + /** + *

    + * The reason why the association was unsuccessful. + *

    + * + * @return

    + * The reason why the association was unsuccessful. + *

    + */ + public java.util.List getReasons() { + return reasons; + } + + /** + *

    + * The reason why the association was unsuccessful. + *

    + * + * @param reasons

    + * The reason why the association was unsuccessful. + *

    + */ + public void setReasons(java.util.Collection reasons) { + if (reasons == null) { + this.reasons = null; + return; + } + + this.reasons = new java.util.ArrayList(reasons); + } + + /** + *

    + * The reason why the association was unsuccessful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * The reason why the association was unsuccessful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceAssociation withReasons(String... reasons) { + if (getReasons() == null) { + this.reasons = new java.util.ArrayList(reasons.length); + } + for (String value : reasons) { + this.reasons.add(value); + } + return this; + } + + /** + *

    + * The reason why the association was unsuccessful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * The reason why the association was unsuccessful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceAssociation withReasons(java.util.Collection reasons) { + setReasons(reasons); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getConfidence() != null) + sb.append("Confidence: " + getConfidence() + ","); + if (getReasons() != null) + sb.append("Reasons: " + getReasons()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); + hashCode = prime * hashCode + ((getReasons() == null) ? 0 : getReasons().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UnsuccessfulFaceAssociation == false) + return false; + UnsuccessfulFaceAssociation other = (UnsuccessfulFaceAssociation) obj; + + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getConfidence() == null ^ this.getConfidence() == null) + return false; + if (other.getConfidence() != null + && other.getConfidence().equals(this.getConfidence()) == false) + return false; + if (other.getReasons() == null ^ this.getReasons() == null) + return false; + if (other.getReasons() != null && other.getReasons().equals(this.getReasons()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceAssociationReason.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceAssociationReason.java new file mode 100644 index 0000000000..46d76aee7c --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceAssociationReason.java @@ -0,0 +1,64 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Unsuccessful Face Association Reason + */ +public enum UnsuccessfulFaceAssociationReason { + + FACE_NOT_FOUND("FACE_NOT_FOUND"), + ASSOCIATED_TO_A_DIFFERENT_USER("ASSOCIATED_TO_A_DIFFERENT_USER"), + LOW_MATCH_CONFIDENCE("LOW_MATCH_CONFIDENCE"); + + private String value; + + private UnsuccessfulFaceAssociationReason(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("FACE_NOT_FOUND", FACE_NOT_FOUND); + enumMap.put("ASSOCIATED_TO_A_DIFFERENT_USER", ASSOCIATED_TO_A_DIFFERENT_USER); + enumMap.put("LOW_MATCH_CONFIDENCE", LOW_MATCH_CONFIDENCE); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return UnsuccessfulFaceAssociationReason corresponding to the value + */ + public static UnsuccessfulFaceAssociationReason fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDeletion.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDeletion.java new file mode 100644 index 0000000000..57a2105ea8 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDeletion.java @@ -0,0 +1,301 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Contains metadata like FaceId, UserID, and Reasons, for a face that was + * unsuccessfully deleted. + *

    + */ +public class UnsuccessfulFaceDeletion implements Serializable { + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + */ + private java.util.List reasons; + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * A unique identifier assigned to the face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * A unique identifier assigned to the face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * A unique identifier assigned to the face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDeletion withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDeletion withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + * + * @return

    + * The reason why the deletion was unsuccessful. + *

    + */ + public java.util.List getReasons() { + return reasons; + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + * + * @param reasons

    + * The reason why the deletion was unsuccessful. + *

    + */ + public void setReasons(java.util.Collection reasons) { + if (reasons == null) { + this.reasons = null; + return; + } + + this.reasons = new java.util.ArrayList(reasons); + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * The reason why the deletion was unsuccessful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDeletion withReasons(String... reasons) { + if (getReasons() == null) { + this.reasons = new java.util.ArrayList(reasons.length); + } + for (String value : reasons) { + this.reasons.add(value); + } + return this; + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * The reason why the deletion was unsuccessful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDeletion withReasons(java.util.Collection reasons) { + setReasons(reasons); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getReasons() != null) + sb.append("Reasons: " + getReasons()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getReasons() == null) ? 0 : getReasons().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UnsuccessfulFaceDeletion == false) + return false; + UnsuccessfulFaceDeletion other = (UnsuccessfulFaceDeletion) obj; + + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getReasons() == null ^ this.getReasons() == null) + return false; + if (other.getReasons() != null && other.getReasons().equals(this.getReasons()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDeletionReason.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDeletionReason.java new file mode 100644 index 0000000000..0ddac527f7 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDeletionReason.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Unsuccessful Face Deletion Reason + */ +public enum UnsuccessfulFaceDeletionReason { + + ASSOCIATED_TO_AN_EXISTING_USER("ASSOCIATED_TO_AN_EXISTING_USER"), + FACE_NOT_FOUND("FACE_NOT_FOUND"); + + private String value; + + private UnsuccessfulFaceDeletionReason(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("ASSOCIATED_TO_AN_EXISTING_USER", ASSOCIATED_TO_AN_EXISTING_USER); + enumMap.put("FACE_NOT_FOUND", FACE_NOT_FOUND); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return UnsuccessfulFaceDeletionReason corresponding to the value + */ + public static UnsuccessfulFaceDeletionReason fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDisassociation.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDisassociation.java new file mode 100644 index 0000000000..6ab2d0869d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDisassociation.java @@ -0,0 +1,301 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Contains metadata like FaceId, UserID, and Reasons, for a face that was + * unsuccessfully disassociated. + *

    + */ +public class UnsuccessfulFaceDisassociation implements Serializable { + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + */ + private String faceId; + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + */ + private java.util.List reasons; + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @return

    + * A unique identifier assigned to the face. + *

    + */ + public String getFaceId() { + return faceId; + } + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * A unique identifier assigned to the face. + *

    + */ + public void setFaceId(String faceId) { + this.faceId = faceId; + } + + /** + *

    + * A unique identifier assigned to the face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Pattern: + * [0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
    + * + * @param faceId

    + * A unique identifier assigned to the face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDisassociation withFaceId(String faceId) { + this.faceId = faceId; + return this; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * A provided ID for the UserID. Unique within the collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the UserID. Unique within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDisassociation withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + * + * @return

    + * The reason why the deletion was unsuccessful. + *

    + */ + public java.util.List getReasons() { + return reasons; + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + * + * @param reasons

    + * The reason why the deletion was unsuccessful. + *

    + */ + public void setReasons(java.util.Collection reasons) { + if (reasons == null) { + this.reasons = null; + return; + } + + this.reasons = new java.util.ArrayList(reasons); + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * The reason why the deletion was unsuccessful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDisassociation withReasons(String... reasons) { + if (getReasons() == null) { + this.reasons = new java.util.ArrayList(reasons.length); + } + for (String value : reasons) { + this.reasons.add(value); + } + return this; + } + + /** + *

    + * The reason why the deletion was unsuccessful. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param reasons

    + * The reason why the deletion was unsuccessful. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UnsuccessfulFaceDisassociation withReasons(java.util.Collection reasons) { + setReasons(reasons); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getFaceId() != null) + sb.append("FaceId: " + getFaceId() + ","); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getReasons() != null) + sb.append("Reasons: " + getReasons()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getFaceId() == null) ? 0 : getFaceId().hashCode()); + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getReasons() == null) ? 0 : getReasons().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UnsuccessfulFaceDisassociation == false) + return false; + UnsuccessfulFaceDisassociation other = (UnsuccessfulFaceDisassociation) obj; + + if (other.getFaceId() == null ^ this.getFaceId() == null) + return false; + if (other.getFaceId() != null && other.getFaceId().equals(this.getFaceId()) == false) + return false; + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getReasons() == null ^ this.getReasons() == null) + return false; + if (other.getReasons() != null && other.getReasons().equals(this.getReasons()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDisassociationReason.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDisassociationReason.java new file mode 100644 index 0000000000..c7d6541ea6 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UnsuccessfulFaceDisassociationReason.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * Unsuccessful Face Disassociation Reason + */ +public enum UnsuccessfulFaceDisassociationReason { + + FACE_NOT_FOUND("FACE_NOT_FOUND"), + ASSOCIATED_TO_A_DIFFERENT_USER("ASSOCIATED_TO_A_DIFFERENT_USER"); + + private String value; + + private UnsuccessfulFaceDisassociationReason(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("FACE_NOT_FOUND", FACE_NOT_FOUND); + enumMap.put("ASSOCIATED_TO_A_DIFFERENT_USER", ASSOCIATED_TO_A_DIFFERENT_USER); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return UnsuccessfulFaceDisassociationReason corresponding to the value + */ + public static UnsuccessfulFaceDisassociationReason fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/User.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/User.java new file mode 100644 index 0000000000..18756951c0 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/User.java @@ -0,0 +1,263 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Metadata of the user stored in a collection. + *

    + */ +public class User implements Serializable { + /** + *

    + * A provided ID for the User. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + */ + private String userId; + + /** + *

    + * Communicates if the UserID has been updated with latest set of faces to + * be associated with the UserID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + */ + private String userStatus; + + /** + *

    + * A provided ID for the User. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @return

    + * A provided ID for the User. Unique within the collection. + *

    + */ + public String getUserId() { + return userId; + } + + /** + *

    + * A provided ID for the User. Unique within the collection. + *

    + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the User. Unique within the collection. + *

    + */ + public void setUserId(String userId) { + this.userId = userId; + } + + /** + *

    + * A provided ID for the User. Unique within the collection. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 1 - 128
    + * Pattern: [a-zA-Z0-9_.\-:]+
    + * + * @param userId

    + * A provided ID for the User. Unique within the collection. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public User withUserId(String userId) { + this.userId = userId; + return this; + } + + /** + *

    + * Communicates if the UserID has been updated with latest set of faces to + * be associated with the UserID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @return

    + * Communicates if the UserID has been updated with latest set of + * faces to be associated with the UserID. + *

    + * @see UserStatus + */ + public String getUserStatus() { + return userStatus; + } + + /** + *

    + * Communicates if the UserID has been updated with latest set of faces to + * be associated with the UserID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * Communicates if the UserID has been updated with latest set of + * faces to be associated with the UserID. + *

    + * @see UserStatus + */ + public void setUserStatus(String userStatus) { + this.userStatus = userStatus; + } + + /** + *

    + * Communicates if the UserID has been updated with latest set of faces to + * be associated with the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * Communicates if the UserID has been updated with latest set of + * faces to be associated with the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public User withUserStatus(String userStatus) { + this.userStatus = userStatus; + return this; + } + + /** + *

    + * Communicates if the UserID has been updated with latest set of faces to + * be associated with the UserID. + *

    + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * Communicates if the UserID has been updated with latest set of + * faces to be associated with the UserID. + *

    + * @see UserStatus + */ + public void setUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + } + + /** + *

    + * Communicates if the UserID has been updated with latest set of faces to + * be associated with the UserID. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Allowed Values: ACTIVE, UPDATING, CREATING, CREATED + * + * @param userStatus

    + * Communicates if the UserID has been updated with latest set of + * faces to be associated with the UserID. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + * @see UserStatus + */ + public User withUserStatus(UserStatus userStatus) { + this.userStatus = userStatus.toString(); + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getUserId() != null) + sb.append("UserId: " + getUserId() + ","); + if (getUserStatus() != null) + sb.append("UserStatus: " + getUserStatus()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getUserId() == null) ? 0 : getUserId().hashCode()); + hashCode = prime * hashCode + ((getUserStatus() == null) ? 0 : getUserStatus().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof User == false) + return false; + User other = (User) obj; + + if (other.getUserId() == null ^ this.getUserId() == null) + return false; + if (other.getUserId() != null && other.getUserId().equals(this.getUserId()) == false) + return false; + if (other.getUserStatus() == null ^ this.getUserStatus() == null) + return false; + if (other.getUserStatus() != null + && other.getUserStatus().equals(this.getUserStatus()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UserMatch.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UserMatch.java new file mode 100644 index 0000000000..72cb0b3cb4 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UserMatch.java @@ -0,0 +1,194 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.io.Serializable; + +/** + *

    + * Provides UserID metadata along with the confidence in the match of this + * UserID with the input face. + *

    + */ +public class UserMatch implements Serializable { + /** + *

    + * Describes the UserID metadata. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + */ + private Float similarity; + + /** + *

    + * Confidence in the match of this UserID with the input face. + *

    + */ + private MatchedUser user; + + /** + *

    + * Describes the UserID metadata. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @return

    + * Describes the UserID metadata. + *

    + */ + public Float getSimilarity() { + return similarity; + } + + /** + *

    + * Describes the UserID metadata. + *

    + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param similarity

    + * Describes the UserID metadata. + *

    + */ + public void setSimilarity(Float similarity) { + this.similarity = similarity; + } + + /** + *

    + * Describes the UserID metadata. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + *

    + * Constraints:
    + * Length: 0.0 - 100.0
    + * + * @param similarity

    + * Describes the UserID metadata. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UserMatch withSimilarity(Float similarity) { + this.similarity = similarity; + return this; + } + + /** + *

    + * Confidence in the match of this UserID with the input face. + *

    + * + * @return

    + * Confidence in the match of this UserID with the input face. + *

    + */ + public MatchedUser getUser() { + return user; + } + + /** + *

    + * Confidence in the match of this UserID with the input face. + *

    + * + * @param user

    + * Confidence in the match of this UserID with the input face. + *

    + */ + public void setUser(MatchedUser user) { + this.user = user; + } + + /** + *

    + * Confidence in the match of this UserID with the input face. + *

    + *

    + * Returns a reference to this object so that method calls can be chained + * together. + * + * @param user

    + * Confidence in the match of this UserID with the input face. + *

    + * @return A reference to this updated object so that method calls can be + * chained together. + */ + public UserMatch withUser(MatchedUser user) { + this.user = user; + return this; + } + + /** + * Returns a string representation of this object; useful for testing and + * debugging. + * + * @return A string representation of this object. + * @see java.lang.Object#toString() + */ + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("{"); + if (getSimilarity() != null) + sb.append("Similarity: " + getSimilarity() + ","); + if (getUser() != null) + sb.append("User: " + getUser()); + sb.append("}"); + return sb.toString(); + } + + @Override + public int hashCode() { + final int prime = 31; + int hashCode = 1; + + hashCode = prime * hashCode + ((getSimilarity() == null) ? 0 : getSimilarity().hashCode()); + hashCode = prime * hashCode + ((getUser() == null) ? 0 : getUser().hashCode()); + return hashCode; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) + return true; + if (obj == null) + return false; + + if (obj instanceof UserMatch == false) + return false; + UserMatch other = (UserMatch) obj; + + if (other.getSimilarity() == null ^ this.getSimilarity() == null) + return false; + if (other.getSimilarity() != null + && other.getSimilarity().equals(this.getSimilarity()) == false) + return false; + if (other.getUser() == null ^ this.getUser() == null) + return false; + if (other.getUser() != null && other.getUser().equals(this.getUser()) == false) + return false; + return true; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UserStatus.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UserStatus.java new file mode 100644 index 0000000000..d4405ca39b --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/UserStatus.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 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.rekognition.model; + +import java.util.HashMap; +import java.util.Map; + +/** + * User Status + */ +public enum UserStatus { + + ACTIVE("ACTIVE"), + UPDATING("UPDATING"), + CREATING("CREATING"), + CREATED("CREATED"); + + private String value; + + private UserStatus(String value) { + this.value = value; + } + + @Override + public String toString() { + return value; + } + + private static final Map enumMap; + static { + enumMap = new HashMap(); + enumMap.put("ACTIVE", ACTIVE); + enumMap.put("UPDATING", UPDATING); + enumMap.put("CREATING", CREATING); + enumMap.put("CREATED", CREATED); + } + + /** + * Use this in place of valueOf. + * + * @param value real value + * @return UserStatus corresponding to the value + */ + public static UserStatus fromValue(String value) { + if (value == null || value.isEmpty()) { + throw new IllegalArgumentException("Value cannot be null or empty!"); + } else if (enumMap.containsKey(value)) { + return enumMap.get(value); + } else { + throw new IllegalArgumentException("Cannot create enum from " + value + " value!"); + } + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociateFacesRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociateFacesRequestMarshaller.java new file mode 100644 index 0000000000..e28670f620 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociateFacesRequestMarshaller.java @@ -0,0 +1,113 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for AssociateFacesRequest + */ +public class AssociateFacesRequestMarshaller implements + Marshaller, AssociateFacesRequest> { + + public Request marshall(AssociateFacesRequest associateFacesRequest) { + if (associateFacesRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(AssociateFacesRequest)"); + } + + Request request = new DefaultRequest( + associateFacesRequest, "AmazonRekognition"); + String target = "RekognitionService.AssociateFaces"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (associateFacesRequest.getCollectionId() != null) { + String collectionId = associateFacesRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (associateFacesRequest.getUserId() != null) { + String userId = associateFacesRequest.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (associateFacesRequest.getFaceIds() != null) { + java.util.List faceIds = associateFacesRequest.getFaceIds(); + jsonWriter.name("FaceIds"); + jsonWriter.beginArray(); + for (String faceIdsItem : faceIds) { + if (faceIdsItem != null) { + jsonWriter.value(faceIdsItem); + } + } + jsonWriter.endArray(); + } + if (associateFacesRequest.getUserMatchThreshold() != null) { + Float userMatchThreshold = associateFacesRequest.getUserMatchThreshold(); + jsonWriter.name("UserMatchThreshold"); + jsonWriter.value(userMatchThreshold); + } + if (associateFacesRequest.getClientRequestToken() != null) { + String clientRequestToken = associateFacesRequest.getClientRequestToken(); + jsonWriter.name("ClientRequestToken"); + jsonWriter.value(clientRequestToken); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociateFacesResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociateFacesResultJsonUnmarshaller.java new file mode 100644 index 0000000000..e1d2216c2b --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociateFacesResultJsonUnmarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response AssociateFacesResult + */ +public class AssociateFacesResultJsonUnmarshaller implements + Unmarshaller { + + public AssociateFacesResult unmarshall(JsonUnmarshallerContext context) throws Exception { + AssociateFacesResult associateFacesResult = new AssociateFacesResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("AssociatedFaces")) { + associateFacesResult.setAssociatedFaces(new ListUnmarshaller( + AssociatedFaceJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("UnsuccessfulFaceAssociations")) { + associateFacesResult + .setUnsuccessfulFaceAssociations(new ListUnmarshaller( + UnsuccessfulFaceAssociationJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("UserStatus")) { + associateFacesResult.setUserStatus(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return associateFacesResult; + } + + private static AssociateFacesResultJsonUnmarshaller instance; + + public static AssociateFacesResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AssociateFacesResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociatedFaceJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociatedFaceJsonMarshaller.java new file mode 100644 index 0000000000..2523894cc6 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociatedFaceJsonMarshaller.java @@ -0,0 +1,44 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO AssociatedFace + */ +class AssociatedFaceJsonMarshaller { + + public void marshall(AssociatedFace associatedFace, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (associatedFace.getFaceId() != null) { + String faceId = associatedFace.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + jsonWriter.endObject(); + } + + private static AssociatedFaceJsonMarshaller instance; + + public static AssociatedFaceJsonMarshaller getInstance() { + if (instance == null) + instance = new AssociatedFaceJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociatedFaceJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociatedFaceJsonUnmarshaller.java new file mode 100644 index 0000000000..4e9913a6de --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/AssociatedFaceJsonUnmarshaller.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO AssociatedFace + */ +class AssociatedFaceJsonUnmarshaller implements + Unmarshaller { + + public AssociatedFace unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + AssociatedFace associatedFace = new AssociatedFace(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceId")) { + associatedFace.setFaceId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return associatedFace; + } + + private static AssociatedFaceJsonUnmarshaller instance; + + public static AssociatedFaceJsonUnmarshaller getInstance() { + if (instance == null) + instance = new AssociatedFaceJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ConflictExceptionUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ConflictExceptionUnmarshaller.java new file mode 100644 index 0000000000..3799446e38 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ConflictExceptionUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.AmazonServiceException; +import com.amazonaws.http.JsonErrorResponseHandler.JsonErrorResponse; +import com.amazonaws.transform.JsonErrorUnmarshaller; +import com.amazonaws.services.rekognition.model.ConflictException; + +public class ConflictExceptionUnmarshaller extends JsonErrorUnmarshaller { + + public ConflictExceptionUnmarshaller() { + super(ConflictException.class); + } + + @Override + public boolean match(JsonErrorResponse error) throws Exception { + return error.getErrorCode().equals("ConflictException"); + } + + @Override + public AmazonServiceException unmarshall(JsonErrorResponse error) throws Exception { + + ConflictException e = (ConflictException) super.unmarshall(error); + e.setErrorCode("ConflictException"); + + return e; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CreateUserRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CreateUserRequestMarshaller.java new file mode 100644 index 0000000000..604d52de50 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CreateUserRequestMarshaller.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for CreateUserRequest + */ +public class CreateUserRequestMarshaller implements + Marshaller, CreateUserRequest> { + + public Request marshall(CreateUserRequest createUserRequest) { + if (createUserRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(CreateUserRequest)"); + } + + Request request = new DefaultRequest( + createUserRequest, "AmazonRekognition"); + String target = "RekognitionService.CreateUser"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (createUserRequest.getCollectionId() != null) { + String collectionId = createUserRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (createUserRequest.getUserId() != null) { + String userId = createUserRequest.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (createUserRequest.getClientRequestToken() != null) { + String clientRequestToken = createUserRequest.getClientRequestToken(); + jsonWriter.name("ClientRequestToken"); + jsonWriter.value(clientRequestToken); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CreateUserResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CreateUserResultJsonUnmarshaller.java new file mode 100644 index 0000000000..c978748bc7 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/CreateUserResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response CreateUserResult + */ +public class CreateUserResultJsonUnmarshaller implements + Unmarshaller { + + public CreateUserResult unmarshall(JsonUnmarshallerContext context) throws Exception { + CreateUserResult createUserResult = new CreateUserResult(); + + return createUserResult; + } + + private static CreateUserResultJsonUnmarshaller instance; + + public static CreateUserResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new CreateUserResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteFacesResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteFacesResultJsonUnmarshaller.java index 8dd9d9d8e0..729b395aec 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteFacesResultJsonUnmarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteFacesResultJsonUnmarshaller.java @@ -38,6 +38,12 @@ public DeleteFacesResult unmarshall(JsonUnmarshallerContext context) throws Exce StringJsonUnmarshaller.getInstance() ) .unmarshall(context)); + } else if (name.equals("UnsuccessfulFaceDeletions")) { + deleteFacesResult + .setUnsuccessfulFaceDeletions(new ListUnmarshaller( + UnsuccessfulFaceDeletionJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteUserRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteUserRequestMarshaller.java new file mode 100644 index 0000000000..32c9929991 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteUserRequestMarshaller.java @@ -0,0 +1,97 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DeleteUserRequest + */ +public class DeleteUserRequestMarshaller implements + Marshaller, DeleteUserRequest> { + + public Request marshall(DeleteUserRequest deleteUserRequest) { + if (deleteUserRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DeleteUserRequest)"); + } + + Request request = new DefaultRequest( + deleteUserRequest, "AmazonRekognition"); + String target = "RekognitionService.DeleteUser"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (deleteUserRequest.getCollectionId() != null) { + String collectionId = deleteUserRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (deleteUserRequest.getUserId() != null) { + String userId = deleteUserRequest.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (deleteUserRequest.getClientRequestToken() != null) { + String clientRequestToken = deleteUserRequest.getClientRequestToken(); + jsonWriter.name("ClientRequestToken"); + jsonWriter.value(clientRequestToken); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteUserResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteUserResultJsonUnmarshaller.java new file mode 100644 index 0000000000..94fa4f1ada --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DeleteUserResultJsonUnmarshaller.java @@ -0,0 +1,42 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DeleteUserResult + */ +public class DeleteUserResultJsonUnmarshaller implements + Unmarshaller { + + public DeleteUserResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DeleteUserResult deleteUserResult = new DeleteUserResult(); + + return deleteUserResult; + } + + private static DeleteUserResultJsonUnmarshaller instance; + + public static DeleteUserResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DeleteUserResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DescribeCollectionResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DescribeCollectionResultJsonUnmarshaller.java index a9b7efbbbf..b7f5fdc753 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DescribeCollectionResultJsonUnmarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DescribeCollectionResultJsonUnmarshaller.java @@ -45,6 +45,9 @@ public DescribeCollectionResult unmarshall(JsonUnmarshallerContext context) thro } else if (name.equals("CreationTimestamp")) { describeCollectionResult.setCreationTimestamp(DateJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("UserCount")) { + describeCollectionResult.setUserCount(LongJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociateFacesRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociateFacesRequestMarshaller.java new file mode 100644 index 0000000000..177828da75 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociateFacesRequestMarshaller.java @@ -0,0 +1,109 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for DisassociateFacesRequest + */ +public class DisassociateFacesRequestMarshaller implements + Marshaller, DisassociateFacesRequest> { + + public Request marshall( + DisassociateFacesRequest disassociateFacesRequest) { + if (disassociateFacesRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(DisassociateFacesRequest)"); + } + + Request request = new DefaultRequest( + disassociateFacesRequest, "AmazonRekognition"); + String target = "RekognitionService.DisassociateFaces"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (disassociateFacesRequest.getCollectionId() != null) { + String collectionId = disassociateFacesRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (disassociateFacesRequest.getUserId() != null) { + String userId = disassociateFacesRequest.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (disassociateFacesRequest.getClientRequestToken() != null) { + String clientRequestToken = disassociateFacesRequest.getClientRequestToken(); + jsonWriter.name("ClientRequestToken"); + jsonWriter.value(clientRequestToken); + } + if (disassociateFacesRequest.getFaceIds() != null) { + java.util.List faceIds = disassociateFacesRequest.getFaceIds(); + jsonWriter.name("FaceIds"); + jsonWriter.beginArray(); + for (String faceIdsItem : faceIds) { + if (faceIdsItem != null) { + jsonWriter.value(faceIdsItem); + } + } + jsonWriter.endArray(); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociateFacesResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociateFacesResultJsonUnmarshaller.java new file mode 100644 index 0000000000..236bc4a7a4 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociateFacesResultJsonUnmarshaller.java @@ -0,0 +1,67 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response DisassociateFacesResult + */ +public class DisassociateFacesResultJsonUnmarshaller implements + Unmarshaller { + + public DisassociateFacesResult unmarshall(JsonUnmarshallerContext context) throws Exception { + DisassociateFacesResult disassociateFacesResult = new DisassociateFacesResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("DisassociatedFaces")) { + disassociateFacesResult + .setDisassociatedFaces(new ListUnmarshaller( + DisassociatedFaceJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("UnsuccessfulFaceDisassociations")) { + disassociateFacesResult + .setUnsuccessfulFaceDisassociations(new ListUnmarshaller( + UnsuccessfulFaceDisassociationJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("UserStatus")) { + disassociateFacesResult.setUserStatus(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return disassociateFacesResult; + } + + private static DisassociateFacesResultJsonUnmarshaller instance; + + public static DisassociateFacesResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DisassociateFacesResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociatedFaceJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociatedFaceJsonMarshaller.java new file mode 100644 index 0000000000..6961390e92 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociatedFaceJsonMarshaller.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO DisassociatedFace + */ +class DisassociatedFaceJsonMarshaller { + + public void marshall(DisassociatedFace disassociatedFace, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (disassociatedFace.getFaceId() != null) { + String faceId = disassociatedFace.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + jsonWriter.endObject(); + } + + private static DisassociatedFaceJsonMarshaller instance; + + public static DisassociatedFaceJsonMarshaller getInstance() { + if (instance == null) + instance = new DisassociatedFaceJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociatedFaceJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociatedFaceJsonUnmarshaller.java new file mode 100644 index 0000000000..60329fe5ce --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/DisassociatedFaceJsonUnmarshaller.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO DisassociatedFace + */ +class DisassociatedFaceJsonUnmarshaller implements + Unmarshaller { + + public DisassociatedFace unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + DisassociatedFace disassociatedFace = new DisassociatedFace(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceId")) { + disassociatedFace.setFaceId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return disassociatedFace; + } + + private static DisassociatedFaceJsonUnmarshaller instance; + + public static DisassociatedFaceJsonUnmarshaller getInstance() { + if (instance == null) + instance = new DisassociatedFaceJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonMarshaller.java index 8470a75096..e4851f0bca 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonMarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonMarshaller.java @@ -56,6 +56,11 @@ public void marshall(Face face, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.name("IndexFacesModelVersion"); jsonWriter.value(indexFacesModelVersion); } + if (face.getUserId() != null) { + String userId = face.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } jsonWriter.endObject(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonUnmarshaller.java index 19a6b471f8..27a26d062e 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonUnmarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/FaceJsonUnmarshaller.java @@ -53,6 +53,9 @@ public Face unmarshall(JsonUnmarshallerContext context) throws Exception { } else if (name.equals("IndexFacesModelVersion")) { face.setIndexFacesModelVersion(StringJsonUnmarshaller.getInstance() .unmarshall(context)); + } else if (name.equals("UserId")) { + face.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); } else { reader.skipValue(); } diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListFacesRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListFacesRequestMarshaller.java index 8ae80d7ca5..1ba2508ead 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListFacesRequestMarshaller.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListFacesRequestMarshaller.java @@ -76,6 +76,22 @@ public Request marshall(ListFacesRequest listFacesRequest) { jsonWriter.name("MaxResults"); jsonWriter.value(maxResults); } + if (listFacesRequest.getUserId() != null) { + String userId = listFacesRequest.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (listFacesRequest.getFaceIds() != null) { + java.util.List faceIds = listFacesRequest.getFaceIds(); + jsonWriter.name("FaceIds"); + jsonWriter.beginArray(); + for (String faceIdsItem : faceIds) { + if (faceIdsItem != null) { + jsonWriter.value(faceIdsItem); + } + } + jsonWriter.endArray(); + } jsonWriter.endObject(); jsonWriter.close(); diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListUsersRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListUsersRequestMarshaller.java new file mode 100644 index 0000000000..52d2cfd6c0 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListUsersRequestMarshaller.java @@ -0,0 +1,96 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for ListUsersRequest + */ +public class ListUsersRequestMarshaller implements + Marshaller, ListUsersRequest> { + + public Request marshall(ListUsersRequest listUsersRequest) { + if (listUsersRequest == null) { + throw new AmazonClientException("Invalid argument passed to marshall(ListUsersRequest)"); + } + + Request request = new DefaultRequest(listUsersRequest, + "AmazonRekognition"); + String target = "RekognitionService.ListUsers"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (listUsersRequest.getCollectionId() != null) { + String collectionId = listUsersRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (listUsersRequest.getMaxResults() != null) { + Integer maxResults = listUsersRequest.getMaxResults(); + jsonWriter.name("MaxResults"); + jsonWriter.value(maxResults); + } + if (listUsersRequest.getNextToken() != null) { + String nextToken = listUsersRequest.getNextToken(); + jsonWriter.name("NextToken"); + jsonWriter.value(nextToken); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListUsersResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListUsersResultJsonUnmarshaller.java new file mode 100644 index 0000000000..763e412027 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/ListUsersResultJsonUnmarshaller.java @@ -0,0 +1,60 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response ListUsersResult + */ +public class ListUsersResultJsonUnmarshaller implements + Unmarshaller { + + public ListUsersResult unmarshall(JsonUnmarshallerContext context) throws Exception { + ListUsersResult listUsersResult = new ListUsersResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Users")) { + listUsersResult.setUsers(new ListUnmarshaller(UserJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else if (name.equals("NextToken")) { + listUsersResult.setNextToken(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return listUsersResult; + } + + private static ListUsersResultJsonUnmarshaller instance; + + public static ListUsersResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new ListUsersResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MatchedUserJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MatchedUserJsonMarshaller.java new file mode 100644 index 0000000000..9e03be6a69 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MatchedUserJsonMarshaller.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO MatchedUser + */ +class MatchedUserJsonMarshaller { + + public void marshall(MatchedUser matchedUser, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (matchedUser.getUserId() != null) { + String userId = matchedUser.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (matchedUser.getUserStatus() != null) { + String userStatus = matchedUser.getUserStatus(); + jsonWriter.name("UserStatus"); + jsonWriter.value(userStatus); + } + jsonWriter.endObject(); + } + + private static MatchedUserJsonMarshaller instance; + + public static MatchedUserJsonMarshaller getInstance() { + if (instance == null) + instance = new MatchedUserJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MatchedUserJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MatchedUserJsonUnmarshaller.java new file mode 100644 index 0000000000..8c8d243556 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/MatchedUserJsonUnmarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO MatchedUser + */ +class MatchedUserJsonUnmarshaller implements Unmarshaller { + + public MatchedUser unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + MatchedUser matchedUser = new MatchedUser(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("UserId")) { + matchedUser.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("UserStatus")) { + matchedUser.setUserStatus(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return matchedUser; + } + + private static MatchedUserJsonUnmarshaller instance; + + public static MatchedUserJsonUnmarshaller getInstance() { + if (instance == null) + instance = new MatchedUserJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersByImageRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersByImageRequestMarshaller.java new file mode 100644 index 0000000000..431dac961d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersByImageRequestMarshaller.java @@ -0,0 +1,108 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for SearchUsersByImageRequest + */ +public class SearchUsersByImageRequestMarshaller implements + Marshaller, SearchUsersByImageRequest> { + + public Request marshall( + SearchUsersByImageRequest searchUsersByImageRequest) { + if (searchUsersByImageRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(SearchUsersByImageRequest)"); + } + + Request request = new DefaultRequest( + searchUsersByImageRequest, "AmazonRekognition"); + String target = "RekognitionService.SearchUsersByImage"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (searchUsersByImageRequest.getCollectionId() != null) { + String collectionId = searchUsersByImageRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (searchUsersByImageRequest.getImage() != null) { + Image image = searchUsersByImageRequest.getImage(); + jsonWriter.name("Image"); + ImageJsonMarshaller.getInstance().marshall(image, jsonWriter); + } + if (searchUsersByImageRequest.getUserMatchThreshold() != null) { + Float userMatchThreshold = searchUsersByImageRequest.getUserMatchThreshold(); + jsonWriter.name("UserMatchThreshold"); + jsonWriter.value(userMatchThreshold); + } + if (searchUsersByImageRequest.getMaxUsers() != null) { + Integer maxUsers = searchUsersByImageRequest.getMaxUsers(); + jsonWriter.name("MaxUsers"); + jsonWriter.value(maxUsers); + } + if (searchUsersByImageRequest.getQualityFilter() != null) { + String qualityFilter = searchUsersByImageRequest.getQualityFilter(); + jsonWriter.name("QualityFilter"); + jsonWriter.value(qualityFilter); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersByImageResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersByImageResultJsonUnmarshaller.java new file mode 100644 index 0000000000..e7e9116452 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersByImageResultJsonUnmarshaller.java @@ -0,0 +1,69 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response SearchUsersByImageResult + */ +public class SearchUsersByImageResultJsonUnmarshaller implements + Unmarshaller { + + public SearchUsersByImageResult unmarshall(JsonUnmarshallerContext context) throws Exception { + SearchUsersByImageResult searchUsersByImageResult = new SearchUsersByImageResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("UserMatches")) { + searchUsersByImageResult.setUserMatches(new ListUnmarshaller( + UserMatchJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("FaceModelVersion")) { + searchUsersByImageResult.setFaceModelVersion(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("SearchedFace")) { + searchUsersByImageResult.setSearchedFace(SearchedFaceDetailsJsonUnmarshaller + .getInstance() + .unmarshall(context)); + } else if (name.equals("UnsearchedFaces")) { + searchUsersByImageResult.setUnsearchedFaces(new ListUnmarshaller( + UnsearchedFaceJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return searchUsersByImageResult; + } + + private static SearchUsersByImageResultJsonUnmarshaller instance; + + public static SearchUsersByImageResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new SearchUsersByImageResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersRequestMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersRequestMarshaller.java new file mode 100644 index 0000000000..44a028b8eb --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersRequestMarshaller.java @@ -0,0 +1,107 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import static com.amazonaws.util.StringUtils.UTF8; +import java.io.ByteArrayInputStream; +import java.io.ByteArrayOutputStream; +import java.io.OutputStreamWriter; +import java.io.StringWriter; +import java.io.Writer; + +import android.text.TextUtils; + +import com.amazonaws.AmazonClientException; +import com.amazonaws.Request; +import com.amazonaws.DefaultRequest; +import com.amazonaws.http.HttpMethodName; +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.Marshaller; +import com.amazonaws.util.BinaryUtils; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.StringUtils; +import com.amazonaws.util.StringInputStream; +import com.amazonaws.util.json.AwsJsonWriter; +import com.amazonaws.util.json.JsonUtils; + +/** + * JSON request marshaller for SearchUsersRequest + */ +public class SearchUsersRequestMarshaller implements + Marshaller, SearchUsersRequest> { + + public Request marshall(SearchUsersRequest searchUsersRequest) { + if (searchUsersRequest == null) { + throw new AmazonClientException( + "Invalid argument passed to marshall(SearchUsersRequest)"); + } + + Request request = new DefaultRequest( + searchUsersRequest, "AmazonRekognition"); + String target = "RekognitionService.SearchUsers"; + request.addHeader("X-Amz-Target", target); + request.setHttpMethod(HttpMethodName.POST); + + String uriResourcePath = "/"; + request.setResourcePath(uriResourcePath); + try { + StringWriter stringWriter = new StringWriter(); + AwsJsonWriter jsonWriter = JsonUtils.getJsonWriter(stringWriter); + jsonWriter.beginObject(); + + if (searchUsersRequest.getCollectionId() != null) { + String collectionId = searchUsersRequest.getCollectionId(); + jsonWriter.name("CollectionId"); + jsonWriter.value(collectionId); + } + if (searchUsersRequest.getUserId() != null) { + String userId = searchUsersRequest.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (searchUsersRequest.getFaceId() != null) { + String faceId = searchUsersRequest.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + if (searchUsersRequest.getUserMatchThreshold() != null) { + Float userMatchThreshold = searchUsersRequest.getUserMatchThreshold(); + jsonWriter.name("UserMatchThreshold"); + jsonWriter.value(userMatchThreshold); + } + if (searchUsersRequest.getMaxUsers() != null) { + Integer maxUsers = searchUsersRequest.getMaxUsers(); + jsonWriter.name("MaxUsers"); + jsonWriter.value(maxUsers); + } + + jsonWriter.endObject(); + jsonWriter.close(); + String snippet = stringWriter.toString(); + byte[] content = snippet.getBytes(UTF8); + request.setContent(new StringInputStream(snippet)); + request.addHeader("Content-Length", Integer.toString(content.length)); + } catch (Throwable t) { + throw new AmazonClientException( + "Unable to marshall request to JSON: " + t.getMessage(), t); + } + if (!request.getHeaders().containsKey("Content-Type")) { + request.addHeader("Content-Type", "application/x-amz-json-1.1"); + } + + return request; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersResultJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersResultJsonUnmarshaller.java new file mode 100644 index 0000000000..a321a8c42d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchUsersResultJsonUnmarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for response SearchUsersResult + */ +public class SearchUsersResultJsonUnmarshaller implements + Unmarshaller { + + public SearchUsersResult unmarshall(JsonUnmarshallerContext context) throws Exception { + SearchUsersResult searchUsersResult = new SearchUsersResult(); + + AwsJsonReader reader = context.getReader(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("UserMatches")) { + searchUsersResult.setUserMatches(new ListUnmarshaller( + UserMatchJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else if (name.equals("FaceModelVersion")) { + searchUsersResult.setFaceModelVersion(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("SearchedFace")) { + searchUsersResult.setSearchedFace(SearchedFaceJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("SearchedUser")) { + searchUsersResult.setSearchedUser(SearchedUserJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + + return searchUsersResult; + } + + private static SearchUsersResultJsonUnmarshaller instance; + + public static SearchUsersResultJsonUnmarshaller getInstance() { + if (instance == null) + instance = new SearchUsersResultJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceDetailsJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceDetailsJsonMarshaller.java new file mode 100644 index 0000000000..4932848fa7 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceDetailsJsonMarshaller.java @@ -0,0 +1,45 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO SearchedFaceDetails + */ +class SearchedFaceDetailsJsonMarshaller { + + public void marshall(SearchedFaceDetails searchedFaceDetails, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (searchedFaceDetails.getFaceDetail() != null) { + FaceDetail faceDetail = searchedFaceDetails.getFaceDetail(); + jsonWriter.name("FaceDetail"); + FaceDetailJsonMarshaller.getInstance().marshall(faceDetail, jsonWriter); + } + jsonWriter.endObject(); + } + + private static SearchedFaceDetailsJsonMarshaller instance; + + public static SearchedFaceDetailsJsonMarshaller getInstance() { + if (instance == null) + instance = new SearchedFaceDetailsJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceDetailsJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceDetailsJsonUnmarshaller.java new file mode 100644 index 0000000000..ad9d140942 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceDetailsJsonUnmarshaller.java @@ -0,0 +1,57 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO SearchedFaceDetails + */ +class SearchedFaceDetailsJsonUnmarshaller implements + Unmarshaller { + + public SearchedFaceDetails unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + SearchedFaceDetails searchedFaceDetails = new SearchedFaceDetails(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceDetail")) { + searchedFaceDetails.setFaceDetail(FaceDetailJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return searchedFaceDetails; + } + + private static SearchedFaceDetailsJsonUnmarshaller instance; + + public static SearchedFaceDetailsJsonUnmarshaller getInstance() { + if (instance == null) + instance = new SearchedFaceDetailsJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceJsonMarshaller.java new file mode 100644 index 0000000000..812786cfaf --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceJsonMarshaller.java @@ -0,0 +1,44 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO SearchedFace + */ +class SearchedFaceJsonMarshaller { + + public void marshall(SearchedFace searchedFace, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (searchedFace.getFaceId() != null) { + String faceId = searchedFace.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + jsonWriter.endObject(); + } + + private static SearchedFaceJsonMarshaller instance; + + public static SearchedFaceJsonMarshaller getInstance() { + if (instance == null) + instance = new SearchedFaceJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceJsonUnmarshaller.java new file mode 100644 index 0000000000..81b92a4caa --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedFaceJsonUnmarshaller.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO SearchedFace + */ +class SearchedFaceJsonUnmarshaller implements Unmarshaller { + + public SearchedFace unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + SearchedFace searchedFace = new SearchedFace(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceId")) { + searchedFace.setFaceId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return searchedFace; + } + + private static SearchedFaceJsonUnmarshaller instance; + + public static SearchedFaceJsonUnmarshaller getInstance() { + if (instance == null) + instance = new SearchedFaceJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedUserJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedUserJsonMarshaller.java new file mode 100644 index 0000000000..967e41c47d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedUserJsonMarshaller.java @@ -0,0 +1,44 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO SearchedUser + */ +class SearchedUserJsonMarshaller { + + public void marshall(SearchedUser searchedUser, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (searchedUser.getUserId() != null) { + String userId = searchedUser.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + jsonWriter.endObject(); + } + + private static SearchedUserJsonMarshaller instance; + + public static SearchedUserJsonMarshaller getInstance() { + if (instance == null) + instance = new SearchedUserJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedUserJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedUserJsonUnmarshaller.java new file mode 100644 index 0000000000..5ff27ce383 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/SearchedUserJsonUnmarshaller.java @@ -0,0 +1,56 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO SearchedUser + */ +class SearchedUserJsonUnmarshaller implements Unmarshaller { + + public SearchedUser unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + SearchedUser searchedUser = new SearchedUser(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("UserId")) { + searchedUser.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return searchedUser; + } + + private static SearchedUserJsonUnmarshaller instance; + + public static SearchedUserJsonUnmarshaller getInstance() { + if (instance == null) + instance = new SearchedUserJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsearchedFaceJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsearchedFaceJsonMarshaller.java new file mode 100644 index 0000000000..cbacdd0a9d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsearchedFaceJsonMarshaller.java @@ -0,0 +1,55 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO UnsearchedFace + */ +class UnsearchedFaceJsonMarshaller { + + public void marshall(UnsearchedFace unsearchedFace, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (unsearchedFace.getFaceDetails() != null) { + FaceDetail faceDetails = unsearchedFace.getFaceDetails(); + jsonWriter.name("FaceDetails"); + FaceDetailJsonMarshaller.getInstance().marshall(faceDetails, jsonWriter); + } + if (unsearchedFace.getReasons() != null) { + java.util.List reasons = unsearchedFace.getReasons(); + jsonWriter.name("Reasons"); + jsonWriter.beginArray(); + for (String reasonsItem : reasons) { + if (reasonsItem != null) { + jsonWriter.value(reasonsItem); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static UnsearchedFaceJsonMarshaller instance; + + public static UnsearchedFaceJsonMarshaller getInstance() { + if (instance == null) + instance = new UnsearchedFaceJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsearchedFaceJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsearchedFaceJsonUnmarshaller.java new file mode 100644 index 0000000000..2169169492 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsearchedFaceJsonUnmarshaller.java @@ -0,0 +1,62 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO UnsearchedFace + */ +class UnsearchedFaceJsonUnmarshaller implements + Unmarshaller { + + public UnsearchedFace unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + UnsearchedFace unsearchedFace = new UnsearchedFace(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceDetails")) { + unsearchedFace.setFaceDetails(FaceDetailJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Reasons")) { + unsearchedFace.setReasons(new ListUnmarshaller(StringJsonUnmarshaller + .getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return unsearchedFace; + } + + private static UnsearchedFaceJsonUnmarshaller instance; + + public static UnsearchedFaceJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UnsearchedFaceJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceAssociationJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceAssociationJsonMarshaller.java new file mode 100644 index 0000000000..526e3e77ad --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceAssociationJsonMarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO UnsuccessfulFaceAssociation + */ +class UnsuccessfulFaceAssociationJsonMarshaller { + + public void marshall(UnsuccessfulFaceAssociation unsuccessfulFaceAssociation, + AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (unsuccessfulFaceAssociation.getFaceId() != null) { + String faceId = unsuccessfulFaceAssociation.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + if (unsuccessfulFaceAssociation.getUserId() != null) { + String userId = unsuccessfulFaceAssociation.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (unsuccessfulFaceAssociation.getConfidence() != null) { + Float confidence = unsuccessfulFaceAssociation.getConfidence(); + jsonWriter.name("Confidence"); + jsonWriter.value(confidence); + } + if (unsuccessfulFaceAssociation.getReasons() != null) { + java.util.List reasons = unsuccessfulFaceAssociation.getReasons(); + jsonWriter.name("Reasons"); + jsonWriter.beginArray(); + for (String reasonsItem : reasons) { + if (reasonsItem != null) { + jsonWriter.value(reasonsItem); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static UnsuccessfulFaceAssociationJsonMarshaller instance; + + public static UnsuccessfulFaceAssociationJsonMarshaller getInstance() { + if (instance == null) + instance = new UnsuccessfulFaceAssociationJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceAssociationJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceAssociationJsonUnmarshaller.java new file mode 100644 index 0000000000..6c19a05c37 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceAssociationJsonUnmarshaller.java @@ -0,0 +1,68 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO UnsuccessfulFaceAssociation + */ +class UnsuccessfulFaceAssociationJsonUnmarshaller implements + Unmarshaller { + + public UnsuccessfulFaceAssociation unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + UnsuccessfulFaceAssociation unsuccessfulFaceAssociation = new UnsuccessfulFaceAssociation(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceId")) { + unsuccessfulFaceAssociation.setFaceId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("UserId")) { + unsuccessfulFaceAssociation.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Confidence")) { + unsuccessfulFaceAssociation.setConfidence(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Reasons")) { + unsuccessfulFaceAssociation.setReasons(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return unsuccessfulFaceAssociation; + } + + private static UnsuccessfulFaceAssociationJsonUnmarshaller instance; + + public static UnsuccessfulFaceAssociationJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UnsuccessfulFaceAssociationJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDeletionJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDeletionJsonMarshaller.java new file mode 100644 index 0000000000..f6dbc456f8 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDeletionJsonMarshaller.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO UnsuccessfulFaceDeletion + */ +class UnsuccessfulFaceDeletionJsonMarshaller { + + public void marshall(UnsuccessfulFaceDeletion unsuccessfulFaceDeletion, AwsJsonWriter jsonWriter) + throws Exception { + jsonWriter.beginObject(); + if (unsuccessfulFaceDeletion.getFaceId() != null) { + String faceId = unsuccessfulFaceDeletion.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + if (unsuccessfulFaceDeletion.getUserId() != null) { + String userId = unsuccessfulFaceDeletion.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (unsuccessfulFaceDeletion.getReasons() != null) { + java.util.List reasons = unsuccessfulFaceDeletion.getReasons(); + jsonWriter.name("Reasons"); + jsonWriter.beginArray(); + for (String reasonsItem : reasons) { + if (reasonsItem != null) { + jsonWriter.value(reasonsItem); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static UnsuccessfulFaceDeletionJsonMarshaller instance; + + public static UnsuccessfulFaceDeletionJsonMarshaller getInstance() { + if (instance == null) + instance = new UnsuccessfulFaceDeletionJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDeletionJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDeletionJsonUnmarshaller.java new file mode 100644 index 0000000000..d977a09dfb --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDeletionJsonUnmarshaller.java @@ -0,0 +1,65 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO UnsuccessfulFaceDeletion + */ +class UnsuccessfulFaceDeletionJsonUnmarshaller implements + Unmarshaller { + + public UnsuccessfulFaceDeletion unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + UnsuccessfulFaceDeletion unsuccessfulFaceDeletion = new UnsuccessfulFaceDeletion(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceId")) { + unsuccessfulFaceDeletion.setFaceId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("UserId")) { + unsuccessfulFaceDeletion.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Reasons")) { + unsuccessfulFaceDeletion.setReasons(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return unsuccessfulFaceDeletion; + } + + private static UnsuccessfulFaceDeletionJsonUnmarshaller instance; + + public static UnsuccessfulFaceDeletionJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UnsuccessfulFaceDeletionJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDisassociationJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDisassociationJsonMarshaller.java new file mode 100644 index 0000000000..de54d0c588 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDisassociationJsonMarshaller.java @@ -0,0 +1,61 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO UnsuccessfulFaceDisassociation + */ +class UnsuccessfulFaceDisassociationJsonMarshaller { + + public void marshall(UnsuccessfulFaceDisassociation unsuccessfulFaceDisassociation, + AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (unsuccessfulFaceDisassociation.getFaceId() != null) { + String faceId = unsuccessfulFaceDisassociation.getFaceId(); + jsonWriter.name("FaceId"); + jsonWriter.value(faceId); + } + if (unsuccessfulFaceDisassociation.getUserId() != null) { + String userId = unsuccessfulFaceDisassociation.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (unsuccessfulFaceDisassociation.getReasons() != null) { + java.util.List reasons = unsuccessfulFaceDisassociation.getReasons(); + jsonWriter.name("Reasons"); + jsonWriter.beginArray(); + for (String reasonsItem : reasons) { + if (reasonsItem != null) { + jsonWriter.value(reasonsItem); + } + } + jsonWriter.endArray(); + } + jsonWriter.endObject(); + } + + private static UnsuccessfulFaceDisassociationJsonMarshaller instance; + + public static UnsuccessfulFaceDisassociationJsonMarshaller getInstance() { + if (instance == null) + instance = new UnsuccessfulFaceDisassociationJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDisassociationJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDisassociationJsonUnmarshaller.java new file mode 100644 index 0000000000..71cb135a1a --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UnsuccessfulFaceDisassociationJsonUnmarshaller.java @@ -0,0 +1,66 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO UnsuccessfulFaceDisassociation + */ +class UnsuccessfulFaceDisassociationJsonUnmarshaller implements + Unmarshaller { + + public UnsuccessfulFaceDisassociation unmarshall(JsonUnmarshallerContext context) + throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + UnsuccessfulFaceDisassociation unsuccessfulFaceDisassociation = new UnsuccessfulFaceDisassociation(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("FaceId")) { + unsuccessfulFaceDisassociation.setFaceId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("UserId")) { + unsuccessfulFaceDisassociation.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("Reasons")) { + unsuccessfulFaceDisassociation.setReasons(new ListUnmarshaller( + StringJsonUnmarshaller.getInstance() + ) + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return unsuccessfulFaceDisassociation; + } + + private static UnsuccessfulFaceDisassociationJsonUnmarshaller instance; + + public static UnsuccessfulFaceDisassociationJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UnsuccessfulFaceDisassociationJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserJsonMarshaller.java new file mode 100644 index 0000000000..7156ccf05a --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserJsonMarshaller.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO User + */ +class UserJsonMarshaller { + + public void marshall(User user, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (user.getUserId() != null) { + String userId = user.getUserId(); + jsonWriter.name("UserId"); + jsonWriter.value(userId); + } + if (user.getUserStatus() != null) { + String userStatus = user.getUserStatus(); + jsonWriter.name("UserStatus"); + jsonWriter.value(userStatus); + } + jsonWriter.endObject(); + } + + private static UserJsonMarshaller instance; + + public static UserJsonMarshaller getInstance() { + if (instance == null) + instance = new UserJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserJsonUnmarshaller.java new file mode 100644 index 0000000000..d02b25e759 --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserJsonUnmarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO User + */ +class UserJsonUnmarshaller implements Unmarshaller { + + public User unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + User user = new User(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("UserId")) { + user.setUserId(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("UserStatus")) { + user.setUserStatus(StringJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return user; + } + + private static UserJsonUnmarshaller instance; + + public static UserJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UserJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserMatchJsonMarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserMatchJsonMarshaller.java new file mode 100644 index 0000000000..fd6207306d --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserMatchJsonMarshaller.java @@ -0,0 +1,49 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.util.DateUtils; +import com.amazonaws.util.json.AwsJsonWriter; + +/** + * JSON marshaller for POJO UserMatch + */ +class UserMatchJsonMarshaller { + + public void marshall(UserMatch userMatch, AwsJsonWriter jsonWriter) throws Exception { + jsonWriter.beginObject(); + if (userMatch.getSimilarity() != null) { + Float similarity = userMatch.getSimilarity(); + jsonWriter.name("Similarity"); + jsonWriter.value(similarity); + } + if (userMatch.getUser() != null) { + MatchedUser user = userMatch.getUser(); + jsonWriter.name("User"); + MatchedUserJsonMarshaller.getInstance().marshall(user, jsonWriter); + } + jsonWriter.endObject(); + } + + private static UserMatchJsonMarshaller instance; + + public static UserMatchJsonMarshaller getInstance() { + if (instance == null) + instance = new UserMatchJsonMarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserMatchJsonUnmarshaller.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserMatchJsonUnmarshaller.java new file mode 100644 index 0000000000..8202a7855f --- /dev/null +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/model/transform/UserMatchJsonUnmarshaller.java @@ -0,0 +1,59 @@ +/* + * Copyright 2010-2023 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.rekognition.model.transform; + +import com.amazonaws.services.rekognition.model.*; +import com.amazonaws.transform.SimpleTypeJsonUnmarshallers.*; +import com.amazonaws.transform.*; +import com.amazonaws.util.json.AwsJsonReader; + +/** + * JSON unmarshaller for POJO UserMatch + */ +class UserMatchJsonUnmarshaller implements Unmarshaller { + + public UserMatch unmarshall(JsonUnmarshallerContext context) throws Exception { + AwsJsonReader reader = context.getReader(); + if (!reader.isContainer()) { + reader.skipValue(); + return null; + } + UserMatch userMatch = new UserMatch(); + reader.beginObject(); + while (reader.hasNext()) { + String name = reader.nextName(); + if (name.equals("Similarity")) { + userMatch.setSimilarity(FloatJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else if (name.equals("User")) { + userMatch.setUser(MatchedUserJsonUnmarshaller.getInstance() + .unmarshall(context)); + } else { + reader.skipValue(); + } + } + reader.endObject(); + return userMatch; + } + + private static UserMatchJsonUnmarshaller instance; + + public static UserMatchJsonUnmarshaller getInstance() { + if (instance == null) + instance = new UserMatchJsonUnmarshaller(); + return instance; + } +} diff --git a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java index ad4a72d792..9c89583a49 100644 --- a/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java +++ b/aws-android-sdk-rekognition/src/main/java/com/amazonaws/services/rekognition/package-info.java @@ -1,5 +1,5 @@ /** - *

    This is the API Reference for Amazon Rekognition Image, Amazon Rekognition Custom Labels, Amazon Rekognition Stored Video, Amazon Rekognition Streaming Video. It provides descriptions of actions, data types, common parameters, and common errors.

    Amazon Rekognition Image

    Amazon Rekognition Custom Labels

    Amazon Rekognition Video Stored Video

    Amazon Rekognition Video Streaming Video

    + *

    This is the API Reference for Amazon Rekognition Image, Amazon Rekognition Custom Labels, Amazon Rekognition Stored Video, Amazon Rekognition Streaming Video. It provides descriptions of actions, data types, common parameters, and common errors.

    Amazon Rekognition Image

    Amazon Rekognition Custom Labels

    Amazon Rekognition Video Stored Video

    Amazon Rekognition Video Streaming Video

    */ package com.amazonaws.services.rekognition;