putDataProtectionPolicy method

Future<void> putDataProtectionPolicy({
  1. required String dataProtectionPolicy,
  2. required String resourceArn,
})

Adds or updates an inline policy document that is stored in the specified Amazon SNS topic.

May throw AuthorizationErrorException. May throw InternalErrorException. May throw InvalidParameterException. May throw InvalidSecurityException. May throw NotFoundException.

Parameter dataProtectionPolicy : The JSON serialization of the topic's DataProtectionPolicy.

The DataProtectionPolicy must be in JSON string format.

Length Constraints: Maximum length of 30,720.

Parameter resourceArn : The ARN of the topic whose DataProtectionPolicy you want to add or update.

For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference.

Implementation

Future<void> putDataProtectionPolicy({
  required String dataProtectionPolicy,
  required String resourceArn,
}) async {
  final $request = <String, String>{
    'DataProtectionPolicy': dataProtectionPolicy,
    'ResourceArn': resourceArn,
  };
  await _protocol.send(
    $request,
    action: 'PutDataProtectionPolicy',
    version: '2010-03-31',
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
  );
}