Skip to content

Commit

Permalink
Removed unsupported endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkingserious committed Oct 16, 2015
1 parent 56f7cf6 commit ec388b0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 21 deletions.
6 changes: 0 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,12 +298,6 @@ Get suppressed addresses for a given group.
.. code:: python
status, msg = client.asm_suppressions.get(<group_id>)
Get suppression groups associated with a given recipient address.

.. code:: python
status, msg = client.asm_suppressions.get(None,<email_address>)
Delete a recipient email from the suppressions list for a group.

Expand Down
13 changes: 7 additions & 6 deletions example_v3_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@

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

group_id = 70
status, msg = client.asm_suppressions.get(group_id)
print status
print msg

"""
status, msg = client.asm_groups.post("Magic Key 2", "Unlock your Emails", False)
print status
print msg
Expand All @@ -18,8 +25,6 @@
print status
print msg
"""
status, msg = client.asm_groups.get()
print status
print msg
Expand Down Expand Up @@ -54,10 +59,6 @@
print status
print msg
status, msg = client.asm_suppressions.get(None,'[email protected]')
print status
print msg
status, msg = client.asm_groups.get([66,67,50])
print status
print msg
Expand Down
9 changes: 1 addition & 8 deletions sendgrid/resources/asm_suppressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,10 @@ def client(self):
return self._client

# Get suppressed addresses for a given group id.
def get(self, id=None, email=None):
if id == None and email == None:
return self.client.get(self)

def get(self, id=None):
if isinstance(id, int):
self._endpoint = self._base_endpoint + "/" + str(id) + "/suppressions"
return self.client.get(self)

if isinstance(email, str):
self._endpoint = "/v3/asm/suppressions/" + email

return self.client.get(self)

# Add recipient addresses to the suppressions list for a given group.
Expand Down
2 changes: 1 addition & 1 deletion test/test_asm_suppressions.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ def test_asm_suppressions_init(self):
self.assertEqual(self.asm_suppressions.client, self.client)

def test_asm_suppressions_get(self):
status, msg = self.client.asm_suppressions.get()
status, msg = self.client.asm_suppressions.get(70)
self.assertEqual(status, 200)

def test_asm_suppressions_post(self):
Expand Down

0 comments on commit ec388b0

Please sign in to comment.