Skip to content

Commit ec388b0

Browse files
Removed unsupported endpoint
1 parent 56f7cf6 commit ec388b0

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

README.rst

-6
Original file line numberDiff line numberDiff line change
@@ -298,12 +298,6 @@ Get suppressed addresses for a given group.
298298
.. code:: python
299299
300300
status, msg = client.asm_suppressions.get(<group_id>)
301-
302-
Get suppression groups associated with a given recipient address.
303-
304-
.. code:: python
305-
306-
status, msg = client.asm_suppressions.get(None,<email_address>)
307301
308302
Delete a recipient email from the suppressions list for a group.
309303

example_v3_test.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,13 @@
1010

1111
client = sendgrid.SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
1212

13+
group_id = 70
14+
status, msg = client.asm_suppressions.get(group_id)
15+
print status
16+
print msg
17+
18+
"""
19+
1320
status, msg = client.asm_groups.post("Magic Key 2", "Unlock your Emails", False)
1421
print status
1522
print msg
@@ -18,8 +25,6 @@
1825
print status
1926
print msg
2027
21-
"""
22-
2328
status, msg = client.asm_groups.get()
2429
print status
2530
print msg
@@ -54,10 +59,6 @@
5459
print status
5560
print msg
5661
57-
status, msg = client.asm_suppressions.get(None,'[email protected]')
58-
print status
59-
print msg
60-
6162
status, msg = client.asm_groups.get([66,67,50])
6263
print status
6364
print msg

sendgrid/resources/asm_suppressions.py

+1-8
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,10 @@ def client(self):
3636
return self._client
3737

3838
# Get suppressed addresses for a given group id.
39-
def get(self, id=None, email=None):
40-
if id == None and email == None:
41-
return self.client.get(self)
42-
39+
def get(self, id=None):
4340
if isinstance(id, int):
4441
self._endpoint = self._base_endpoint + "/" + str(id) + "/suppressions"
4542
return self.client.get(self)
46-
47-
if isinstance(email, str):
48-
self._endpoint = "/v3/asm/suppressions/" + email
49-
5043
return self.client.get(self)
5144

5245
# Add recipient addresses to the suppressions list for a given group.

test/test_asm_suppressions.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_asm_suppressions_init(self):
2727
self.assertEqual(self.asm_suppressions.client, self.client)
2828

2929
def test_asm_suppressions_get(self):
30-
status, msg = self.client.asm_suppressions.get()
30+
status, msg = self.client.asm_suppressions.get(70)
3131
self.assertEqual(status, 200)
3232

3333
def test_asm_suppressions_post(self):

0 commit comments

Comments
 (0)