ClientAttributes
- class aws_cdk.aws_cognito.ClientAttributes
Bases:
object
A set of attributes, useful to set Read and Write attributes.
- ExampleMetadata:
infused
Example:
pool = cognito.UserPool(self, "Pool") client_write_attributes = (cognito.ClientAttributes()).with_standard_attributes(fullname=True, email=True).with_custom_attributes("favouritePizza", "favouriteBeverage") client_read_attributes = client_write_attributes.with_standard_attributes(email_verified=True).with_custom_attributes("pointsEarned") pool.add_client("app-client", # ... read_attributes=client_read_attributes, write_attributes=client_write_attributes )
Creates a ClientAttributes with the specified attributes.
- Default:
a ClientAttributes object without any attributes
Methods
- attributes()
The list of attributes represented by this ClientAttributes.
- Return type:
List
[str
]
- with_custom_attributes(*attributes)
Creates a custom ClientAttributes with the specified attributes.
- Parameters:
attributes (
str
) – a list of custom attributes to add to the set.- Return type:
- with_standard_attributes(*, address=None, birthdate=None, email=None, email_verified=None, family_name=None, fullname=None, gender=None, given_name=None, last_update_time=None, locale=None, middle_name=None, nickname=None, phone_number=None, phone_number_verified=None, preferred_username=None, profile_page=None, profile_picture=None, timezone=None, website=None)
Creates a custom ClientAttributes with the specified attributes.
- Parameters:
address (
Optional
[bool
]) – The user’s postal address. Default: falsebirthdate (
Optional
[bool
]) – The user’s birthday, represented as an ISO 8601:2004 format. Default: falseemail (
Optional
[bool
]) – The user’s e-mail address, represented as an RFC 5322 [RFC5322] addr-spec. Default: falseemail_verified (
Optional
[bool
]) – Whether the email address has been verified. Default: falsefamily_name (
Optional
[bool
]) – The surname or last name of the user. Default: falsefullname (
Optional
[bool
]) – The user’s full name in displayable form, including all name parts, titles and suffixes. Default: falsegender (
Optional
[bool
]) – The user’s gender. Default: falsegiven_name (
Optional
[bool
]) – The user’s first name or give name. Default: falselast_update_time (
Optional
[bool
]) – The time, the user’s information was last updated. Default: falselocale (
Optional
[bool
]) – The user’s locale, represented as a BCP47 [RFC5646] language tag. Default: falsemiddle_name (
Optional
[bool
]) – The user’s middle name. Default: falsenickname (
Optional
[bool
]) – The user’s nickname or casual name. Default: falsephone_number (
Optional
[bool
]) – The user’s telephone number. Default: falsephone_number_verified (
Optional
[bool
]) – Whether the phone number has been verified. Default: falsepreferred_username (
Optional
[bool
]) – The user’s preffered username, different from the immutable user name. Default: falseprofile_page (
Optional
[bool
]) – The URL to the user’s profile page. Default: falseprofile_picture (
Optional
[bool
]) – The URL to the user’s profile picture. Default: falsetimezone (
Optional
[bool
]) – The user’s time zone. Default: falsewebsite (
Optional
[bool
]) – The URL to the user’s web page or blog. Default: false
- Return type: