@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceProfiles() == null) ? 0 : getInstanceProfiles().hashCode()); hashCode = prime * hashCode + ((getIsTruncated() == null) ? 0 : getIsTruncated().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); return hashCode; }
/** * <p> * A list of instance profiles. * </p> * * @param instanceProfiles * A list of instance profiles. * @return Returns a reference to this object so that method calls can be chained together. */ public ListInstanceProfilesResult withInstanceProfiles(java.util.Collection<InstanceProfile> instanceProfiles) { setInstanceProfiles(instanceProfiles); return this; }
/** * <p> * A flag that indicates whether there are more items to return. If your results were truncated, you can make a * subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that * IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results * available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all * your results. * </p> * * @param isTruncated * A flag that indicates whether there are more items to return. If your results were truncated, you can make * a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. * Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more * results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that * you receive all your results. * @return Returns a reference to this object so that method calls can be chained together. */ public ListInstanceProfilesResult withIsTruncated(Boolean isTruncated) { setIsTruncated(isTruncated); return this; }
@Override protected void doGlobalScan() { AmazonIdentityManagementClient iam = getClient(); ListInstanceProfilesRequest request = new ListInstanceProfilesRequest(); GraphNodeGarbageCollector gc = newGarbageCollector().bindScannerContext(); while (true) { ListInstanceProfilesResult instanceProfiles = iam.listInstanceProfiles(request); instanceProfiles.getInstanceProfiles().forEach(n -> scanInstanceProfile(gc, n)); if (!instanceProfiles.isTruncated()) { break; } request.setMarker(instanceProfiles.getMarker()); } }
public ListInstanceProfilesResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListInstanceProfilesResult listInstanceProfilesResult = new ListInstanceProfilesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; listInstanceProfilesResult.withInstanceProfiles(new ArrayList<InstanceProfile>()); continue; listInstanceProfilesResult.withInstanceProfiles(InstanceProfileStaxUnmarshaller.getInstance().unmarshall(context)); continue; listInstanceProfilesResult.setIsTruncated(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; listInstanceProfilesResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
@Override public AbstractModelList<String> getEc2RolesFromAmazonAccount() { List<InstanceProfile> ec2RolesList = aim.listInstanceProfiles().getInstanceProfiles(); AbstractModelList<String> ec2List; ec2List = ec2RolesList.stream().map( e -> e.getInstanceProfileName() ) .collect( Collectors.toCollection( AbstractModelList<String>::new ) ); return ec2List; }
public ListInstanceProfilesResult unmarshall(StaxUnmarshallerContext context) throws Exception { ListInstanceProfilesResult listInstanceProfilesResult = new ListInstanceProfilesResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; listInstanceProfilesResult.withInstanceProfiles(new ArrayList<InstanceProfile>()); continue; listInstanceProfilesResult.withInstanceProfiles(InstanceProfileStaxUnmarshaller.getInstance().unmarshall(context)); continue; listInstanceProfilesResult.setIsTruncated(BooleanStaxUnmarshaller.getInstance().unmarshall(context)); continue; listInstanceProfilesResult.setMarker(StringStaxUnmarshaller.getInstance().unmarshall(context)); continue;
public Collection<String> getIAMRolesRange() { AmazonIdentityManagementClient identityManagementClient = new AmazonIdentityManagementClient(new BasicAWSCredentials(awsAccount.getAccessKeyId(), awsAccount.getAccessSecret())); ListInstanceProfilesResult listInstanceProfilesResult = identityManagementClient.listInstanceProfiles(); List<String> iamRoles = new LinkedList<String>(); for(InstanceProfile instanceProfile: listInstanceProfilesResult.getInstanceProfiles()) { iamRoles.addAll(Collections2.transform(instanceProfile.getRoles(), iamRoleToStringFunction)); } return iamRoles; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListInstanceProfilesResult == false) return false; ListInstanceProfilesResult other = (ListInstanceProfilesResult) obj; if (other.getInstanceProfiles() == null ^ this.getInstanceProfiles() == null) return false; if (other.getInstanceProfiles() != null && other.getInstanceProfiles().equals(this.getInstanceProfiles()) == false) return false; if (other.getIsTruncated() == null ^ this.getIsTruncated() == null) return false; if (other.getIsTruncated() != null && other.getIsTruncated().equals(this.getIsTruncated()) == false) return false; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; return true; }
/** * <p> * A list of instance profiles. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstanceProfiles(java.util.Collection)} or {@link #withInstanceProfiles(java.util.Collection)} if you * want to override the existing values. * </p> * * @param instanceProfiles * A list of instance profiles. * @return Returns a reference to this object so that method calls can be chained together. */ public ListInstanceProfilesResult withInstanceProfiles(InstanceProfile... instanceProfiles) { if (this.instanceProfiles == null) { setInstanceProfiles(new com.amazonaws.internal.SdkInternalList<InstanceProfile>(instanceProfiles.length)); } for (InstanceProfile ele : instanceProfiles) { this.instanceProfiles.add(ele); } return this; }
/** * <p> * A flag that indicates whether there are more items to return. If your results were truncated, you can make a * subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. Note that * IAM might return fewer than the <code>MaxItems</code> number of results even when there are more results * available. We recommend that you check <code>IsTruncated</code> after every call to ensure that you receive all * your results. * </p> * * @param isTruncated * A flag that indicates whether there are more items to return. If your results were truncated, you can make * a subsequent pagination request using the <code>Marker</code> request parameter to retrieve more items. * Note that IAM might return fewer than the <code>MaxItems</code> number of results even when there are more * results available. We recommend that you check <code>IsTruncated</code> after every call to ensure that * you receive all your results. * @return Returns a reference to this object so that method calls can be chained together. */ public ListInstanceProfilesResult withIsTruncated(Boolean isTruncated) { setIsTruncated(isTruncated); return this; }
/** * 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 (getInstanceProfiles() != null) sb.append("InstanceProfiles: ").append(getInstanceProfiles()).append(","); if (getIsTruncated() != null) sb.append("IsTruncated: ").append(getIsTruncated()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()); sb.append("}"); return sb.toString(); }
/** * <p> * A list of instance profiles. * </p> * * @param instanceProfiles * A list of instance profiles. * @return Returns a reference to this object so that method calls can be chained together. */ public ListInstanceProfilesResult withInstanceProfiles(java.util.Collection<InstanceProfile> instanceProfiles) { setInstanceProfiles(instanceProfiles); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getInstanceProfiles() == null) ? 0 : getInstanceProfiles().hashCode()); hashCode = prime * hashCode + ((getIsTruncated() == null) ? 0 : getIsTruncated().hashCode()); hashCode = prime * hashCode + ((getMarker() == null) ? 0 : getMarker().hashCode()); return hashCode; }
/** * <p> * A list of instance profiles. * </p> * <p> * <b>NOTE:</b> This method appends the values to the existing list (if any). Use * {@link #setInstanceProfiles(java.util.Collection)} or {@link #withInstanceProfiles(java.util.Collection)} if you * want to override the existing values. * </p> * * @param instanceProfiles * A list of instance profiles. * @return Returns a reference to this object so that method calls can be chained together. */ public ListInstanceProfilesResult withInstanceProfiles(InstanceProfile... instanceProfiles) { if (this.instanceProfiles == null) { setInstanceProfiles(new com.amazonaws.internal.SdkInternalList<InstanceProfile>(instanceProfiles.length)); } for (InstanceProfile ele : instanceProfiles) { this.instanceProfiles.add(ele); } return this; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ListInstanceProfilesResult == false) return false; ListInstanceProfilesResult other = (ListInstanceProfilesResult) obj; if (other.getInstanceProfiles() == null ^ this.getInstanceProfiles() == null) return false; if (other.getInstanceProfiles() != null && other.getInstanceProfiles().equals(this.getInstanceProfiles()) == false) return false; if (other.getIsTruncated() == null ^ this.getIsTruncated() == null) return false; if (other.getIsTruncated() != null && other.getIsTruncated().equals(this.getIsTruncated()) == false) return false; if (other.getMarker() == null ^ this.getMarker() == null) return false; if (other.getMarker() != null && other.getMarker().equals(this.getMarker()) == false) return false; return true; }
/** * 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 (getInstanceProfiles() != null) sb.append("InstanceProfiles: ").append(getInstanceProfiles()).append(","); if (getIsTruncated() != null) sb.append("IsTruncated: ").append(getIsTruncated()).append(","); if (getMarker() != null) sb.append("Marker: ").append(getMarker()); sb.append("}"); return sb.toString(); }