/* * 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.
*
* 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; } }