createAllowList method
Creates and defines the settings for an allow list.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter criteria :
The criteria that specify the text or text pattern to ignore. The criteria
can be the location and name of an S3 object that lists specific text to
ignore (s3WordsList), or a regular expression (regex) that defines a text
pattern to ignore.
Parameter name :
A custom name for the allow list. The name can contain as many as 128
characters.
Parameter clientToken :
A unique, case-sensitive token that you provide to ensure the idempotency
of the request.
Parameter description :
A custom description of the allow list. The description can contain as
many as 512 characters.
Parameter tags :
A map of key-value pairs that specifies the tags to associate with the
allow list.
An allow list can have a maximum of 50 tags. Each tag consists of a tag key and an associated tag value. The maximum length of a tag key is 128 characters. The maximum length of a tag value is 256 characters.
Implementation
Future<CreateAllowListResponse> createAllowList({
required AllowListCriteria criteria,
required String name,
String? clientToken,
String? description,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'criteria': criteria,
'name': name,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (description != null) 'description': description,
if (tags != null) 'tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/allow-lists',
exceptionFnMap: _exceptionFns,
);
return CreateAllowListResponse.fromJson(response);
}