@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getAmbiguousRoleResolution() == null) ? 0 : getAmbiguousRoleResolution().hashCode()); hashCode = prime * hashCode + ((getRulesConfiguration() == null) ? 0 : getRulesConfiguration().hashCode()); return hashCode; }
/** * <p> * If you specify Token or Rules as the <code>Type</code>, <code>AmbiguousRoleResolution</code> is required. * </p> * <p> * Specifies the action to be taken if either no rules match the claim value for the <code>Rules</code> type, or * there is no <code>cognito:preferred_role</code> claim and there are multiple <code>cognito:roles</code> matches * for the <code>Token</code> type. * </p> * * @param ambiguousRoleResolution * If you specify Token or Rules as the <code>Type</code>, <code>AmbiguousRoleResolution</code> is * required.</p> * <p> * Specifies the action to be taken if either no rules match the claim value for the <code>Rules</code> type, * or there is no <code>cognito:preferred_role</code> claim and there are multiple <code>cognito:roles</code> * matches for the <code>Token</code> type. * @return Returns a reference to this object so that method calls can be chained together. * @see AmbiguousRoleResolutionType */ public RoleMapping withAmbiguousRoleResolution(String ambiguousRoleResolution) { setAmbiguousRoleResolution(ambiguousRoleResolution); return this; }
/** * <p> * The rules to be used for mapping users to roles. * </p> * <p> * If you specify Rules as the role mapping type, <code>RulesConfiguration</code> is required. * </p> * * @param rulesConfiguration * The rules to be used for mapping users to roles.</p> * <p> * If you specify Rules as the role mapping type, <code>RulesConfiguration</code> is required. * @return Returns a reference to this object so that method calls can be chained together. */ public RoleMapping withRulesConfiguration(RulesConfigurationType rulesConfiguration) { setRulesConfiguration(rulesConfiguration); return this; }
public RoleMapping unmarshall(JsonUnmarshallerContext context) throws Exception { RoleMapping roleMapping = new RoleMapping(); if (context.testExpression("Type", targetDepth)) { context.nextToken(); roleMapping.setType(context.getUnmarshaller(String.class).unmarshall(context)); roleMapping.setAmbiguousRoleResolution(context.getUnmarshaller(String.class).unmarshall(context)); roleMapping.setRulesConfiguration(RulesConfigurationTypeJsonUnmarshaller.getInstance().unmarshall(context));
/** * <p> * The role mapping type. Token will use <code>cognito:roles</code> and <code>cognito:preferred_role</code> claims * from the Cognito identity provider token to map groups to roles. Rules will attempt to match claims from the * token to map to a role. * </p> * * @param type * The role mapping type. Token will use <code>cognito:roles</code> and <code>cognito:preferred_role</code> * claims from the Cognito identity provider token to map groups to roles. Rules will attempt to match claims * from the token to map to a role. * @return Returns a reference to this object so that method calls can be chained together. * @see RoleMappingType */ public RoleMapping withType(String type) { setType(type); return this; }
/** * <p> * The role mapping type. Token will use <code>cognito:roles</code> and <code>cognito:preferred_role</code> claims * from the Cognito identity provider token to map groups to roles. Rules will attempt to match claims from the * token to map to a role. * </p> * * @param type * The role mapping type. Token will use <code>cognito:roles</code> and <code>cognito:preferred_role</code> * claims from the Cognito identity provider token to map groups to roles. Rules will attempt to match claims * from the token to map to a role. * @see RoleMappingType */ public void setType(RoleMappingType type) { withType(type); }
/** * <p> * If you specify Token or Rules as the <code>Type</code>, <code>AmbiguousRoleResolution</code> is required. * </p> * <p> * Specifies the action to be taken if either no rules match the claim value for the <code>Rules</code> type, or * there is no <code>cognito:preferred_role</code> claim and there are multiple <code>cognito:roles</code> matches * for the <code>Token</code> type. * </p> * * @param ambiguousRoleResolution * If you specify Token or Rules as the <code>Type</code>, <code>AmbiguousRoleResolution</code> is * required.</p> * <p> * Specifies the action to be taken if either no rules match the claim value for the <code>Rules</code> type, * or there is no <code>cognito:preferred_role</code> claim and there are multiple <code>cognito:roles</code> * matches for the <code>Token</code> type. * @see AmbiguousRoleResolutionType */ public void setAmbiguousRoleResolution(AmbiguousRoleResolutionType ambiguousRoleResolution) { withAmbiguousRoleResolution(ambiguousRoleResolution); }
public RoleMapping unmarshall(JsonUnmarshallerContext context) throws Exception { AwsJsonReader reader = context.getReader(); if (!reader.isContainer()) { reader.skipValue(); return null; } RoleMapping roleMapping = new RoleMapping(); reader.beginObject(); while (reader.hasNext()) { String name = reader.nextName(); if (name.equals("Type")) { roleMapping.setType(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("AmbiguousRoleResolution")) { roleMapping.setAmbiguousRoleResolution(StringJsonUnmarshaller.getInstance() .unmarshall(context)); } else if (name.equals("RulesConfiguration")) { roleMapping.setRulesConfiguration(RulesConfigurationTypeJsonUnmarshaller .getInstance() .unmarshall(context)); } else { reader.skipValue(); } } reader.endObject(); return roleMapping; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RoleMapping == false) return false; RoleMapping other = (RoleMapping) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getAmbiguousRoleResolution() == null ^ this.getAmbiguousRoleResolution() == null) return false; if (other.getAmbiguousRoleResolution() != null && other.getAmbiguousRoleResolution().equals(this.getAmbiguousRoleResolution()) == false) return false; if (other.getRulesConfiguration() == null ^ this.getRulesConfiguration() == null) return false; if (other.getRulesConfiguration() != null && other.getRulesConfiguration().equals(this.getRulesConfiguration()) == 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 (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getAmbiguousRoleResolution() != null) sb.append("AmbiguousRoleResolution: ").append(getAmbiguousRoleResolution()).append(","); if (getRulesConfiguration() != null) sb.append("RulesConfiguration: ").append(getRulesConfiguration()); sb.append("}"); return sb.toString(); }
/** * Marshall the given parameter object. */ public void marshall(RoleMapping roleMapping, ProtocolMarshaller protocolMarshaller) { if (roleMapping == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(roleMapping.getType(), TYPE_BINDING); protocolMarshaller.marshall(roleMapping.getAmbiguousRoleResolution(), AMBIGUOUSROLERESOLUTION_BINDING); protocolMarshaller.marshall(roleMapping.getRulesConfiguration(), RULESCONFIGURATION_BINDING); } catch (Exception e) { throw new SdkClientException("Unable to marshall request to JSON: " + e.getMessage(), e); } }
@Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getAmbiguousRoleResolution() == null) ? 0 : getAmbiguousRoleResolution() .hashCode()); hashCode = prime * hashCode + ((getRulesConfiguration() == null) ? 0 : getRulesConfiguration().hashCode()); return hashCode; }
@Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof RoleMapping == false) return false; RoleMapping other = (RoleMapping) obj; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getAmbiguousRoleResolution() == null ^ this.getAmbiguousRoleResolution() == null) return false; if (other.getAmbiguousRoleResolution() != null && other.getAmbiguousRoleResolution().equals(this.getAmbiguousRoleResolution()) == false) return false; if (other.getRulesConfiguration() == null ^ this.getRulesConfiguration() == null) return false; if (other.getRulesConfiguration() != null && other.getRulesConfiguration().equals(this.getRulesConfiguration()) == false) return false; return true; } }
/** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getType() != null) sb.append("Type: " + getType() + ","); if (getAmbiguousRoleResolution() != null) sb.append("AmbiguousRoleResolution: " + getAmbiguousRoleResolution() + ","); if (getRulesConfiguration() != null) sb.append("RulesConfiguration: " + getRulesConfiguration()); sb.append("}"); return sb.toString(); }
public void marshall(RoleMapping roleMapping, AwsJsonWriter jsonWriter) throws Exception { jsonWriter.beginObject(); if (roleMapping.getType() != null) { String type = roleMapping.getType(); jsonWriter.name("Type"); jsonWriter.value(type); } if (roleMapping.getAmbiguousRoleResolution() != null) { String ambiguousRoleResolution = roleMapping.getAmbiguousRoleResolution(); jsonWriter.name("AmbiguousRoleResolution"); jsonWriter.value(ambiguousRoleResolution); } if (roleMapping.getRulesConfiguration() != null) { RulesConfigurationType rulesConfiguration = roleMapping.getRulesConfiguration(); jsonWriter.name("RulesConfiguration"); RulesConfigurationTypeJsonMarshaller.getInstance().marshall(rulesConfiguration, jsonWriter); } jsonWriter.endObject(); }