@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateAccessKeyResult == false) return false; CreateAccessKeyResult other = (CreateAccessKeyResult) obj; if (other.getAccessKey() == null ^ this.getAccessKey() == null) return false; if (other.getAccessKey() != null && other.getAccessKey().equals(this.getAccessKey()) == false) return false; return true; }
/** * <p> * A structure with details about the access key. * </p> * * @param accessKey * A structure with details about the access key. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAccessKeyResult withAccessKey(AccessKey accessKey) { setAccessKey(accessKey); return this; }
public CreateAccessKeyResult unmarshall(StaxUnmarshallerContext context) throws Exception { CreateAccessKeyResult createAccessKeyResult = new CreateAccessKeyResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return createAccessKeyResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("AccessKey", targetDepth)) { createAccessKeyResult.setAccessKey(AccessKeyStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return createAccessKeyResult; } } } }
public CreateAccessKeyResult unmarshall(StaxUnmarshallerContext context) throws Exception { CreateAccessKeyResult createAccessKeyResult = new CreateAccessKeyResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return createAccessKeyResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("AccessKey", targetDepth)) { createAccessKeyResult.setAccessKey(AccessKeyStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return createAccessKeyResult; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAccessKey() == null) ? 0 : getAccessKey().hashCode()); return hashCode; }
/** * <p> * A structure with details about the access key. * </p> * * @param accessKey * A structure with details about the access key. * @return Returns a reference to this object so that method calls can be chained together. */ public CreateAccessKeyResult withAccessKey(AccessKey accessKey) { setAccessKey(accessKey); 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 (getAccessKey() != null) sb.append("AccessKey: ").append(getAccessKey()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof CreateAccessKeyResult == false) return false; CreateAccessKeyResult other = (CreateAccessKeyResult) obj; if (other.getAccessKey() == null ^ this.getAccessKey() == null) return false; if (other.getAccessKey() != null && other.getAccessKey().equals(this.getAccessKey()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getAccessKey() == null) ? 0 : getAccessKey().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 (getAccessKey() != null) sb.append("AccessKey: ").append(getAccessKey()); sb.append("}"); return sb.toString(); }
private static AWSCredentials createIamAccessKey(AmazonIdentityManagementClient iamClient, String username) { CreateAccessKeyResult accessKeyResult = iamClient.createAccessKey(new CreateAccessKeyRequest().withUserName(username)); AccessKey accessKey = accessKeyResult.getAccessKey(); return new BasicAWSCredentials(accessKey.getAccessKeyId(), accessKey.getSecretAccessKey()); }
private static AWSCredentials createIamAccessKey(AmazonIdentityManagementClient iamClient, String username) { CreateAccessKeyResult accessKeyResult = iamClient.createAccessKey(new CreateAccessKeyRequest().withUserName(username)); AccessKey accessKey = accessKeyResult.getAccessKey(); return new BasicAWSCredentials(accessKey.getAccessKeyId(), accessKey.getSecretAccessKey()); }
private static AWSCredentials createIamAccessKey(AmazonIdentityManagementClient iamClient, String username) { CreateAccessKeyResult accessKeyResult = iamClient.createAccessKey(new CreateAccessKeyRequest().withUserName(username)); AccessKey accessKey = accessKeyResult.getAccessKey(); return new BasicAWSCredentials(accessKey.getAccessKeyId(), accessKey.getSecretAccessKey()); }
private void createAccessKey(Name name, String userName, List<String> keys) { AccessKey accessKey = iam_.createAccessKey(new CreateAccessKeyRequest() .withUserName(userName)).getAccessKey(); // secret.println("#######################################################"); // secret.println("# SAVE THIS ACCESS KEY IN ~/.aws/credentials"); // secret.println("#######################################################"); // secret.format("[%s]%n", userName); // secret.format("aws_access_key_id = %s%n", accessKey.getAccessKeyId()); // secret.format("aws_secret_access_key = %s%n", accessKey.getSecretAccessKey()); // secret.println("#######################################################"); String accessKeyJson = " \"" + name + "\": {\n" + " \"accessKeyId\": \"" + accessKey.getAccessKeyId() + "\",\n" + " \"secretAccessKey\": \"" + accessKey.getSecretAccessKey() + "\"\n" + " }"; keys.add(accessKeyJson); }
.withUserName(userName_)).getAccessKey();
final String id = key.getAccessKey().getAccessKeyId(); if(log.isInfoEnabled()) { log.info(String.format("Map user %s to access key %s", String.format("%s%s", prefix, username), id)); id, key.getAccessKey().getSecretAccessKey());