/** * Simplified method form for invoking the ListAccessKeys operation. * * @see #listAccessKeysAsync(ListAccessKeysRequest) */ @Override public java.util.concurrent.Future<ListAccessKeysResult> listAccessKeysAsync() { return listAccessKeysAsync(new ListAccessKeysRequest()); }
/** * <p> * The name of the user. * </p> * <p> * This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of * characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of * the following characters: _+=,.@- * </p> * * @param userName * The name of the user.</p> * <p> * This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string * of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also * include any of the following characters: _+=,.@- * @return Returns a reference to this object so that method calls can be chained together. */ public ListAccessKeysRequest withUserName(String userName) { setUserName(userName); return this; }
/** * <p> * Use this parameter only when paginating results and only after you receive a response indicating that the results * are truncated. Set it to the value of the <code>Marker</code> element in the response that you received to * indicate where the next call should start. * </p> * * @param marker * Use this parameter only when paginating results and only after you receive a response indicating that the * results are truncated. Set it to the value of the <code>Marker</code> element in the response that you * received to indicate where the next call should start. * @return Returns a reference to this object so that method calls can be chained together. */ public ListAccessKeysRequest withMarker(String marker) { setMarker(marker); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getMaxItems() == null) ? 0 : getMaxItems().hashCode()); return hashCode; }
@Override public List<AccessKeyMetadata> getAwsAccessKeys(String username) { List<AccessKeyMetadata> data = null; try { ListAccessKeysRequest request = new ListAccessKeysRequest().withUserName(username); ListAccessKeysResult result = aim.listAccessKeys(request); data = result.getAccessKeyMetadata(); } catch (Exception e) { log.error("AccessKeyMetadata for {} request failed: {}", username, e.getMessage()); } return data; }
/** * This method will fetch the access key information of a particular user. * * @param userName * @param iamClient * @return list of access key meta data */ public static List<AccessKeyMetadata> getAccessKeyInformationForUser( final String userName, AmazonIdentityManagementClient iamClient) { ListAccessKeysRequest accessKeysRequest = new ListAccessKeysRequest(); accessKeysRequest.setUserName(userName); logger.debug("userName {} ",userName); List<AccessKeyMetadata> accessKeyMetadatas = new ArrayList<>(); ListAccessKeysResult keysResult = null; do { keysResult = iamClient.listAccessKeys(accessKeysRequest); accessKeyMetadatas.addAll(keysResult.getAccessKeyMetadata()); accessKeysRequest.setMarker(keysResult.getMarker()); } while (keysResult.isTruncated()); return accessKeyMetadatas; } }
List<AccessKeyMetadata> getAccessKeys(final String accountId, final String userName) { final ListAccessKeysRequest request = new ListAccessKeysRequest(); request.setUserName(userName); return getIAMClient(accountId).listAccessKeys(request).getAccessKeyMetadata(); }
ListAccessKeysResult accessKeys = iam_.listAccessKeys(new ListAccessKeysRequest() .withUserName(userName) );
log.debug("Found {} users", users.size()); for (User user : users) { final ListAccessKeysRequest listAccessKeysRequest = new ListAccessKeysRequest(); listAccessKeysRequest.setUserName(user.getUserName()); final List<AccessKeyMetadata> accessKeyMetadata = iamClient.listAccessKeys(listAccessKeysRequest).getAccessKeyMetadata();
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListAccessKeysRequest == false) return false; ListAccessKeysRequest other = (ListAccessKeysRequest) obj; if (other.getUserName() == null ^ this.getUserName() == null) return false; if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == false) return false; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; if (other.getMaxItems() == null ^ this.getMaxItems() == null) return false; if (other.getMaxItems() != null && other.getMaxItems().equals(this.getMaxItems()) == false) return false; return true; }
/** * Simplified method form for invoking the ListAccessKeys operation. * * @see #listAccessKeysAsync(ListAccessKeysRequest) */ @Override public java.util.concurrent.Future<ListAccessKeysResult> listAccessKeysAsync() { return listAccessKeysAsync(new ListAccessKeysRequest()); }
try { final ListAccessKeysResult keys = client.listAccessKeys(new ListAccessKeysRequest().withUserName(username));
/** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @return A string representation of this object. * * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getUserName() != null) sb.append("UserName: ").append(getUserName()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()).append(","); if (getMaxItems() != null) sb.append("MaxItems: ").append(getMaxItems()); sb.append("}"); return sb.toString(); }
/** * <p> * The name of the user. * </p> * <p> * This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string of * characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also include any of * the following characters: _+=,.@- * </p> * * @param userName * The name of the user.</p> * <p> * This parameter allows (through its <a href="http://wikipedia.org/wiki/regex">regex pattern</a>) a string * of characters consisting of upper and lowercase alphanumeric characters with no spaces. You can also * include any of the following characters: _+=,.@- * @return Returns a reference to this object so that method calls can be chained together. */ public ListAccessKeysRequest withUserName(String userName) { setUserName(userName); return this; }
/** * <p> * Use this parameter only when paginating results and only after you receive a response indicating that the results * are truncated. Set it to the value of the <code>Marker</code> element in the response that you received to * indicate where the next call should start. * </p> * * @param marker * Use this parameter only when paginating results and only after you receive a response indicating that the * results are truncated. Set it to the value of the <code>Marker</code> element in the response that you * received to indicate where the next call should start. * @return Returns a reference to this object so that method calls can be chained together. */ public ListAccessKeysRequest withMarker(String marker) { setMarker(marker); return this; }
/** * Simplified method form for invoking the ListAccessKeys operation with an AsyncHandler. * * @see #listAccessKeysAsync(ListAccessKeysRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<ListAccessKeysResult> listAccessKeysAsync( com.amazonaws.handlers.AsyncHandler<ListAccessKeysRequest, ListAccessKeysResult> asyncHandler) { return listAccessKeysAsync(new ListAccessKeysRequest(), asyncHandler); }
UserVH userTemp = new UserVH(user); String userName = user.getUserName(); List<AccessKeyMetadata> accessKeys = iamClient.listAccessKeys(new ListAccessKeysRequest().withUserName(userName)).getAccessKeyMetadata(); List<AccessKeyMetadataVH> accessKeysTemp = new ArrayList<>(); userTemp.setAccessKeys(accessKeysTemp);
public Request<ListAccessKeysRequest> marshall(ListAccessKeysRequest listAccessKeysRequest) { if (listAccessKeysRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<ListAccessKeysRequest> request = new DefaultRequest<ListAccessKeysRequest>(listAccessKeysRequest, "AmazonIdentityManagement"); request.addParameter("Action", "ListAccessKeys"); request.addParameter("Version", "2010-05-08"); request.setHttpMethod(HttpMethodName.POST); if (listAccessKeysRequest.getUserName() != null) { request.addParameter("UserName", StringUtils.fromString(listAccessKeysRequest.getUserName())); } if (listAccessKeysRequest.getMarker() != null) { request.addParameter("Marker", StringUtils.fromString(listAccessKeysRequest.getMarker())); } if (listAccessKeysRequest.getMaxItems() != null) { request.addParameter("MaxItems", StringUtils.fromInteger(listAccessKeysRequest.getMaxItems())); } return request; }
/** * Simplified method form for invoking the ListAccessKeys operation with an AsyncHandler. * * @see #listAccessKeysAsync(ListAccessKeysRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<ListAccessKeysResult> listAccessKeysAsync( com.amazonaws.handlers.AsyncHandler<ListAccessKeysRequest, ListAccessKeysResult> asyncHandler) { return listAccessKeysAsync(new ListAccessKeysRequest(), asyncHandler); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getMaxItems() == null) ? 0 : getMaxItems().hashCode()); return hashCode; }