/** * <p> * The name of the IAM role to get information about. * </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 roleName * The name of the IAM role to get information about.</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 GetRoleRequest withRoleName(String roleName) { setRoleName(roleName); return this; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); return hashCode; }
role = iam_.getRole(new GetRoleRequest() .withRoleName(roleName)) .getRole();
AmazonIdentityManagementClient iamClient = new AmazonIdentityManagementClient(); GetRoleRequest getRoleRequest = new GetRoleRequest(); getRoleRequest.setRoleName("roleName"); String accountNumber = iamClient.getRole(getRoleRequest).getRole().getArn().split(":")[4];
private CreateStackTask readyStackTask() { CreateStackTask stackTask = new CreateStackTask(); stackTask.setProject(project); stackTask.setName("AntTaskTestStack"); stackTask.setRegion("us-east-1"); stackTask .setDefaultInstanceProfileArn(iamClient .getInstanceProfile( new GetInstanceProfileRequest() .withInstanceProfileName("aws-opsworks-ec2-role")) .getInstanceProfile().getArn()); stackTask.setServiceRoleArn(iamClient .getRole( new GetRoleRequest() .withRoleName("aws-opsworks-service-role")) .getRole().getArn()); return stackTask; }
/** * Sets the "instanceProfile" and "serviceRole" properties according to the * set parameters. */ public void execute() { checkParams(); AmazonIdentityManagementClient iamClient = getOrCreateClient(AmazonIdentityManagementClient.class); getProject() .setProperty( "instanceProfileArn", iamClient .getInstanceProfile( new GetInstanceProfileRequest() .withInstanceProfileName(instanceProfile)) .getInstanceProfile().getArn()); getProject() .setProperty( "serviceRoleArn", iamClient .getRole( new GetRoleRequest() .withRoleName(serviceRole)) .getRole().getArn()); } }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetRoleRequest == false) return false; GetRoleRequest other = (GetRoleRequest) obj; if (other.getRoleName() == null ^ this.getRoleName() == null) return false; if (other.getRoleName() != null && other.getRoleName().equals(this.getRoleName()) == false) return false; return true; }
/** * <p> * The name of the IAM role to get information about. * </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 roleName * The name of the IAM role to get information about.</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 GetRoleRequest withRoleName(String roleName) { setRoleName(roleName); 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 (getRoleName() != null) sb.append("RoleName: ").append(getRoleName()); sb.append("}"); return sb.toString(); }
public Request<GetRoleRequest> marshall(GetRoleRequest getRoleRequest) { if (getRoleRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<GetRoleRequest> request = new DefaultRequest<GetRoleRequest>(getRoleRequest, "AmazonIdentityManagement"); request.addParameter("Action", "GetRole"); request.addParameter("Version", "2010-05-08"); request.setHttpMethod(HttpMethodName.POST); if (getRoleRequest.getRoleName() != null) { request.addParameter("RoleName", StringUtils.fromString(getRoleRequest.getRoleName())); } return request; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetRoleRequest == false) return false; GetRoleRequest other = (GetRoleRequest) obj; if (other.getRoleName() == null ^ this.getRoleName() == null) return false; if (other.getRoleName() != null && other.getRoleName().equals(this.getRoleName()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getRoleName() == null) ? 0 : getRoleName().hashCode()); return hashCode; }
/** * 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 (getRoleName() != null) sb.append("RoleName: ").append(getRoleName()); sb.append("}"); return sb.toString(); }
public Request<GetRoleRequest> marshall(GetRoleRequest getRoleRequest) { if (getRoleRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<GetRoleRequest> request = new DefaultRequest<GetRoleRequest>(getRoleRequest, "AmazonIdentityManagement"); request.addParameter("Action", "GetRole"); request.addParameter("Version", "2010-05-08"); request.setHttpMethod(HttpMethodName.POST); if (getRoleRequest.getRoleName() != null) { request.addParameter("RoleName", StringUtils.fromString(getRoleRequest.getRoleName())); } return request; }