putBucketNotification method

  1. @Deprecated('Deprecated')
Future<void> putBucketNotification({
  1. required String bucket,
  2. required NotificationConfigurationDeprecated notificationConfiguration,
  3. String? contentMD5,
  4. String? expectedBucketOwner,
})

No longer used, see the PutBucketNotificationConfiguration operation.

Parameter bucket : The name of the bucket.

Parameter notificationConfiguration : The container for the configuration.

Parameter contentMD5 : The MD5 hash of the PutPublicAccessBlock request body.

For requests made using the AWS Command Line Interface (CLI) or AWS SDKs, this field is calculated automatically.

Parameter expectedBucketOwner : The account id of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.

Implementation

@Deprecated('Deprecated')
Future<void> putBucketNotification({
  required String bucket,
  required NotificationConfigurationDeprecated notificationConfiguration,
  String? contentMD5,
  String? expectedBucketOwner,
}) async {
  ArgumentError.checkNotNull(bucket, 'bucket');
  ArgumentError.checkNotNull(
      notificationConfiguration, 'notificationConfiguration');
  final headers = <String, String>{
    if (contentMD5 != null) 'Content-MD5': contentMD5.toString(),
    if (expectedBucketOwner != null)
      'x-amz-expected-bucket-owner': expectedBucketOwner.toString(),
  };
  await _protocol.send(
    method: 'PUT',
    requestUri: '/${Uri.encodeComponent(bucket)}?notification',
    headers: headers,
    payload: notificationConfiguration.toXml('NotificationConfiguration'),
    exceptionFnMap: _exceptionFns,
  );
}