Allow attributes to be set with subscribe command (#1705)
This commit is contained in:
parent
802402bdba
commit
51db19067c
2 changed files with 71 additions and 0 deletions
|
|
@ -181,6 +181,7 @@ class SNSResponse(BaseResponse):
|
|||
topic_arn = self._get_param('TopicArn')
|
||||
endpoint = self._get_param('Endpoint')
|
||||
protocol = self._get_param('Protocol')
|
||||
attributes = self._get_attributes()
|
||||
|
||||
if protocol == 'sms' and not is_e164(endpoint):
|
||||
return self._error(
|
||||
|
|
@ -190,6 +191,10 @@ class SNSResponse(BaseResponse):
|
|||
|
||||
subscription = self.backend.subscribe(topic_arn, endpoint, protocol)
|
||||
|
||||
if attributes is not None:
|
||||
for attr_name, attr_value in attributes.items():
|
||||
self.backend.set_subscription_attributes(subscription.arn, attr_name, attr_value)
|
||||
|
||||
if self.request_json:
|
||||
return json.dumps({
|
||||
"SubscribeResponse": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue