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