class ClientAttributes
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Cognito.ClientAttributes |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awscognito#ClientAttributes |
Java | software.amazon.awscdk.services.cognito.ClientAttributes |
Python | aws_cdk.aws_cognito.ClientAttributes |
TypeScript (source) | aws-cdk-lib » aws_cognito » ClientAttributes |
A set of attributes, useful to set Read and Write attributes.
Example
const pool = new cognito.UserPool(this, 'Pool');
const clientWriteAttributes = (new cognito.ClientAttributes())
.withStandardAttributes({fullname: true, email: true})
.withCustomAttributes('favouritePizza', 'favouriteBeverage');
const clientReadAttributes = clientWriteAttributes
.withStandardAttributes({emailVerified: true})
.withCustomAttributes('pointsEarned');
pool.addClient('app-client', {
// ...
readAttributes: clientReadAttributes,
writeAttributes: clientWriteAttributes,
});
Initializer
new ClientAttributes()
Creates a ClientAttributes with the specified attributes.
Methods
Name | Description |
---|---|
attributes() | The list of attributes represented by this ClientAttributes. |
with | Creates a custom ClientAttributes with the specified attributes. |
with | Creates a custom ClientAttributes with the specified attributes. |
attributes()
public attributes(): string[]
Returns
string[]
The list of attributes represented by this ClientAttributes.
withCustomAttributes(...attributes)
public withCustomAttributes(...attributes: string[]): ClientAttributes
Parameters
- attributes
string
— a list of custom attributes to add to the set.
Returns
Creates a custom ClientAttributes with the specified attributes.
withStandardAttributes(attributes)
public withStandardAttributes(attributes: StandardAttributesMask): ClientAttributes
Parameters
- attributes
Standard
— a list of standard attributes to add to the set.Attributes Mask
Returns
Creates a custom ClientAttributes with the specified attributes.