put_data_protection_policy(
resource_arn: topicARN,
data_protection_policy: attributeValue,
*,
config_overrides: Optional[SNSClientConfig] = None,
) -> None
Amazon SNS message data protection is no longer available to new customers. For more information and guidance on alternatives, see Amazon SNS message data protection availability change.
Adds or updates an inline policy document that is stored in the specified Amazon SNS topic.
Parameters:
-
resource_arn
(topicARN)
–
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.
-
data_protection_policy
(attributeValue)
–
The JSON serialization of the topic's DataProtectionPolicy.
The DataProtectionPolicy must be in JSON string format.
Length Constraints: Maximum length of 30,720.
Raises:
Source code in docs_src/capo_sns/_services/sns.py
| def put_data_protection_policy(
self,
resource_arn: "capo_sns.types.topic_arn.topicARN",
data_protection_policy: "capo_sns.types.attribute_value.attributeValue",
*,
config_overrides: Optional[SNSClientConfig] = None,
) -> None:
"""<important> <p>Amazon SNS message data protection is no longer available to new customers. For more information and guidance on alternatives, see <a href="https://docs.aws.amazon.com/sns/latest/dg/sns-message-data-protection-availability-change.html">Amazon SNS message data protection availability change</a>.</p> </important> <p>Adds or updates an inline policy document that is stored in the specified Amazon SNS topic.</p>
Args:
resource_arn: <p>The ARN of the topic whose <code>DataProtectionPolicy</code> you want to add or update.</p> <p>For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html">Amazon Resource Names (ARNs)</a> in the Amazon Web Services General Reference.</p>
data_protection_policy: <p>The JSON serialization of the topic's <code>DataProtectionPolicy</code>.</p> <p>The <code>DataProtectionPolicy</code> must be in JSON string format.</p> <p>Length Constraints: Maximum length of 30,720.</p>
Raises:
capo_sns.errors.authorization_error_exception.AuthorizationErrorException: <p>Indicates that the user has been denied access to the requested resource.</p>
capo_sns.errors.internal_error_exception.InternalErrorException: <p>Indicates an internal service error.</p>
capo_sns.errors.invalid_parameter_exception.InvalidParameterException: <p>Indicates that a request parameter does not comply with the associated constraints.</p>
capo_sns.errors.invalid_security_exception.InvalidSecurityException: <p>The credential signature isn't valid. You must use an HTTPS endpoint and sign your request using Signature Version 4.</p>
capo_sns.errors.not_found_exception.NotFoundException: <p>Indicates that the requested resource does not exist.</p>
capo_sns.errors.UnknownServiceError: The service returned an error code this client does not model.
"""
def _handler(
req: "OperationRequest[capo_sns.types.put_data_protection_policy_input.PutDataProtectionPolicyInput]",
) -> OperationResponse[None]:
import capo_sns._operations.amazon_simple_notification_service.put_data_protection_policy
output, http_response = (
capo_sns._operations.amazon_simple_notification_service.put_data_protection_policy.put_data_protection_policy(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("PutDataProtectionPolicy")
)
input_: capo_sns.types.put_data_protection_policy_input.PutDataProtectionPolicyInput = {
"resource_arn": resource_arn,
"data_protection_policy": data_protection_policy,
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|