deleteFileShare method
Deletes a file share from a file gateway. This operation is only supported for file gateways.
May throw InvalidGatewayRequestException. May throw InternalServerError.
Parameter fileShareARN
:
The Amazon Resource Name (ARN) of the file share to be deleted.
Parameter forceDelete
:
If this value is set to true
, the operation deletes a file
share immediately and aborts all data uploads to AWS. Otherwise, the file
share is not deleted until all data is uploaded to AWS. This process
aborts the data upload process, and the file share enters the
FORCE_DELETING
status.
Valid Values: true
| false
Implementation
Future<DeleteFileShareOutput> deleteFileShare({
required String fileShareARN,
bool? forceDelete,
}) async {
ArgumentError.checkNotNull(fileShareARN, 'fileShareARN');
_s.validateStringLength(
'fileShareARN',
fileShareARN,
50,
500,
isRequired: true,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'StorageGateway_20130630.DeleteFileShare'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'FileShareARN': fileShareARN,
if (forceDelete != null) 'ForceDelete': forceDelete,
},
);
return DeleteFileShareOutput.fromJson(jsonResponse.body);
}