/** * Simplified method form for invoking the ListRoles operation. * * @see #listRolesAsync(ListRolesRequest) */ @Override public java.util.concurrent.Future<ListRolesResult> listRolesAsync() { return listRolesAsync(new ListRolesRequest()); }
/** * <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 ListRolesRequest withMarker(String marker) { setMarker(marker); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPathPrefix() == null) ? 0 : getPathPrefix().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getMaxItems() == null) ? 0 : getMaxItems().hashCode()); return hashCode; }
/** * Fetch IAM roles. * * @param temporaryCredentials the temporary credentials * @param account the account * @return the map */ public static Map<String,List<Role>> fetchIAMRoles(BasicSessionCredentials temporaryCredentials,String account) { AmazonIdentityManagement iamClient = AmazonIdentityManagementClientBuilder.standard().withCredentials(new AWSStaticCredentialsProvider(temporaryCredentials)).withRegion(InventoryConstants.REGION_US_WEST_2).build(); List<Role> roles = new ArrayList<>(); ListRolesResult rslt; String marker = null; do{ rslt = iamClient.listRoles(new ListRolesRequest().withMarker(marker)); roles.addAll(rslt.getRoles()); marker = rslt.getMarker(); }while(marker!=null); log.debug(InventoryConstants.ACCOUNT + account +" Type : IAM Roles >> "+roles.size()); Map<String,List<Role>> iamRoles = new HashMap<>(); iamRoles.put(account, roles); return iamRoles; }
private Set<String> loadRoles() { Set<String> result = new TreeSet<String>(); boolean done = false; String marker = null; do { final ListRolesRequest listRolesRequest = new ListRolesRequest(); listRolesRequest.setMarker(marker); final ListRolesResult listRolesResult = iam.listRoles(listRolesRequest); for (Role r : listRolesResult.getRoles()) { result.add(r.getArn()); } done = (!listRolesResult.isTruncated()); marker = listRolesResult.getMarker(); } while (!done); return result; }
result = iam.listRoles(new ListRolesRequest().withMarker(result.getMarker())); } else { break;
/** * Simplified method form for invoking the ListRoles operation. * * @see #listRolesAsync(ListRolesRequest) */ @Override public java.util.concurrent.Future<ListRolesResult> listRolesAsync() { return listRolesAsync(new ListRolesRequest()); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListRolesRequest == false) return false; ListRolesRequest other = (ListRolesRequest) obj; if (other.getPathPrefix() == null ^ this.getPathPrefix() == null) return false; if (other.getPathPrefix() != null && other.getPathPrefix().equals(this.getPathPrefix()) == 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; }
/** * <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 ListRolesRequest withMarker(String marker) { setMarker(marker); return this; }
@Override public ListRolesResult listRoles() { return listRoles(new ListRolesRequest()); }
/** * 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 (getPathPrefix() != null) sb.append("PathPrefix: ").append(getPathPrefix()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()).append(","); if (getMaxItems() != null) sb.append("MaxItems: ").append(getMaxItems()); sb.append("}"); return sb.toString(); }
/** * Simplified method form for invoking the ListRoles operation with an AsyncHandler. * * @see #listRolesAsync(ListRolesRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<ListRolesResult> listRolesAsync(com.amazonaws.handlers.AsyncHandler<ListRolesRequest, ListRolesResult> asyncHandler) { return listRolesAsync(new ListRolesRequest(), asyncHandler); }
public Request<ListRolesRequest> marshall(ListRolesRequest listRolesRequest) { if (listRolesRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<ListRolesRequest> request = new DefaultRequest<ListRolesRequest>(listRolesRequest, "AmazonIdentityManagement"); request.addParameter("Action", "ListRoles"); request.addParameter("Version", "2010-05-08"); request.setHttpMethod(HttpMethodName.POST); if (listRolesRequest.getPathPrefix() != null) { request.addParameter("PathPrefix", StringUtils.fromString(listRolesRequest.getPathPrefix())); } if (listRolesRequest.getMarker() != null) { request.addParameter("Marker", StringUtils.fromString(listRolesRequest.getMarker())); } if (listRolesRequest.getMaxItems() != null) { request.addParameter("MaxItems", StringUtils.fromInteger(listRolesRequest.getMaxItems())); } return request; }
/** * Simplified method form for invoking the ListRoles operation with an AsyncHandler. * * @see #listRolesAsync(ListRolesRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<ListRolesResult> listRolesAsync(com.amazonaws.handlers.AsyncHandler<ListRolesRequest, ListRolesResult> asyncHandler) { return listRolesAsync(new ListRolesRequest(), asyncHandler); }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPathPrefix() == null) ? 0 : getPathPrefix().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); hashCode = prime * hashCode + ((getMaxItems() == null) ? 0 : getMaxItems().hashCode()); return hashCode; }
@Override public ListRolesResult listRoles() { return listRoles(new ListRolesRequest()); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListRolesRequest == false) return false; ListRolesRequest other = (ListRolesRequest) obj; if (other.getPathPrefix() == null ^ this.getPathPrefix() == null) return false; if (other.getPathPrefix() != null && other.getPathPrefix().equals(this.getPathPrefix()) == 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 ListRoles operation. * * @see #listRolesAsync(ListRolesRequest) */ @Override public java.util.concurrent.Future<ListRolesResult> listRolesAsync() { return listRolesAsync(new ListRolesRequest()); }
/** * 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 (getPathPrefix() != null) sb.append("PathPrefix: ").append(getPathPrefix()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()).append(","); if (getMaxItems() != null) sb.append("MaxItems: ").append(getMaxItems()); sb.append("}"); return sb.toString(); }
/** * Simplified method form for invoking the ListRoles operation with an AsyncHandler. * * @see #listRolesAsync(ListRolesRequest, com.amazonaws.handlers.AsyncHandler) */ @Override public java.util.concurrent.Future<ListRolesResult> listRolesAsync(com.amazonaws.handlers.AsyncHandler<ListRolesRequest, ListRolesResult> asyncHandler) { return listRolesAsync(new ListRolesRequest(), asyncHandler); }