@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAccountPasswordPolicyResult == false) return false; GetAccountPasswordPolicyResult other = (GetAccountPasswordPolicyResult) obj; if (other.getPasswordPolicy() == null ^ this.getPasswordPolicy() == null) return false; if (other.getPasswordPolicy() != null && other.getPasswordPolicy().equals(this.getPasswordPolicy()) == false) return false; return true; }
/** * <p> * A structure that contains details about the account's password policy. * </p> * * @param passwordPolicy * A structure that contains details about the account's password policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GetAccountPasswordPolicyResult withPasswordPolicy(PasswordPolicy passwordPolicy) { setPasswordPolicy(passwordPolicy); return this; }
public GetAccountPasswordPolicyResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetAccountPasswordPolicyResult getAccountPasswordPolicyResult = new GetAccountPasswordPolicyResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getAccountPasswordPolicyResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("PasswordPolicy", targetDepth)) { getAccountPasswordPolicyResult.setPasswordPolicy(PasswordPolicyStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getAccountPasswordPolicyResult; } } } }
public GetAccountPasswordPolicyResult unmarshall(StaxUnmarshallerContext context) throws Exception { GetAccountPasswordPolicyResult getAccountPasswordPolicyResult = new GetAccountPasswordPolicyResult(); int originalDepth = context.getCurrentDepth(); int targetDepth = originalDepth + 1; if (context.isStartOfDocument()) targetDepth += 2; while (true) { XMLEvent xmlEvent = context.nextEvent(); if (xmlEvent.isEndDocument()) return getAccountPasswordPolicyResult; if (xmlEvent.isAttribute() || xmlEvent.isStartElement()) { if (context.testExpression("PasswordPolicy", targetDepth)) { getAccountPasswordPolicyResult.setPasswordPolicy(PasswordPolicyStaxUnmarshaller.getInstance().unmarshall(context)); continue; } } else if (xmlEvent.isEndElement()) { if (context.getCurrentDepth() < originalDepth) { return getAccountPasswordPolicyResult; } } } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPasswordPolicy() == null) ? 0 : getPasswordPolicy().hashCode()); return hashCode; }
/** * <p> * A structure that contains details about the account's password policy. * </p> * * @param passwordPolicy * A structure that contains details about the account's password policy. * @return Returns a reference to this object so that method calls can be chained together. */ public GetAccountPasswordPolicyResult withPasswordPolicy(PasswordPolicy passwordPolicy) { setPasswordPolicy(passwordPolicy); 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 (getPasswordPolicy() != null) sb.append("PasswordPolicy: ").append(getPasswordPolicy()); sb.append("}"); return sb.toString(); }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetAccountPasswordPolicyResult == false) return false; GetAccountPasswordPolicyResult other = (GetAccountPasswordPolicyResult) obj; if (other.getPasswordPolicy() == null ^ this.getPasswordPolicy() == null) return false; if (other.getPasswordPolicy() != null && other.getPasswordPolicy().equals(this.getPasswordPolicy()) == false) return false; return true; }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getPasswordPolicy() == null) ? 0 : getPasswordPolicy().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 (getPasswordPolicy() != null) sb.append("PasswordPolicy: ").append(getPasswordPolicy()); sb.append("}"); return sb.toString(); }
@Override public boolean backupExistingConfigForResource(String resourceId, String resourceType, Map<String, Object> clientMap, Map<String, String> ruleParams,Map<String, String> issue) throws AutoFixException { LOGGER.debug(String.format("backing up the config for %s" , resourceId)); AmazonIdentityManagementClient client = (AmazonIdentityManagementClient) clientMap .get(PacmanSdkConstants.CLIENT); GetAccountPasswordPolicyResult accountPasswordPolicyResult = client.getAccountPasswordPolicy(); PasswordPolicy passwordPolicy = accountPasswordPolicyResult.getPasswordPolicy(); Gson gson = new GsonBuilder().create(); return backupOldConfig(resourceId, PASSWORD_POLICY, gson.toJson(passwordPolicy)); }
PasswordPolicy passwordPolicy = result.getPasswordPolicy();