Interface StandardAttribute

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
StandardAttribute.Jsii$Proxy

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:04.714Z") @Stability(Stable) public interface StandardAttribute extends software.amazon.jsii.JsiiSerializable
Standard attribute that can be marked as required or mutable.

Example:

 UserPool.Builder.create(this, "myuserpool")
         // ...
         .standardAttributes(StandardAttributes.builder()
                 .fullname(StandardAttribute.builder()
                         .required(true)
                         .mutable(false)
                         .build())
                 .address(StandardAttribute.builder()
                         .required(false)
                         .mutable(true)
                         .build())
                 .build())
         .customAttributes(Map.of(
                 "myappid", StringAttribute.Builder.create().minLen(5).maxLen(15).mutable(false).build(),
                 "callingcode", NumberAttribute.Builder.create().min(1).max(3).mutable(true).build(),
                 "isEmployee", BooleanAttribute.Builder.create().mutable(true).build(),
                 "joinedOn", new DateTimeAttribute()))
         .build();
 

See Also:
  • Method Details

    • getMutable

      @Stability(Stable) @Nullable default Boolean getMutable()
      Specifies whether the value of the attribute can be changed.

      For any user pool attribute that's mapped to an identity provider attribute, this must be set to true. Amazon Cognito updates mapped attributes when users sign in to your application through an identity provider. If an attribute is immutable, Amazon Cognito throws an error when it attempts to update the attribute.

      Default: true

    • getRequired

      @Stability(Stable) @Nullable default Boolean getRequired()
      Specifies whether the attribute is required upon user registration.

      If the attribute is required and the user does not provide a value, registration or sign-in will fail.

      Default: false

    • builder

      @Stability(Stable) static StandardAttribute.Builder builder()
      Returns:
      a StandardAttribute.Builder of StandardAttribute