updateList method

Future<void> updateList({
  1. required String name,
  2. String? description,
  3. List<String>? elements,
  4. ListUpdateMode? updateMode,
  5. String? variableType,
})

Updates a list.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The name of the list to update.

Parameter description : The new description.

Parameter elements : One or more list elements to add or replace. If you are providing the elements, make sure to specify the updateMode to use.

If you are deleting all elements from the list, use REPLACE for the updateMode and provide an empty list (0 elements).

Parameter updateMode : The update mode (type).

  • Use APPEND if you are adding elements to the list.
  • Use REPLACE if you replacing existing elements in the list.
  • Use REMOVE if you are removing elements from the list.

Parameter variableType : The variable type you want to assign to the list.

Implementation

Future<void> updateList({
  required String name,
  String? description,
  List<String>? elements,
  ListUpdateMode? updateMode,
  String? variableType,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.UpdateList'
  };
  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 (updateMode != null) 'updateMode': updateMode.value,
      if (variableType != null) 'variableType': variableType,
    },
  );
}