notifyWhenUploaded method

Future<NotifyWhenUploadedOutput> notifyWhenUploaded({
  1. required String fileShareARN,
})

Sends you notification through CloudWatch Events when all files written to your file share have been uploaded to Amazon S3.

AWS Storage Gateway can send a notification through Amazon CloudWatch Events when all files written to your file share up to that point in time have been uploaded to Amazon S3. These files include files written to the file share up to the time that you make a request for notification. When the upload is done, Storage Gateway sends you notification through an Amazon CloudWatch Event. You can configure CloudWatch Events to send the notification through event targets such as Amazon SNS or AWS Lambda function. This operation is only supported for file gateways.

For more information, see Getting file upload notification in the AWS Storage Gateway User Guide.

May throw InvalidGatewayRequestException. May throw InternalServerError.

Implementation

Future<NotifyWhenUploadedOutput> notifyWhenUploaded({
  required String fileShareARN,
}) 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.NotifyWhenUploaded'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'FileShareARN': fileShareARN,
    },
  );

  return NotifyWhenUploadedOutput.fromJson(jsonResponse.body);
}