@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getUserName() == null) ? 0 : getUserName().hashCode()); hashCode = prime * hashCode + ((getPolicyName() == null) ? 0 : getPolicyName().hashCode()); hashCode = prime * hashCode + ((getPolicyDocument() == null) ? 0 : getPolicyDocument().hashCode()); return hashCode; }
setUserName(userName); setPolicyName(policyName); setPolicyDocument(policyDocument);
@Override public UserPolicy createPolicy(String policyName, String policyDocument, ResultCapture<Void> extractor) { PutUserPolicyRequest request = new PutUserPolicyRequest() .withPolicyName(policyName) .withPolicyDocument(policyDocument); return createPolicy(request, extractor); }
iamClient.putUserPolicy(new PutUserPolicyRequest(username, "policy", policyJson)); return username;
@Override public void put(String policyDocument, ResultCapture<Void> extractor) { PutUserPolicyRequest request = new PutUserPolicyRequest() .withPolicyDocument(policyDocument); put(request, extractor); }
/** * <p> * The name of the policy document. * </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 policyName * The name of the policy document.</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 PutUserPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The name of the user to associate the policy with. * </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 userName * The name of the user to associate the policy with.</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 PutUserPolicyRequest withUserName(String userName) { setUserName(userName); return this; }
setPolicyDocument(policyDocument); return this;
@Override public UserPolicy createPolicy(String policyName, String policyDocument, ResultCapture<Void> extractor) { PutUserPolicyRequest request = new PutUserPolicyRequest() .withPolicyName(policyName) .withPolicyDocument(policyDocument); return createPolicy(request, extractor); }
iamClient.putUserPolicy(new PutUserPolicyRequest(username, "policy", policyJson)); return username;
@Override public void put(String policyDocument, ResultCapture<Void> extractor) { PutUserPolicyRequest request = new PutUserPolicyRequest() .withPolicyDocument(policyDocument); put(request, extractor); }
/** * <p> * The name of the policy document. * </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 policyName * The name of the policy document.</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 PutUserPolicyRequest withPolicyName(String policyName) { setPolicyName(policyName); return this; }
/** * <p> * The name of the user to associate the policy with. * </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 userName * The name of the user to associate the policy with.</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 PutUserPolicyRequest withUserName(String userName) { setUserName(userName); return this; }
setPolicyDocument(policyDocument); return this;
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof PutUserPolicyRequest == false) return false; PutUserPolicyRequest other = (PutUserPolicyRequest) obj; if (other.getUserName() == null ^ this.getUserName() == null) return false; if (other.getUserName() != null && other.getUserName().equals(this.getUserName()) == false) return false; if (other.getPolicyName() == null ^ this.getPolicyName() == null) return false; if (other.getPolicyName() != null && other.getPolicyName().equals(this.getPolicyName()) == false) return false; if (other.getPolicyDocument() == null ^ this.getPolicyDocument() == null) return false; if (other.getPolicyDocument() != null && other.getPolicyDocument().equals(this.getPolicyDocument()) == false) return false; return true; }
iamClient.putUserPolicy(new PutUserPolicyRequest(username, "policy", policyJson)); return username;
setUserName(userName); setPolicyName(policyName); setPolicyDocument(policyDocument);
/** * 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 (getUserName() != null) sb.append("UserName: ").append(getUserName()).append(","); if (getPolicyName() != null) sb.append("PolicyName: ").append(getPolicyName()).append(","); if (getPolicyDocument() != null) sb.append("PolicyDocument: ").append(getPolicyDocument()); sb.append("}"); return sb.toString(); }
client.putUserPolicy(new PutUserPolicyRequest(user.getUserName(), "Policy", policy));
public Request<PutUserPolicyRequest> marshall(PutUserPolicyRequest putUserPolicyRequest) { if (putUserPolicyRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } Request<PutUserPolicyRequest> request = new DefaultRequest<PutUserPolicyRequest>(putUserPolicyRequest, "AmazonIdentityManagement"); request.addParameter("Action", "PutUserPolicy"); request.addParameter("Version", "2010-05-08"); request.setHttpMethod(HttpMethodName.POST); if (putUserPolicyRequest.getUserName() != null) { request.addParameter("UserName", StringUtils.fromString(putUserPolicyRequest.getUserName())); } if (putUserPolicyRequest.getPolicyName() != null) { request.addParameter("PolicyName", StringUtils.fromString(putUserPolicyRequest.getPolicyName())); } if (putUserPolicyRequest.getPolicyDocument() != null) { request.addParameter("PolicyDocument", StringUtils.fromString(putUserPolicyRequest.getPolicyDocument())); } return request; }