/** * <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; }
if (context.testExpression("Type", targetDepth)) { context.nextToken(); roleMapping.setType(context.getUnmarshaller(String.class).unmarshall(context));
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; }