# ClientAttributes

A set of attributes, useful to set Read and Write attributes.

- Source: [`aws-cognito/lib/user-pool-attr.ts`](https://github.com/aws/aws-cdk/blob/v2.277.0/packages/aws-cdk-lib/aws-cognito/lib/user-pool-attr.ts#L488)

## Example

TypeScript:

```ts
const pool = new cognito.UserPool(this, 'Pool');

const clientWriteAttributes = (new cognito.ClientAttributes())
  .withStandardAttributes({fullname: true, email: true})
  .withCustomAttributes('favoritePizza', 'favoriteBeverage');

const clientReadAttributes = clientWriteAttributes
  .withStandardAttributes({emailVerified: true})
  .withCustomAttributes('pointsEarned');

pool.addClient('app-client', {
  // ...
  readAttributes: clientReadAttributes,
  writeAttributes: clientWriteAttributes,
});
```

Python:

```python
pool = cognito.UserPool(self, "Pool")

client_write_attributes = (cognito.ClientAttributes()).with_standard_attributes(fullname=True, email=True).with_custom_attributes("favoritePizza", "favoriteBeverage")

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
)
```

Java:

```java
UserPool pool = new UserPool(this, "Pool");

ClientAttributes clientWriteAttributes = (new ClientAttributes()).withStandardAttributes(StandardAttributesMask.builder().fullname(true).email(true).build()).withCustomAttributes("favoritePizza", "favoriteBeverage");

ClientAttributes clientReadAttributes = clientWriteAttributes.withStandardAttributes(StandardAttributesMask.builder().emailVerified(true).build()).withCustomAttributes("pointsEarned");

pool.addClient("app-client", UserPoolClientOptions.builder()
        // ...
        .readAttributes(clientReadAttributes)
        .writeAttributes(clientWriteAttributes)
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
var pool = new UserPool(this, "Pool");

var clientWriteAttributes = (new ClientAttributes()).WithStandardAttributes(new StandardAttributesMask { Fullname = true, Email = true }).WithCustomAttributes("favoritePizza", "favoriteBeverage");

var clientReadAttributes = clientWriteAttributes.WithStandardAttributes(new StandardAttributesMask { EmailVerified = true }).WithCustomAttributes("pointsEarned");

pool.AddClient("app-client", new UserPoolClientOptions {
    // ...
    ReadAttributes = clientReadAttributes,
    WriteAttributes = clientWriteAttributes
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
pool := cognito.NewUserPool(this, jsii.String("Pool"))

clientWriteAttributes := (cognito.NewClientAttributes()).WithStandardAttributes(&StandardAttributesMask{
	Fullname: jsii.Boolean(true),
	Email: jsii.Boolean(true),
}).WithCustomAttributes(jsii.String("favoritePizza"), jsii.String("favoriteBeverage"))

clientReadAttributes := clientWriteAttributes.WithStandardAttributes(&StandardAttributesMask{
	EmailVerified: jsii.Boolean(true),
}).WithCustomAttributes(jsii.String("pointsEarned"))

pool.addClient(jsii.String("app-client"), &UserPoolClientOptions{
	// ...
	ReadAttributes: clientReadAttributes,
	WriteAttributes: clientWriteAttributes,
})
```

## Initializer

TypeScript:

```ts
new ClientAttributes()
```

Python:

```python
ClientAttributes()
```

Java:

```java
new ClientAttributes()
```

C# / .NET:

```csharp
new ClientAttributes()
```

Golang:

```go
NewClientAttributes()
```

## Methods

- `attributes(): string[]` — The list of attributes represented by this ClientAttributes.

- `withCustomAttributes(...attributes: string[]): ClientAttributes // chainable` — Creates a custom ClientAttributes with the specified attributes.

  **Parameters**

  - `attributes` — a list of custom attributes to add to the set.

- `withStandardAttributes(attributes: StandardAttributesMask): ClientAttributes // chainable` — Creates a custom ClientAttributes with the specified attributes.

  **Parameters**

  - `attributes` — a list of standard attributes to add to the set.
