createList method

Future<void> createList({
  1. required String name,
  2. String? description,
  3. List<String>? elements,
  4. List<Tag>? tags,
  5. String? variableType,
})

Creates a list.

List is a set of input data for a variable in your event dataset. You use the input data in a rule that's associated with your detector. For more information, see Lists.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the list.

Parameter description : The description of the list.

Parameter elements : The names of the elements, if providing. You can also create an empty list and add elements later using the UpdateList API.

Parameter tags : A collection of the key and value pairs.

Parameter variableType : The variable type of the list. You can only assign the variable type with String data type. For more information, see Variable types.

Implementation

Future<void> createList({
  required String name,
  String? description,
  List<String>? elements,
  List<Tag>? tags,
  String? variableType,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.CreateList'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'name': name,
      if (description != null) 'description': description,
      if (elements != null) 'elements': elements,
      if (tags != null) 'tags': tags,
      if (variableType != null) 'variableType': variableType,
    },
  );
}