createACL method

Future<CreateACLResponse> createACL({
  1. required String aCLName,
  2. List<Tag>? tags,
  3. List<String>? userNames,
})

Creates an Access Control List. For more information, see Authenticating users with Access Contol Lists (ACLs).

May throw ACLAlreadyExistsFault. May throw ACLQuotaExceededFault. May throw DefaultUserRequired. May throw DuplicateUserNameFault. May throw InvalidParameterValueException. May throw TagQuotaPerResourceExceeded. May throw UserNotFoundFault.

Parameter aCLName : The name of the Access Control List.

Parameter tags : A list of tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value, although null is accepted.

Parameter userNames : The list of users that belong to the Access Control List.

Implementation

Future<CreateACLResponse> createACL({
  required String aCLName,
  List<Tag>? tags,
  List<String>? userNames,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonMemoryDB.CreateACL'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ACLName': aCLName,
      if (tags != null) 'Tags': tags,
      if (userNames != null) 'UserNames': userNames,
    },
  );

  return CreateACLResponse.fromJson(jsonResponse.body);
}