deleteContainer method

Future<void> deleteContainer({
  1. required String containerName,
})

Deletes the specified container. Before you make a DeleteContainer request, delete any objects in the container or in any folders in the container. You can delete only empty containers.

May throw ContainerInUseException. May throw ContainerNotFoundException. May throw InternalServerError.

Parameter containerName : The name of the container to delete.

Implementation

Future<void> deleteContainer({
  required String containerName,
}) async {
  ArgumentError.checkNotNull(containerName, 'containerName');
  _s.validateStringLength(
    'containerName',
    containerName,
    1,
    255,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'MediaStore_20170901.DeleteContainer'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'ContainerName': containerName,
    },
  );
}