Skip to content

Commit 63bd6bb

Browse files
committed
added eventBridge notification resource spec
1 parent 569b9f7 commit 63bd6bb

2 files changed

Lines changed: 12 additions & 7 deletions

File tree

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
setup(
44
name='python-amazon-sp-api',
5-
version='0.6.2',
5+
version='0.6.3',
66
install_requires=[
77
"requests",
88
"six>=1.15,<2",
9-
"boto3~=1.16.39",
10-
"cachetools~=4.2.0",
9+
"boto3>=1.16.39,<2",
10+
"cachetools>=4.2.0,<2",
1111
"pycryptodome",
1212
"pytz",
13-
"confuse~=1.4.0",
13+
"confuse>=1.4.0,<2",
1414
],
1515
packages=['tests', 'tests.api', 'tests.api.orders', 'tests.api.sellers', 'tests.api.finances',
1616
'tests.api.product_fees', 'tests.api.notifications', 'tests.api.reports', 'tests.client',

sp_api/api/notifications/notifications.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def delete_notification_subscription(self, notification_type: NotificationType o
113113
params={**kwargs})
114114

115115
@sp_endpoint(path='/notifications/v1/destinations', method='POST')
116-
def create_destination(self, name: str, arn: str, **kwargs) -> ApiResponse:
116+
def create_destination(self, name: str, arn: str, account_id: str = None, region: str = None, **kwargs) -> ApiResponse:
117117
"""
118118
create_destination(self, name: str, arn: str, **kwargs) -> ApiResponse
119119
Creates a destination resource to receive notifications. The createDestination API is grantless. For more information, see "Grantless operations" in the Selling Partner API Developer Guide.
@@ -128,6 +128,8 @@ def create_destination(self, name: str, arn: str, **kwargs) -> ApiResponse:
128128
129129
130130
Args:
131+
account_id:
132+
region:
131133
name: str
132134
arn: str
133135
**kwargs:
@@ -136,11 +138,14 @@ def create_destination(self, name: str, arn: str, **kwargs) -> ApiResponse:
136138
ApiResponse:
137139
138140
"""
139-
141+
resource_name = 'sqs' if not account_id else 'eventBridge'
140142
data = {
141143
'resourceSpecification': {
142-
'sqs': {
144+
resource_name: {
143145
'arn': arn
146+
} if not account_id else {
147+
'region': region if region else self.region,
148+
'account_id': account_id
144149
}
145150
},
146151
'name': name,

0 commit comments

Comments
 (0)