DescribeReceiptRuleSet搭配使用 AWS SDK - AWS SDK代码示例

AWS 文档 AWS SDK示例 GitHub 存储库中还有更多SDK示例

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

DescribeReceiptRuleSet搭配使用 AWS SDK

以下代码示例显示了如何使用DescribeReceiptRuleSet

Python
SDK适用于 Python (Boto3)
注意

还有更多相关信息 GitHub。查找完整示例,学习如何在 AWS 代码示例存储库中进行设置和运行。

class SesReceiptHandler: """Encapsulates Amazon SES receipt handling functions.""" def __init__(self, ses_client, s3_resource): """ :param ses_client: A Boto3 Amazon SES client. :param s3_resource: A Boto3 Amazon S3 resource. """ self.ses_client = ses_client self.s3_resource = s3_resource def describe_receipt_rule_set(self, rule_set_name): """ Gets data about a rule set. :param rule_set_name: The name of the rule set to retrieve. :return: Data about the rule set. """ try: response = self.ses_client.describe_receipt_rule_set( RuleSetName=rule_set_name ) logger.info("Got data for rule set %s.", rule_set_name) except ClientError: logger.exception("Couldn't get data for rule set %s.", rule_set_name) raise else: return response